diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java index 25d61da7b..3d2fcebb8 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java @@ -29,7 +29,6 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Collection; import lombok.RequiredArgsConstructor; -import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.organisation.teller.data.CashierData; import org.apache.fineract.organisation.teller.service.TellerManagementReadPlatformService; @@ -41,20 +40,15 @@ import org.springframework.stereotype.Component; @RequiredArgsConstructor public class CashierApiResource { - private final DefaultToApiJsonSerializer jsonSerializer; private final TellerManagementReadPlatformService readPlatformService; @GET @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - public String getCashierData(@QueryParam("officeId") final Long officeId, @QueryParam("tellerId") final Long tellerId, + public Collection getCashierData(@QueryParam("officeId") final Long officeId, @QueryParam("tellerId") final Long tellerId, @QueryParam("staffId") final Long staffId, @QueryParam("date") final String date) { - final DateTimeFormatter dateFormatter = DateTimeFormatter.BASIC_ISO_DATE; - - final LocalDate dateRestriction = (date != null ? LocalDate.parse(date, dateFormatter) : DateUtils.getBusinessLocalDate()); - - final Collection allCashiers = this.readPlatformService.getCashierData(officeId, tellerId, staffId, dateRestriction); - - return this.jsonSerializer.serialize(allCashiers); + final LocalDate dateRestriction = date != null ? LocalDate.parse(date, DateTimeFormatter.BASIC_ISO_DATE) + : DateUtils.getBusinessLocalDate(); + return readPlatformService.getCashierData(officeId, tellerId, staffId, dateRestriction); } } diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java index 64c7d0b13..ee2b576ca 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java @@ -27,9 +27,6 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; import java.util.Collection; import lombok.RequiredArgsConstructor; -import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; -import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; -import org.apache.fineract.organisation.teller.data.TellerData; import org.apache.fineract.organisation.teller.data.TellerJournalData; import org.apache.fineract.organisation.teller.service.TellerManagementReadPlatformService; import org.apache.fineract.organisation.teller.util.DateRange; @@ -41,20 +38,16 @@ import org.springframework.stereotype.Component; @RequiredArgsConstructor public class TellerJournalApiResource { - private final PlatformSecurityContext securityContext; - private final DefaultToApiJsonSerializer jsonSerializer; private final TellerManagementReadPlatformService readPlatformService; @GET @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - public String getJournalData(@QueryParam("officeId") final Long officeId, @QueryParam("tellerId") final Long tellerId, - @QueryParam("cashierId") final Long cashierId, @QueryParam("dateRange") final String dateRange) { + public Collection getJournalData(@QueryParam("officeId") final Long officeId, + @QueryParam("tellerId") final Long tellerId, @QueryParam("cashierId") final Long cashierId, + @QueryParam("dateRange") final String dateRange) { final DateRange dateRangeHolder = DateRange.fromString(dateRange); - final Collection journals = this.readPlatformService.getJournals(officeId, tellerId, cashierId, - dateRangeHolder.getStartDate(), dateRangeHolder.getEndDate()); - - return this.jsonSerializer.serialize(journals); + return readPlatformService.getJournals(officeId, tellerId, cashierId, dateRangeHolder.getStartDate(), dateRangeHolder.getEndDate()); } }