rectify query for cashier-teller transactions

This commit is contained in:
Wilfred Kigenyi
2024-10-31 08:59:22 +01:00
committed by Arnold Gálovics
parent 542cad793d
commit d202145a88
7 changed files with 259 additions and 84 deletions
@@ -300,9 +300,9 @@ public class TellerApiResource {
@Path("{tellerId}/cashiers/{cashierId}/transactions")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Retrieve Cashier Transaction", description = "")
@Operation(summary = "Retrieve Cashier Transactions", description = "")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class)))) })
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class))) })
public String getTransactionsForCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId,
@QueryParam("currencyCode") @Parameter(description = "currencyCode") final String currencyCode,
@@ -331,10 +331,10 @@ public class TellerApiResource {
@Path("{tellerId}/cashiers/{cashierId}/summaryandtransactions")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Transactions Wtih Summary For Cashier", description = "")
@Operation(summary = "Retrieve Transactions With Summary For Cashier", description = "")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse.class))) })
public String getTransactionsWtihSummaryForCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
public String getTransactionsWithSummaryForCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId,
@PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId,
@QueryParam("currencyCode") @Parameter(description = "currencyCode") final String currencyCode,
@QueryParam("offset") @Parameter(description = "offset") final Integer offset,
@@ -40,4 +40,5 @@ public class CashierNotFoundException extends AbstractPlatformResourceNotFoundEx
public CashierNotFoundException(Long cashierId) {
super(ERROR_MESSAGE_CODE, DEFAULT_ERROR_MESSAGE, cashierId);
}
}
@@ -19,6 +19,7 @@
package org.apache.fineract.organisation.teller.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
import org.springframework.dao.EmptyResultDataAccessException;
/**
* Indicates that a teller could not be found.
@@ -40,4 +41,8 @@ public class TellerNotFoundException extends AbstractPlatformResourceNotFoundExc
public TellerNotFoundException(Long tellerId) {
super(ERROR_MESSAGE_CODE, DEFAULT_ERROR_MESSAGE, tellerId);
}
public TellerNotFoundException(Long id, EmptyResultDataAccessException e) {
super("error.msg.teller.id.invalid", "Teller with identifier " + id + " does not exist", id, e);
}
}