FINERACT-2421: Refractor redundant and some deprecated code as per new Java 21 style (Phase 4)
This commit is contained in:
+3
-5
@@ -87,11 +87,9 @@ public class CheckDueInstallmentsBusinessStep implements LoanCOBBusinessStep {
|
||||
ThreadLocalContextUtil.setActionContext(ActionContext.COB);
|
||||
}
|
||||
}
|
||||
}, duration -> {
|
||||
log.debug(
|
||||
"Ending custom snapshot event processing for loan with Id [{}], account number [{}], external Id [{}], finished in [{}]ms.",
|
||||
loan.getId(), loan.getAccountNumber(), externalId, duration.toMillis());
|
||||
});
|
||||
}, duration -> log.debug(
|
||||
"Ending custom snapshot event processing for loan with Id [{}], account number [{}], external Id [{}], finished in [{}]ms.",
|
||||
loan.getId(), loan.getAccountNumber(), externalId, duration.toMillis()));
|
||||
|
||||
return loan;
|
||||
}
|
||||
|
||||
-17
@@ -44,8 +44,6 @@ public class ChargeWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
worksheet.setColumnWidth(ChargeConstants.CHARGE_NAME_COL, TemplatePopulateImportConstants.SMALL_COL_SIZE);
|
||||
worksheet.setColumnWidth(ChargeConstants.CHARGE_AMOUNT_COL, TemplatePopulateImportConstants.MEDIUM_COL_SIZE);
|
||||
worksheet.setColumnWidth(ChargeConstants.CHARGE_CALCULATION_TYPE_COL, TemplatePopulateImportConstants.MEDIUM_COL_SIZE);
|
||||
// worksheet.setColumnWidth(ChargeConstants.CHARGE_DUE_DATE_COL,
|
||||
// TemplatePopulateImportConstants.MEDIUM_COL_SIZE);
|
||||
worksheet.setColumnWidth(ChargeConstants.CHARGE_TIME_TYPE_COL, TemplatePopulateImportConstants.MEDIUM_COL_SIZE);
|
||||
|
||||
writeString(0, rowHeader, "ID");
|
||||
@@ -56,19 +54,4 @@ public class ChargeWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
writeString(ChargeConstants.CHARGE_TIME_TYPE_COL, rowHeader, "Charge Time Type*");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setRules(Sheet workSheet, final String dateFormat) {
|
||||
// CellRangeAddressList dueDateRange = new CellRangeAddressList(1, SpreadsheetVersion.EXCEL97.getLastRowIndex(),
|
||||
// ChargeConstants.CHARGE_DUE_DATE_COL, ChargeConstants.CHARGE_DUE_DATE_COL);
|
||||
|
||||
// DataValidationHelper validationHelper = new HSSFDataValidationHelper((HSSFSheet) workSheet);
|
||||
|
||||
// DataValidationConstraint dueDateConstraint = validationHelper
|
||||
// .createDateConstraint(DataValidationConstraint.OperatorType.GREATER_OR_EQUAL, "=TODAY()", null, dateFormat);
|
||||
|
||||
// DataValidation dueDateValidation = validationHelper.createValidation(dueDateConstraint, dueDateRange);
|
||||
|
||||
// workSheet.addValidationData(dueDateValidation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+14
-6
@@ -92,8 +92,13 @@ public class ClientAddressApiResource {
|
||||
@Path("/{clientid}/addresses")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "List all addresses for a Client", description = "Example Requests:\n" + "\n" + "client/1/addresses\n" + "\n"
|
||||
+ "\n" + "clients/1/addresses?status=false,true&&type=1,2,3")
|
||||
@Operation(summary = "List all addresses for a Client", description = """
|
||||
Example Requests:
|
||||
|
||||
client/1/addresses
|
||||
|
||||
|
||||
clients/1/addresses?status=false,true&&type=1,2,3""")
|
||||
public List<AddressData> getAddresses(@QueryParam("status") @Parameter(description = "status") final String status,
|
||||
@QueryParam("type") @Parameter(description = "type") final long addressTypeId,
|
||||
@PathParam("clientid") @Parameter(description = "clientId") final long clientid) {
|
||||
@@ -105,11 +110,14 @@ public class ClientAddressApiResource {
|
||||
@Path("/{clientid}/addresses")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Update an address for a Client", description = "All the address fields can be updated by using update client address API\n"
|
||||
+ "\n" + "Mandatory Fields\n" + "type and addressId")
|
||||
@Operation(summary = "Update an address for a Client", description = """
|
||||
All the address fields can be updated by using update client address API
|
||||
|
||||
Mandatory Fields
|
||||
type and addressId""")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientAddressRequest.class)))
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesResponse.class))) })
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesResponse.class)))
|
||||
public CommandProcessingResult updateClientAddress(@PathParam("clientid") @Parameter(description = "clientId") final long clientid,
|
||||
@Parameter(hidden = true) ClientAddressRequest clientAddressRequest) {
|
||||
|
||||
|
||||
+2
-7
@@ -34,17 +34,12 @@ public class ClientAddressRepositoryWrapper {
|
||||
|
||||
public ClientAddress findOneByClientIdAndAddressTypeAndIsActive(final long clientId, final CodeValue addressType,
|
||||
final boolean isActive) {
|
||||
final ClientAddress clientAddress = this.clientAddressRepository.findByClientIdAndAddressTypeAndIsActive(clientId, addressType,
|
||||
isActive);
|
||||
// if (clientAddress == null) { throw new
|
||||
// AddressNotFoundException(clientId, addressType); }
|
||||
return clientAddress;
|
||||
return this.clientAddressRepository.findByClientIdAndAddressTypeAndIsActive(clientId, addressType, isActive);
|
||||
}
|
||||
|
||||
public ClientAddress findOneByClientIdAndAddressId(final long clientId, final long addressId) {
|
||||
final ClientAddress clientAddress = this.clientAddressRepository.findByClientIdAndAddressId(clientId, addressId);
|
||||
|
||||
return clientAddress;
|
||||
return this.clientAddressRepository.findByClientIdAndAddressId(clientId, addressId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-4
@@ -73,8 +73,7 @@ public final class ClientEnumerations {
|
||||
}
|
||||
|
||||
public static EnumOptionData legalForm(final LegalForm legalForm) {
|
||||
final EnumOptionData optionData = new EnumOptionData(legalForm.getValue().longValue(), legalForm.getCode(), legalForm.toString());
|
||||
return optionData;
|
||||
return new EnumOptionData(legalForm.getValue().longValue(), legalForm.getCode(), legalForm.toString());
|
||||
}
|
||||
|
||||
public static List<EnumOptionData> legalForm(final LegalForm[] legalForms) {
|
||||
@@ -90,9 +89,8 @@ public final class ClientEnumerations {
|
||||
}
|
||||
|
||||
public static EnumOptionData clientTransactionType(final ClientTransactionType clientTransactionType) {
|
||||
final EnumOptionData optionData = new EnumOptionData(clientTransactionType.getValue().longValue(), clientTransactionType.getCode(),
|
||||
return new EnumOptionData(clientTransactionType.getValue().longValue(), clientTransactionType.getCode(),
|
||||
clientTransactionType.toString());
|
||||
return optionData;
|
||||
}
|
||||
|
||||
public static List<EnumOptionData> clientTransactionType(final ClientTransactionType[] clientTransactionTypes) {
|
||||
|
||||
+5
-11
@@ -20,6 +20,7 @@ package org.apache.fineract.portfolio.client.domain;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
|
||||
public enum ClientTransactionType {
|
||||
|
||||
@@ -43,7 +44,9 @@ public enum ClientTransactionType {
|
||||
}
|
||||
|
||||
private static final Map<Integer, ClientTransactionType> intToEnumMap = new HashMap<>();
|
||||
@Getter
|
||||
private static int minValue;
|
||||
@Getter
|
||||
private static int maxValue;
|
||||
|
||||
static {
|
||||
@@ -64,21 +67,12 @@ public enum ClientTransactionType {
|
||||
}
|
||||
|
||||
public static ClientTransactionType fromInt(final int i) {
|
||||
final ClientTransactionType type = intToEnumMap.get(Integer.valueOf(i));
|
||||
return type;
|
||||
}
|
||||
|
||||
public static int getMinValue() {
|
||||
return minValue;
|
||||
}
|
||||
|
||||
public static int getMaxValue() {
|
||||
return maxValue;
|
||||
return intToEnumMap.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name().toString();
|
||||
return name();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ package org.apache.fineract.portfolio.client.service.search;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.core.service.PagedRequest;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
|
||||
import org.apache.fineract.portfolio.client.domain.ClientRepository;
|
||||
@@ -58,7 +57,7 @@ public class ClientSearchService {
|
||||
|
||||
Optional<ClientTextSearch> request = searchRequest.getRequest();
|
||||
String requestSearchText = request.map(ClientTextSearch::getText).orElse(null);
|
||||
String searchText = StringUtils.defaultString(requestSearchText, "");
|
||||
String searchText = Objects.toString(requestSearchText, "");
|
||||
|
||||
Pageable pageable = searchRequest.toPageable();
|
||||
|
||||
|
||||
+4
-4
@@ -28,17 +28,17 @@ public class CollateralCannotBeCreatedException extends AbstractPlatformDomainRu
|
||||
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE;
|
||||
|
||||
public String errorMessage() {
|
||||
if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||
if (name().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||
return "This collateral cannot be created as the loan it is associated with is not in submitted and pending approval stage";
|
||||
}
|
||||
return name().toString();
|
||||
return name();
|
||||
}
|
||||
|
||||
public String errorCode() {
|
||||
if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||
if (name().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||
return "error.msg.loan.collateral.associated.loan.not.in.submitted.and.pending.approval.stage";
|
||||
}
|
||||
return name().toString();
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-7
@@ -24,7 +24,6 @@ import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.DELETE;
|
||||
@@ -109,8 +108,7 @@ public class ClientCollateralManagementApiResource {
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Add New Collateral For a Client", description = "Add New Collateral For a Client")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientCollateralRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.PostClientCollateralResponse.class))) })
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.PostClientCollateralResponse.class)))
|
||||
public CommandProcessingResult addCollateral(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId,
|
||||
@Parameter(hidden = true) ClientCollateralRequest clientCollateralRequest) {
|
||||
final CommandWrapper commandWrapper = new CommandWrapperBuilder().addClientCollateralProduct(clientId)
|
||||
@@ -125,8 +123,7 @@ public class ClientCollateralManagementApiResource {
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Update New Collateral of a Client", description = "Update New Collateral of a Client")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = UpdateClientCollateralRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.PutClientCollateralResponse.class))) })
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.PutClientCollateralResponse.class)))
|
||||
public CommandProcessingResult updateCollateral(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId,
|
||||
@PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId,
|
||||
@Parameter(hidden = true) UpdateClientCollateralRequest updateClientCollateralRequest) {
|
||||
@@ -142,8 +139,8 @@ public class ClientCollateralManagementApiResource {
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Delete Client Collateral", description = "Delete Client Collateral")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.DeleteClientCollateralResponse.class))) })
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralManagementApiResourceSwagger.DeleteClientCollateralResponse.class)))
|
||||
public CommandProcessingResult deleteCollateral(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId,
|
||||
@PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId) {
|
||||
final CommandWrapper commandWrapper = new CommandWrapperBuilder().deleteClientCollateralProduct(collateralId, clientId).build();
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class ClientCollateralCannotBeDeletedException extends AbstractPlatformDo
|
||||
if (name().equalsIgnoreCase("CLIENT_COLLATERAL_IS_ALREADY_ATTACHED")) {
|
||||
return "error.msg.client.collateral.is.already.associated.with.loan.collateral";
|
||||
}
|
||||
return name().toString();
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-13
@@ -47,6 +47,8 @@ public class ClientCollateralManagementWritePlatformServiceImpl implements Clien
|
||||
private final ClientCollateralManagementRepositoryWrapper clientCollateralManagementRepositoryWrapper;
|
||||
private final CollateralManagementRepositoryWrapper collateralManagementRepositoryWrapper;
|
||||
private final ClientRepositoryWrapper clientRepositoryWrapper;
|
||||
public static final String COLLATERAL_ID = "collateralId";
|
||||
public static final String QUANTITY = "quantity";
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
@@ -54,8 +56,8 @@ public class ClientCollateralManagementWritePlatformServiceImpl implements Clien
|
||||
|
||||
validateForCreation(command);
|
||||
|
||||
Long collateralId = command.longValueOfParameterNamed("collateralId");
|
||||
BigDecimal quantity = command.bigDecimalValueOfParameterNamed("quantity");
|
||||
Long collateralId = command.longValueOfParameterNamed(COLLATERAL_ID);
|
||||
BigDecimal quantity = command.bigDecimalValueOfParameterNamed(QUANTITY);
|
||||
|
||||
final Client client = this.clientRepositoryWrapper.findOneWithNotFoundDetection(command.getClientId(), false);
|
||||
|
||||
@@ -73,17 +75,17 @@ public class ClientCollateralManagementWritePlatformServiceImpl implements Clien
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("client-collateral");
|
||||
|
||||
if (!command.parameterExists("collateralId")) {
|
||||
if (!command.parameterExists(COLLATERAL_ID)) {
|
||||
errorCode += "collateralId.not.exists";
|
||||
baseDataValidator.reset().parameter("collateralId").failWithCode(errorCode);
|
||||
baseDataValidator.reset().parameter(COLLATERAL_ID).failWithCode(errorCode);
|
||||
}
|
||||
|
||||
if (!command.parameterExists("quantity")) {
|
||||
if (!command.parameterExists(QUANTITY)) {
|
||||
errorCode += ".quantity.not.exists";
|
||||
baseDataValidator.reset().parameter("quantity").failWithCode(errorCode);
|
||||
baseDataValidator.reset().parameter(QUANTITY).failWithCode(errorCode);
|
||||
} else {
|
||||
BigDecimal quantity = command.bigDecimalValueOfParameterNamed("quantity");
|
||||
baseDataValidator.reset().parameter("quantity").value(quantity).notNull().positiveAmount();
|
||||
BigDecimal quantity = command.bigDecimalValueOfParameterNamed(QUANTITY);
|
||||
baseDataValidator.reset().parameter(QUANTITY).value(quantity).notNull().positiveAmount();
|
||||
}
|
||||
|
||||
if (!dataValidationErrors.isEmpty()) {
|
||||
@@ -109,12 +111,12 @@ public class ClientCollateralManagementWritePlatformServiceImpl implements Clien
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("client-collateral");
|
||||
BigDecimal quantity = null;
|
||||
|
||||
if (!command.parameterExists("quantity")) {
|
||||
if (!command.parameterExists(QUANTITY)) {
|
||||
errorCode += ".quantity.not.exists";
|
||||
baseDataValidator.reset().parameter("quantity").failWithCode(errorCode);
|
||||
baseDataValidator.reset().parameter(QUANTITY).failWithCode(errorCode);
|
||||
} else {
|
||||
quantity = command.bigDecimalValueOfParameterNamed("quantity");
|
||||
baseDataValidator.reset().parameter("quantity").value(quantity).notNull().positiveAmount();
|
||||
quantity = command.bigDecimalValueOfParameterNamed(QUANTITY);
|
||||
baseDataValidator.reset().parameter(QUANTITY).value(quantity).notNull().positiveAmount();
|
||||
}
|
||||
|
||||
final ClientCollateralManagement clientCollateralManagement = this.clientCollateralManagementRepositoryWrapper
|
||||
@@ -132,7 +134,7 @@ public class ClientCollateralManagementWritePlatformServiceImpl implements Clien
|
||||
}
|
||||
|
||||
if (totalQuantity.compareTo(quantity) >= 0) {
|
||||
baseDataValidator.reset().parameter("quantity").value(quantity).notLessThanMin(totalQuantity);
|
||||
baseDataValidator.reset().parameter(QUANTITY).value(quantity).notLessThanMin(totalQuantity);
|
||||
}
|
||||
|
||||
if (!dataValidationErrors.isEmpty()) {
|
||||
|
||||
+102
-41
@@ -25,7 +25,6 @@ import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.DELETE;
|
||||
@@ -120,10 +119,20 @@ public class CentersApiResource {
|
||||
@Path("template")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Retrieve a Center Template", description = "Retrieves a Center Template\n\n" + "Example Requests:\n\n" + "\n\n"
|
||||
+ "centers/template\n\n" + "\n\n" + "centers/template?officeId=2")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersTemplateResponse.class))) })
|
||||
@Operation(summary = "Retrieve a Center Template", description = """
|
||||
Retrieves a Center Template
|
||||
|
||||
Example Requests:
|
||||
|
||||
|
||||
|
||||
centers/template
|
||||
|
||||
|
||||
|
||||
centers/template?officeId=2""")
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersTemplateResponse.class)))
|
||||
public String retrieveTemplate(@Context final UriInfo uriInfo,
|
||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
||||
@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId,
|
||||
@@ -150,11 +159,28 @@ public class CentersApiResource {
|
||||
@GET
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "List Centers", description = "The default implementation supports pagination and sorting with the default pagination size set to 200 records. The parameter limit with description -1 will return all entries.\n\n"
|
||||
+ "Example Requests:\n\n" + "\n\n" + "centers\n\n" + "\n\n" + "centers?fields=name,officeName,joinedDate\n\n" + "\n\n"
|
||||
+ "centers?offset=10&limit=50\n\n" + "\n\n" + "centers?orderBy=name&sortOrder=DESC")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersResponse.class))) })
|
||||
@Operation(summary = "List Centers", description = """
|
||||
The default implementation supports pagination and sorting with the default pagination size set to 200 records. The parameter limit with description -1 will return all entries.
|
||||
|
||||
Example Requests:
|
||||
|
||||
|
||||
|
||||
centers
|
||||
|
||||
|
||||
|
||||
centers?fields=name,officeName,joinedDate
|
||||
|
||||
|
||||
|
||||
centers?offset=10&limit=50
|
||||
|
||||
|
||||
|
||||
centers?orderBy=name&sortOrder=DESC""")
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersResponse.class)))
|
||||
public String retrieveAll(@Context final UriInfo uriInfo,
|
||||
@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId,
|
||||
@QueryParam("staffId") @Parameter(description = "staffId") final Long staffId,
|
||||
@@ -200,10 +226,20 @@ public class CentersApiResource {
|
||||
@Path("{centerId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Retrieve a Center", description = "Retrieves a Center\n\n" + "Example Requests:\n\n" + "\n\n" + "centers/1\n\n"
|
||||
+ "\n\n" + "centers/1?associations=groupMembers")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersCenterIdResponse.class))) })
|
||||
@Operation(summary = "Retrieve a Center", description = """
|
||||
Retrieves a Center
|
||||
|
||||
Example Requests:
|
||||
|
||||
|
||||
|
||||
centers/1
|
||||
|
||||
|
||||
|
||||
centers/1?associations=groupMembers""")
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersCenterIdResponse.class)))
|
||||
public String retrieveOne(@Context final UriInfo uriInfo,
|
||||
@PathParam("centerId") @Parameter(description = "centerId") final Long centerId,
|
||||
@DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) {
|
||||
@@ -254,12 +290,15 @@ public class CentersApiResource {
|
||||
@POST
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Create a Center", description = "Creates a Center\n\n"
|
||||
+ "Mandatory Fields: name, officeId, active, activationDate (if active=true)\n\n"
|
||||
+ "Optional Fields: externalId, staffId, groupMembers")
|
||||
@Operation(summary = "Create a Center", description = """
|
||||
Creates a Center
|
||||
|
||||
Mandatory Fields: name, officeId, active, activationDate (if active=true)
|
||||
|
||||
Optional Fields: externalId, staffId, groupMembers""")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersResponse.class))) })
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersResponse.class)))
|
||||
public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||
|
||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||
@@ -277,8 +316,8 @@ public class CentersApiResource {
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Update a Center", description = "Updates a Center")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PutCentersCenterIdRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PutCentersCenterIdResponse.class))) })
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PutCentersCenterIdResponse.class)))
|
||||
public String update(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId,
|
||||
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||
|
||||
@@ -295,8 +334,7 @@ public class CentersApiResource {
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Delete a Center", description = "A Center can be deleted if it is in pending state and has no association - groups, loans or savings")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.DeleteCentersCenterIdResponse.class))) })
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.DeleteCentersCenterIdResponse.class)))
|
||||
public String delete(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId) {
|
||||
|
||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||
@@ -310,20 +348,35 @@ public class CentersApiResource {
|
||||
@Path("{centerId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Activate a Center | Generate Collection Sheet | Save Collection Sheet | Close a Center | Associate Groups | Disassociate Groups", description = "Activate a Center:\n\n"
|
||||
+ "Centers can be created in a Pending state. This API exists to enable center activation. If the center happens to be already active, this API will result in an error.\n\n"
|
||||
+ "Close a Center:\n\n"
|
||||
+ "Centers can be closed if they don't have any non-closed groups or saving accounts. If the Center has any active groups or savings accounts, this API will result in an error.\n\n"
|
||||
+ "Associate Groups:\n\n"
|
||||
+ "This API allows associating existing groups to a center. The groups are listed from the office to which the center is associated. If group(s) is already associated with a center, this API will result in an error.\n\n"
|
||||
+ "Disassociate Groups:\n\n" + "This API allows to disassociate groups from a center.\n\n" + "Generate Collection Sheet:\n\n"
|
||||
+ "This Api retrieves repayment details of all jlg loans under a center as on a specified meeting date.\n\n"
|
||||
+ "Save Collection Sheet:\n\n"
|
||||
+ "This Api allows the loan officer to perform bulk repayments of JLG loans for a center on a given meeting date.\n\n"
|
||||
+ "Showing Request/Response for Close a Center")
|
||||
@Operation(summary = "Activate a Center | Generate Collection Sheet | Save Collection Sheet | Close a Center | Associate Groups | Disassociate Groups", description = """
|
||||
Activate a Center:
|
||||
|
||||
Centers can be created in a Pending state. This API exists to enable center activation. If the center happens to be already active, this API will result in an error.
|
||||
|
||||
Close a Center:
|
||||
|
||||
Centers can be closed if they don't have any non-closed groups or saving accounts. If the Center has any active groups or savings accounts, this API will result in an error.
|
||||
|
||||
Associate Groups:
|
||||
|
||||
This API allows associating existing groups to a center. The groups are listed from the office to which the center is associated. If group(s) is already associated with a center, this API will result in an error.
|
||||
|
||||
Disassociate Groups:
|
||||
|
||||
This API allows to disassociate groups from a center.
|
||||
|
||||
Generate Collection Sheet:
|
||||
|
||||
This Api retrieves repayment details of all jlg loans under a center as on a specified meeting date.
|
||||
|
||||
Save Collection Sheet:
|
||||
|
||||
This Api allows the loan officer to perform bulk repayments of JLG loans for a center on a given meeting date.
|
||||
|
||||
Showing Request/Response for Close a Center""")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersCenterIdRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersCenterIdResponse.class))) })
|
||||
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersCenterIdResponse.class)))
|
||||
public String activate(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId,
|
||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
||||
@Parameter(hidden = true) final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) {
|
||||
@@ -373,11 +426,19 @@ public class CentersApiResource {
|
||||
@Path("{centerId}/accounts")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Retrieve Center accounts overview", description = "An example of how a savings summary for a Center can be provided. This is requested in a specific use case of the reference application.\n\n"
|
||||
+ "It is quite reasonable to add resources like this to simplify User Interface development.\n\n" + "\n\n"
|
||||
+ "Example Requests:\n\n" + "\n\n" + "centers/9/accounts")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersCenterIdAccountsResponse.class))) })
|
||||
@Operation(summary = "Retrieve Center accounts overview", description = """
|
||||
An example of how a savings summary for a Center can be provided. This is requested in a specific use case of the reference application.
|
||||
|
||||
It is quite reasonable to add resources like this to simplify User Interface development.
|
||||
|
||||
|
||||
|
||||
Example Requests:
|
||||
|
||||
|
||||
|
||||
centers/9/accounts""")
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersCenterIdAccountsResponse.class)))
|
||||
public String retrieveGroupAccount(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId,
|
||||
@Context final UriInfo uriInfo) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user