FINERACT-2346: Minor SonarQube fixes
This commit is contained in:
+1
-2
@@ -51,7 +51,7 @@ public class AcmeBusinessStepDefinitions implements En {
|
|||||||
});
|
});
|
||||||
|
|
||||||
When("/^The user retrieves the step service with step class (.*) and name (.*)$/", (String stepClass, String stepName) -> {
|
When("/^The user retrieves the step service with step class (.*) and name (.*)$/", (String stepClass, String stepName) -> {
|
||||||
contextRunner.run((ctx) -> {
|
contextRunner.run(ctx -> {
|
||||||
this.businessStepService = ctx.getBean(COBBusinessStepService.class);
|
this.businessStepService = ctx.getBean(COBBusinessStepService.class);
|
||||||
|
|
||||||
this.businessStep = ctx.getBean((Class<COBBusinessStep<Loan>>) Class.forName(stepClass));
|
this.businessStep = ctx.getBean((Class<COBBusinessStep<Loan>>) Class.forName(stepClass));
|
||||||
@@ -64,7 +64,6 @@ public class AcmeBusinessStepDefinitions implements En {
|
|||||||
Then("/^The step service should have a result$/", () -> {
|
Then("/^The step service should have a result$/", () -> {
|
||||||
assertThat(this.businessStep).isNotNull();
|
assertThat(this.businessStep).isNotNull();
|
||||||
assertThat(this.result).isNotNull();
|
assertThat(this.result).isNotNull();
|
||||||
// log.warn(">>>>>>>>>>>>>>>>>> RESULT: {}", this.result);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-15
@@ -57,10 +57,17 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
@Path("/v1/glclosures")
|
@Path("/v1/glclosures")
|
||||||
@Component
|
@Component
|
||||||
@Tag(name = "Accounting Closure", description = "An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date\n"
|
@Tag(name = "Accounting Closure", description = """
|
||||||
+ "\n" + "Field Descriptions\n" + "closingDate\n" + "The date for which the accounting closure is defined\n" + "officeId\n"
|
An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date
|
||||||
+ "The identifer of the branch for which accounting has been closed\n" + "comments\n"
|
|
||||||
+ "Description associated with an Accounting closure")
|
Field Descriptions
|
||||||
|
closingDate
|
||||||
|
The date for which the accounting closure is defined
|
||||||
|
officeId
|
||||||
|
The identifer of the branch for which accounting has been closed
|
||||||
|
comments
|
||||||
|
Description associated with an Accounting closure
|
||||||
|
""")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GLClosuresApiResource {
|
public class GLClosuresApiResource {
|
||||||
|
|
||||||
@@ -76,9 +83,11 @@ public class GLClosuresApiResource {
|
|||||||
@GET
|
@GET
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Operation(summary = "List Accounting closures", description = "Example Requests:\n" + "\n" + "glclosures")
|
@Operation(summary = "List Accounting closures", description = """
|
||||||
@ApiResponses({
|
Example Requests:
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class)))) })
|
|
||||||
|
glclosures""")
|
||||||
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class))))
|
||||||
public List<GLClosureData> retrieveAllClosures(@QueryParam("officeId") @Parameter(name = "officeId") final Long officeId) {
|
public List<GLClosureData> retrieveAllClosures(@QueryParam("officeId") @Parameter(name = "officeId") final Long officeId) {
|
||||||
|
|
||||||
context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSION);
|
context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSION);
|
||||||
@@ -89,10 +98,14 @@ public class GLClosuresApiResource {
|
|||||||
@Path("{glClosureId}")
|
@Path("{glClosureId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Operation(summary = "Retrieve an Accounting Closure", description = "Example Requests:\n" + "\n" + "glclosures/1\n" + "\n" + "\n"
|
@Operation(summary = "Retrieve an Accounting Closure", description = """
|
||||||
+ "/glclosures/1?fields=officeName,closingDate")
|
Example Requests:
|
||||||
@ApiResponses({
|
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class))) })
|
glclosures/1
|
||||||
|
|
||||||
|
|
||||||
|
/glclosures/1?fields=officeName,closingDate""")
|
||||||
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class)))
|
||||||
public GLClosureData retreiveClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
|
public GLClosureData retreiveClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSION);
|
context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSION);
|
||||||
@@ -127,8 +140,7 @@ public class GLClosuresApiResource {
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Operation(summary = "Update an Accounting closure", description = "Once an accounting closure is created, only the comments associated with it may be edited")
|
@Operation(summary = "Update an Accounting closure", description = "Once an accounting closure is created, only the comments associated with it may be edited")
|
||||||
@RequestBody(content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresRequest.class)))
|
@RequestBody(content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresRequest.class)))
|
||||||
@ApiResponses({
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class)))
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class))) })
|
|
||||||
public CommandProcessingResult updateGLClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
|
public CommandProcessingResult updateGLClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
|
||||||
@Parameter(hidden = true) GLClosureRequest glClosureRequest) {
|
@Parameter(hidden = true) GLClosureRequest glClosureRequest) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLClosure(glClosureId)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLClosure(glClosureId)
|
||||||
@@ -141,8 +153,7 @@ public class GLClosuresApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Operation(summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.")
|
@Operation(summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.")
|
||||||
@ApiResponses({
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class)))
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class))) })
|
|
||||||
public CommandProcessingResult deleteGLClosure(
|
public CommandProcessingResult deleteGLClosure(
|
||||||
@PathParam("glClosureId") @Parameter(description = "glclosureId") final Long glClosureId) {
|
@PathParam("glClosureId") @Parameter(description = "glclosureId") final Long glClosureId) {
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLClosure(glClosureId).build();
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLClosure(glClosureId).build();
|
||||||
|
|||||||
+13
-5
@@ -97,8 +97,11 @@ public class TellerApiResource {
|
|||||||
@POST
|
@POST
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Operation(summary = "Create teller", description = "Mandatory Fields\n" + "Teller name, OfficeId, Description, Start Date, Status\n"
|
@Operation(summary = "Create teller", description = """
|
||||||
+ "Optional Fields\n" + "End Date")
|
Mandatory Fields
|
||||||
|
Teller name, OfficeId, Description, Start Date, Status
|
||||||
|
Optional Fields
|
||||||
|
End Date""")
|
||||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersRequest.class)))
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersRequest.class)))
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersResponse.class))) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersResponse.class))) })
|
||||||
@@ -185,9 +188,14 @@ public class TellerApiResource {
|
|||||||
@Path("{tellerId}/cashiers")
|
@Path("{tellerId}/cashiers")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Operation(summary = "Create Cashiers", description = "Mandatory Fields: \n"
|
@Operation(summary = "Create Cashiers", description = """
|
||||||
+ "Cashier/staff, Fromm Date, To Date, Full Day or From time and To time\n" + "\n\n\n" + "Optional Fields: \n"
|
Mandatory Fields:\s
|
||||||
+ "Description/Notes")
|
Cashier/staff, Fromm Date, To Date, Full Day or From time and To time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Optional Fields:\s
|
||||||
|
Description/Notes""")
|
||||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class)))
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class)))
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class))) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class))) })
|
||||||
|
|||||||
+55
-51
@@ -59,6 +59,13 @@ import org.apache.fineract.portfolio.tax.domain.TaxGroup;
|
|||||||
@Table(name = "m_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "name") })
|
@Table(name = "m_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "name") })
|
||||||
public class Charge extends AbstractPersistableCustom<Long> {
|
public class Charge extends AbstractPersistableCustom<Long> {
|
||||||
|
|
||||||
|
public static final String CHARGE_TIME_PARAM_NAME = "chargeTimeType";
|
||||||
|
public static final String CHARGE_CALCULATION_TYPE_PARAM_NAME = "chargeCalculationType";
|
||||||
|
public static final String FEE_ON_MONTH_DAY_PARAM_NAME = "feeOnMonthDay";
|
||||||
|
public static final String FEE_INTERVAL_PARAM_NAME = "feeInterval";
|
||||||
|
public static final String LOCALE_PARAM_NAME = "locale";
|
||||||
|
public static final String FEE_FREQUENCY_PARAM_NAME = "feeFrequency";
|
||||||
|
|
||||||
@Column(name = "name", length = 100)
|
@Column(name = "name", length = 100)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@@ -142,20 +149,20 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
final String currencyCode = command.stringValueOfParameterNamed("currencyCode");
|
final String currencyCode = command.stringValueOfParameterNamed("currencyCode");
|
||||||
|
|
||||||
final ChargeAppliesTo chargeAppliesTo = ChargeAppliesTo.fromInt(command.integerValueOfParameterNamed("chargeAppliesTo"));
|
final ChargeAppliesTo chargeAppliesTo = ChargeAppliesTo.fromInt(command.integerValueOfParameterNamed("chargeAppliesTo"));
|
||||||
final ChargeTimeType chargeTimeType = ChargeTimeType.fromInt(command.integerValueOfParameterNamed("chargeTimeType"));
|
final ChargeTimeType chargeTimeType = ChargeTimeType.fromInt(command.integerValueOfParameterNamed(CHARGE_TIME_PARAM_NAME));
|
||||||
final ChargeCalculationType chargeCalculationType = ChargeCalculationType
|
final ChargeCalculationType chargeCalculationType = ChargeCalculationType
|
||||||
.fromInt(command.integerValueOfParameterNamed("chargeCalculationType"));
|
.fromInt(command.integerValueOfParameterNamed(CHARGE_CALCULATION_TYPE_PARAM_NAME));
|
||||||
final Integer chargePaymentMode = command.integerValueOfParameterNamed("chargePaymentMode");
|
final Integer chargePaymentMode = command.integerValueOfParameterNamed("chargePaymentMode");
|
||||||
|
|
||||||
final ChargePaymentMode paymentMode = chargePaymentMode == null ? null : ChargePaymentMode.fromInt(chargePaymentMode);
|
final ChargePaymentMode paymentMode = chargePaymentMode == null ? null : ChargePaymentMode.fromInt(chargePaymentMode);
|
||||||
|
|
||||||
final boolean penalty = command.booleanPrimitiveValueOfParameterNamed("penalty");
|
final boolean penalty = command.booleanPrimitiveValueOfParameterNamed("penalty");
|
||||||
final boolean active = command.booleanPrimitiveValueOfParameterNamed("active");
|
final boolean active = command.booleanPrimitiveValueOfParameterNamed("active");
|
||||||
final MonthDay feeOnMonthDay = command.extractMonthDayNamed("feeOnMonthDay");
|
final MonthDay feeOnMonthDay = command.extractMonthDayNamed(FEE_ON_MONTH_DAY_PARAM_NAME);
|
||||||
final Integer feeInterval = command.integerValueOfParameterNamed("feeInterval");
|
final Integer feeInterval = command.integerValueOfParameterNamed(FEE_INTERVAL_PARAM_NAME);
|
||||||
final BigDecimal minCap = command.bigDecimalValueOfParameterNamed("minCap");
|
final BigDecimal minCap = command.bigDecimalValueOfParameterNamed("minCap");
|
||||||
final BigDecimal maxCap = command.bigDecimalValueOfParameterNamed("maxCap");
|
final BigDecimal maxCap = command.bigDecimalValueOfParameterNamed("maxCap");
|
||||||
final Integer feeFrequency = command.integerValueOfParameterNamed("feeFrequency");
|
final Integer feeFrequency = command.integerValueOfParameterNamed(FEE_FREQUENCY_PARAM_NAME);
|
||||||
|
|
||||||
boolean enableFreeWithdrawalCharge = false;
|
boolean enableFreeWithdrawalCharge = false;
|
||||||
enableFreeWithdrawalCharge = command.booleanPrimitiveValueOfParameterNamed("enableFreeWithdrawalCharge");
|
enableFreeWithdrawalCharge = command.booleanPrimitiveValueOfParameterNamed("enableFreeWithdrawalCharge");
|
||||||
@@ -213,20 +220,20 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
// TODO vishwas, this validation seems unnecessary as identical
|
// TODO vishwas, this validation seems unnecessary as identical
|
||||||
// validation is performed in the write service
|
// validation is performed in the write service
|
||||||
if (!isAllowedSavingsChargeTime()) {
|
if (!isAllowedSavingsChargeTime()) {
|
||||||
baseDataValidator.reset().parameter("chargeTimeType").value(this.chargeTimeType)
|
baseDataValidator.reset().parameter(CHARGE_TIME_PARAM_NAME).value(this.chargeTimeType)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.savings");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.savings");
|
||||||
}
|
}
|
||||||
// TODO vishwas, this validation seems unnecessary as identical
|
// TODO vishwas, this validation seems unnecessary as identical
|
||||||
// validation is performed in the writeservice
|
// validation is performed in the writeservice
|
||||||
if (!isAllowedSavingsChargeCalculationType()) {
|
if (!isAllowedSavingsChargeCalculationType()) {
|
||||||
baseDataValidator.reset().parameter("chargeCalculationType").value(this.chargeCalculation)
|
baseDataValidator.reset().parameter(CHARGE_CALCULATION_TYPE_PARAM_NAME).value(this.chargeCalculation)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.calculation.type.for.savings");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.calculation.type.for.savings");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(ChargeTimeType.fromInt(getChargeTimeType()).isWithdrawalFee()
|
if (!(ChargeTimeType.fromInt(getChargeTimeType()).isWithdrawalFee()
|
||||||
|| ChargeTimeType.fromInt(getChargeTimeType()).isSavingsNoActivityFee())
|
|| ChargeTimeType.fromInt(getChargeTimeType()).isSavingsNoActivityFee())
|
||||||
&& ChargeCalculationType.fromInt(getChargeCalculation()).isPercentageOfAmount()) {
|
&& ChargeCalculationType.fromInt(getChargeCalculation()).isPercentageOfAmount()) {
|
||||||
baseDataValidator.reset().parameter("chargeCalculationType").value(this.chargeCalculation)
|
baseDataValidator.reset().parameter(CHARGE_CALCULATION_TYPE_PARAM_NAME).value(this.chargeCalculation)
|
||||||
.failWithCodeNoParameterAddedToErrorCode(
|
.failWithCodeNoParameterAddedToErrorCode(
|
||||||
"savings.charge.calculation.type.percentage.allowed.only.for.withdrawal.or.NoActivity");
|
"savings.charge.calculation.type.percentage.allowed.only.for.withdrawal.or.NoActivity");
|
||||||
}
|
}
|
||||||
@@ -257,7 +264,7 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
// TODO vishwas, this validation seems unnecessary as identical
|
// TODO vishwas, this validation seems unnecessary as identical
|
||||||
// validation is performed in the write service
|
// validation is performed in the write service
|
||||||
if (!isAllowedLoanChargeTime()) {
|
if (!isAllowedLoanChargeTime()) {
|
||||||
baseDataValidator.reset().parameter("chargeTimeType").value(this.chargeTimeType)
|
baseDataValidator.reset().parameter(CHARGE_TIME_PARAM_NAME).value(this.chargeTimeType)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.loan");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.loan");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -414,39 +421,38 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
if (command.isChangeInBigDecimalParameterNamed(amountParamName, this.amount)) {
|
if (command.isChangeInBigDecimalParameterNamed(amountParamName, this.amount)) {
|
||||||
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(amountParamName, locale);
|
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(amountParamName, locale);
|
||||||
actualChanges.put(amountParamName, newValue);
|
actualChanges.put(amountParamName, newValue);
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
this.amount = newValue;
|
this.amount = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String chargeTimeParamName = "chargeTimeType";
|
if (command.isChangeInIntegerParameterNamed(CHARGE_TIME_PARAM_NAME, this.chargeTimeType)) {
|
||||||
if (command.isChangeInIntegerParameterNamed(chargeTimeParamName, this.chargeTimeType)) {
|
final Integer newValue = command.integerValueOfParameterNamed(CHARGE_TIME_PARAM_NAME);
|
||||||
final Integer newValue = command.integerValueOfParameterNamed(chargeTimeParamName);
|
actualChanges.put(CHARGE_TIME_PARAM_NAME, newValue);
|
||||||
actualChanges.put(chargeTimeParamName, newValue);
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
|
||||||
this.chargeTimeType = ChargeTimeType.fromInt(newValue).getValue();
|
this.chargeTimeType = ChargeTimeType.fromInt(newValue).getValue();
|
||||||
|
|
||||||
if (isSavingsCharge()) {
|
if (isSavingsCharge()) {
|
||||||
if (!isAllowedSavingsChargeTime()) {
|
if (!isAllowedSavingsChargeTime()) {
|
||||||
baseDataValidator.reset().parameter("chargeTimeType").value(this.chargeTimeType)
|
baseDataValidator.reset().parameter(CHARGE_TIME_PARAM_NAME).value(this.chargeTimeType)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.savings");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.savings");
|
||||||
}
|
}
|
||||||
// if charge time is changed to monthly then validate for
|
// if charge time is changed to monthly then validate for
|
||||||
// feeOnMonthDay and feeInterval
|
// feeOnMonthDay and feeInterval
|
||||||
if (isMonthlyFee()) {
|
if (isMonthlyFee()) {
|
||||||
final MonthDay monthDay = command.extractMonthDayNamed("feeOnMonthDay");
|
final MonthDay monthDay = command.extractMonthDayNamed(FEE_ON_MONTH_DAY_PARAM_NAME);
|
||||||
baseDataValidator.reset().parameter("feeOnMonthDay").value(monthDay).notNull();
|
baseDataValidator.reset().parameter(FEE_ON_MONTH_DAY_PARAM_NAME).value(monthDay).notNull();
|
||||||
|
|
||||||
final Integer feeInterval = command.integerValueOfParameterNamed("feeInterval");
|
final Integer feeInterval = command.integerValueOfParameterNamed(FEE_INTERVAL_PARAM_NAME);
|
||||||
baseDataValidator.reset().parameter("feeInterval").value(feeInterval).notNull().inMinMaxRange(1, 12);
|
baseDataValidator.reset().parameter(FEE_INTERVAL_PARAM_NAME).value(feeInterval).notNull().inMinMaxRange(1, 12);
|
||||||
}
|
}
|
||||||
} else if (isLoanCharge()) {
|
} else if (isLoanCharge()) {
|
||||||
if (!isAllowedLoanChargeTime()) {
|
if (!isAllowedLoanChargeTime()) {
|
||||||
baseDataValidator.reset().parameter("chargeTimeType").value(this.chargeTimeType)
|
baseDataValidator.reset().parameter(CHARGE_TIME_PARAM_NAME).value(this.chargeTimeType)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.loan");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.loan");
|
||||||
}
|
}
|
||||||
} else if (isClientCharge()) {
|
} else if (isClientCharge()) {
|
||||||
if (!isAllowedLoanChargeTime()) {
|
if (!isAllowedLoanChargeTime()) {
|
||||||
baseDataValidator.reset().parameter("chargeTimeType").value(this.chargeTimeType)
|
baseDataValidator.reset().parameter(CHARGE_TIME_PARAM_NAME).value(this.chargeTimeType)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.client");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.client");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -507,29 +513,28 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
throw new ChargeParameterUpdateNotSupportedException("charge.applies.to", errorMessage);
|
throw new ChargeParameterUpdateNotSupportedException("charge.applies.to", errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
final String chargeCalculationParamName = "chargeCalculationType";
|
if (command.isChangeInIntegerParameterNamed(CHARGE_CALCULATION_TYPE_PARAM_NAME, this.chargeCalculation)) {
|
||||||
if (command.isChangeInIntegerParameterNamed(chargeCalculationParamName, this.chargeCalculation)) {
|
final Integer newValue = command.integerValueOfParameterNamed(CHARGE_CALCULATION_TYPE_PARAM_NAME);
|
||||||
final Integer newValue = command.integerValueOfParameterNamed(chargeCalculationParamName);
|
actualChanges.put(CHARGE_CALCULATION_TYPE_PARAM_NAME, newValue);
|
||||||
actualChanges.put(chargeCalculationParamName, newValue);
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
|
||||||
this.chargeCalculation = ChargeCalculationType.fromInt(newValue).getValue();
|
this.chargeCalculation = ChargeCalculationType.fromInt(newValue).getValue();
|
||||||
|
|
||||||
if (isSavingsCharge()) {
|
if (isSavingsCharge()) {
|
||||||
if (!isAllowedSavingsChargeCalculationType()) {
|
if (!isAllowedSavingsChargeCalculationType()) {
|
||||||
baseDataValidator.reset().parameter("chargeCalculationType").value(this.chargeCalculation)
|
baseDataValidator.reset().parameter(CHARGE_CALCULATION_TYPE_PARAM_NAME).value(this.chargeCalculation)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.calculation.type.for.savings");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.calculation.type.for.savings");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(ChargeTimeType.fromInt(getChargeTimeType()).isWithdrawalFee()
|
if (!(ChargeTimeType.fromInt(getChargeTimeType()).isWithdrawalFee()
|
||||||
|| ChargeTimeType.fromInt(getChargeTimeType()).isSavingsNoActivityFee())
|
|| ChargeTimeType.fromInt(getChargeTimeType()).isSavingsNoActivityFee())
|
||||||
&& ChargeCalculationType.fromInt(getChargeCalculation()).isPercentageOfAmount()) {
|
&& ChargeCalculationType.fromInt(getChargeCalculation()).isPercentageOfAmount()) {
|
||||||
baseDataValidator.reset().parameter("chargeCalculationType").value(this.chargeCalculation)
|
baseDataValidator.reset().parameter(CHARGE_CALCULATION_TYPE_PARAM_NAME).value(this.chargeCalculation)
|
||||||
.failWithCodeNoParameterAddedToErrorCode(
|
.failWithCodeNoParameterAddedToErrorCode(
|
||||||
"charge.calculation.type.percentage.allowed.only.for.withdrawal.or.noactivity");
|
"charge.calculation.type.percentage.allowed.only.for.withdrawal.or.noactivity");
|
||||||
}
|
}
|
||||||
} else if (isClientCharge()) {
|
} else if (isClientCharge()) {
|
||||||
if (!isAllowedClientChargeCalculationType()) {
|
if (!isAllowedClientChargeCalculationType()) {
|
||||||
baseDataValidator.reset().parameter("chargeCalculationType").value(this.chargeCalculation)
|
baseDataValidator.reset().parameter(CHARGE_CALCULATION_TYPE_PARAM_NAME).value(this.chargeCalculation)
|
||||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.calculation.type.for.client");
|
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.calculation.type.for.client");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -541,47 +546,45 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
if (command.isChangeInIntegerParameterNamed(paymentModeParamName, this.chargePaymentMode)) {
|
if (command.isChangeInIntegerParameterNamed(paymentModeParamName, this.chargePaymentMode)) {
|
||||||
final Integer newValue = command.integerValueOfParameterNamed(paymentModeParamName);
|
final Integer newValue = command.integerValueOfParameterNamed(paymentModeParamName);
|
||||||
actualChanges.put(paymentModeParamName, newValue);
|
actualChanges.put(paymentModeParamName, newValue);
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
this.chargePaymentMode = ChargePaymentMode.fromInt(newValue).getValue();
|
this.chargePaymentMode = ChargePaymentMode.fromInt(newValue).getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command.hasParameter("feeOnMonthDay")) {
|
if (command.hasParameter(FEE_ON_MONTH_DAY_PARAM_NAME)) {
|
||||||
final MonthDay monthDay = command.extractMonthDayNamed("feeOnMonthDay");
|
final MonthDay monthDay = command.extractMonthDayNamed(FEE_ON_MONTH_DAY_PARAM_NAME);
|
||||||
final String actualValueEntered = command.stringValueOfParameterNamed("feeOnMonthDay");
|
final String actualValueEntered = command.stringValueOfParameterNamed(FEE_ON_MONTH_DAY_PARAM_NAME);
|
||||||
final Integer dayOfMonthValue = monthDay.getDayOfMonth();
|
final Integer dayOfMonthValue = monthDay.getDayOfMonth();
|
||||||
if (!this.feeOnDay.equals(dayOfMonthValue)) {
|
if (!this.feeOnDay.equals(dayOfMonthValue)) {
|
||||||
actualChanges.put("feeOnMonthDay", actualValueEntered);
|
actualChanges.put(FEE_ON_MONTH_DAY_PARAM_NAME, actualValueEntered);
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
this.feeOnDay = dayOfMonthValue;
|
this.feeOnDay = dayOfMonthValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Integer monthOfYear = monthDay.getMonthValue();
|
final Integer monthOfYear = monthDay.getMonthValue();
|
||||||
if (!this.feeOnMonth.equals(monthOfYear)) {
|
if (!this.feeOnMonth.equals(monthOfYear)) {
|
||||||
actualChanges.put("feeOnMonthDay", actualValueEntered);
|
actualChanges.put(FEE_ON_MONTH_DAY_PARAM_NAME, actualValueEntered);
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
this.feeOnMonth = monthOfYear;
|
this.feeOnMonth = monthOfYear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String feeInterval = "feeInterval";
|
if (command.isChangeInIntegerParameterNamed(FEE_INTERVAL_PARAM_NAME, this.feeInterval)) {
|
||||||
if (command.isChangeInIntegerParameterNamed(feeInterval, this.feeInterval)) {
|
final Integer newValue = command.integerValueOfParameterNamed(FEE_INTERVAL_PARAM_NAME);
|
||||||
final Integer newValue = command.integerValueOfParameterNamed(feeInterval);
|
actualChanges.put(FEE_INTERVAL_PARAM_NAME, newValue);
|
||||||
actualChanges.put(feeInterval, newValue);
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
|
||||||
this.feeInterval = newValue;
|
this.feeInterval = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String feeFrequency = "feeFrequency";
|
if (command.isChangeInIntegerParameterNamed(FEE_FREQUENCY_PARAM_NAME, this.feeFrequency)) {
|
||||||
if (command.isChangeInIntegerParameterNamed(feeFrequency, this.feeFrequency)) {
|
final Integer newValue = command.integerValueOfParameterNamed(FEE_FREQUENCY_PARAM_NAME);
|
||||||
final Integer newValue = command.integerValueOfParameterNamed(feeFrequency);
|
actualChanges.put(FEE_FREQUENCY_PARAM_NAME, newValue);
|
||||||
actualChanges.put(feeFrequency, newValue);
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
|
||||||
this.feeFrequency = newValue;
|
this.feeFrequency = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.feeFrequency != null) {
|
if (this.feeFrequency != null) {
|
||||||
baseDataValidator.reset().parameter("feeInterval").value(this.feeInterval).notNull();
|
baseDataValidator.reset().parameter(FEE_INTERVAL_PARAM_NAME).value(this.feeInterval).notNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
final String penaltyParamName = "penalty";
|
final String penaltyParamName = "penalty";
|
||||||
@@ -603,14 +606,14 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
if (command.isChangeInBigDecimalParameterNamed(minCapParamName, this.minCap)) {
|
if (command.isChangeInBigDecimalParameterNamed(minCapParamName, this.minCap)) {
|
||||||
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(minCapParamName);
|
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(minCapParamName);
|
||||||
actualChanges.put(minCapParamName, newValue);
|
actualChanges.put(minCapParamName, newValue);
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
this.minCap = newValue;
|
this.minCap = newValue;
|
||||||
}
|
}
|
||||||
final String maxCapParamName = "maxCap";
|
final String maxCapParamName = "maxCap";
|
||||||
if (command.isChangeInBigDecimalParameterNamed(maxCapParamName, this.maxCap)) {
|
if (command.isChangeInBigDecimalParameterNamed(maxCapParamName, this.maxCap)) {
|
||||||
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(maxCapParamName);
|
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(maxCapParamName);
|
||||||
actualChanges.put(maxCapParamName, newValue);
|
actualChanges.put(maxCapParamName, newValue);
|
||||||
actualChanges.put("locale", locale.getLanguage());
|
actualChanges.put(LOCALE_PARAM_NAME, locale.getLanguage());
|
||||||
this.maxCap = newValue;
|
this.maxCap = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -784,4 +787,5 @@ public class Charge extends AbstractPersistableCustom<Long> {
|
|||||||
return Objects.hash(name, amount, currencyCode, chargeAppliesTo, chargeTimeType, chargeCalculation, chargePaymentMode, feeOnDay,
|
return Objects.hash(name, amount, currencyCode, chargeAppliesTo, chargeTimeType, chargeCalculation, chargePaymentMode, feeOnDay,
|
||||||
feeInterval, feeOnMonth, penalty, active, deleted, minCap, maxCap, feeFrequency, account, taxGroup);
|
feeInterval, feeOnMonth, penalty, active, deleted, minCap, maxCap, feeFrequency, account, taxGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -30,25 +30,25 @@ public class LoanChargeCannotBeDeletedException extends AbstractPlatformDomainRu
|
|||||||
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE; //
|
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE; //
|
||||||
|
|
||||||
public String errorMessage() {
|
public String errorMessage() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "This loan charge has been partially/completely paid";
|
return "This loan charge has been partially/completely paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "This loan charge has already been waived";
|
return "This loan charge has already been waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
} else if (name().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||||
return "This charge cannot be deleted as the loan it is associated with is not in submitted and pending approval stage";
|
return "This charge cannot be deleted as the loan it is associated with is not in submitted and pending approval stage";
|
||||||
}
|
}
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String errorCode() {
|
public String errorCode() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "error.msg.loan.charge.already.paid";
|
return "error.msg.loan.charge.already.paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "error.msg.loan.charge.already.waived";
|
return "error.msg.loan.charge.already.waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
} else if (name().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||||
return "error.msg.loan.charge.associated.loan.not.in.submitted.and.pending.approval.stage";
|
return "error.msg.loan.charge.associated.loan.not.in.submitted.and.pending.approval.stage";
|
||||||
}
|
}
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -32,34 +32,34 @@ public class LoanChargeCannotBePayedException extends AbstractPlatformDomainRule
|
|||||||
CHARGE_NOT_PAYABLE; //
|
CHARGE_NOT_PAYABLE; //
|
||||||
|
|
||||||
public String errorMessage() {
|
public String errorMessage() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "This loan charge has been completely paid";
|
return "This loan charge has been completely paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "This loan charge has already been waived";
|
return "This loan charge has already been waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_INACTIVE")) {
|
} else if (name().equalsIgnoreCase("LOAN_INACTIVE")) {
|
||||||
return "This loan charge can be payed as the loan associated with it is currently inactive";
|
return "This loan charge can be payed as the loan associated with it is currently inactive";
|
||||||
} else if (name().toString().equalsIgnoreCase("CHARGE_NOT_ACCOUNT_TRANSFER")) {
|
} else if (name().equalsIgnoreCase("CHARGE_NOT_ACCOUNT_TRANSFER")) {
|
||||||
return "This loan charge can be payed as the charge payment mode is not account transfer";
|
return "This loan charge can be payed as the charge payment mode is not account transfer";
|
||||||
} else if (name().toString().equalsIgnoreCase("CHARGE_NOT_PAYABLE")) {
|
} else if (name().equalsIgnoreCase("CHARGE_NOT_PAYABLE")) {
|
||||||
return "This loan charge is not Payable through account transfer";
|
return "This loan charge is not Payable through account transfer";
|
||||||
}
|
}
|
||||||
|
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String errorCode() {
|
public String errorCode() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "error.msg.loan.charge.already.paid";
|
return "error.msg.loan.charge.already.paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "error.msg.loan.charge.already.waived";
|
return "error.msg.loan.charge.already.waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_INACTIVE")) {
|
} else if (name().equalsIgnoreCase("LOAN_INACTIVE")) {
|
||||||
return "error.msg.loan.charge.associated.loan.inactive";
|
return "error.msg.loan.charge.associated.loan.inactive";
|
||||||
} else if (name().toString().equalsIgnoreCase("CHARGE_NOT_ACCOUNT_TRANSFER")) {
|
} else if (name().equalsIgnoreCase("CHARGE_NOT_ACCOUNT_TRANSFER")) {
|
||||||
return "error.msg.loan.charge.payment.mode.not.account.transfer";
|
return "error.msg.loan.charge.payment.mode.not.account.transfer";
|
||||||
} else if (name().toString().equalsIgnoreCase("CHARGE_NOT_PAYABLE")) {
|
} else if (name().equalsIgnoreCase("CHARGE_NOT_PAYABLE")) {
|
||||||
return "error.msg.loan.charge.payment.not.allowed.account.transfer";
|
return "error.msg.loan.charge.payment.not.allowed.account.transfer";
|
||||||
}
|
}
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -30,25 +30,25 @@ public class LoanChargeCannotBeUpdatedException extends AbstractPlatformDomainRu
|
|||||||
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE; //
|
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE; //
|
||||||
|
|
||||||
public String errorMessage() {
|
public String errorMessage() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "This loan charge has been partially/completely paid";
|
return "This loan charge has been partially/completely paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "This loan charge has already been waived";
|
return "This loan charge has already been waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
} else if (name().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||||
return "This charge cannot be updated as the loan it is associated with is not in submitted and pending approval stage";
|
return "This charge cannot be updated as the loan it is associated with is not in submitted and pending approval stage";
|
||||||
}
|
}
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String errorCode() {
|
public String errorCode() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "error.msg.loan.charge.already.paid";
|
return "error.msg.loan.charge.already.paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "error.msg.loan.charge.already.waived";
|
return "error.msg.loan.charge.already.waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
} else if (name().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) {
|
||||||
return "error.msg.loan.charge.associated.loan.not.in.submitted.and.pending.approval.stage";
|
return "error.msg.loan.charge.associated.loan.not.in.submitted.and.pending.approval.stage";
|
||||||
}
|
}
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -31,30 +31,30 @@ public class LoanChargeCannotBeWaivedException extends AbstractPlatformDomainRul
|
|||||||
WAIVE_NOT_ALLOWED_FOR_CHARGE; //
|
WAIVE_NOT_ALLOWED_FOR_CHARGE; //
|
||||||
|
|
||||||
public String errorMessage() {
|
public String errorMessage() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "This loan charge has been completely paid";
|
return "This loan charge has been completely paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "This loan charge has already been waived";
|
return "This loan charge has already been waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_INACTIVE")) {
|
} else if (name().equalsIgnoreCase("LOAN_INACTIVE")) {
|
||||||
return "This loan charge can be waived as the loan associated with it is currently inactive";
|
return "This loan charge can be waived as the loan associated with it is currently inactive";
|
||||||
} else if (name().toString().equalsIgnoreCase("WAIVE_NOT_ALLOWED_FOR_CHARGE")) {
|
} else if (name().equalsIgnoreCase("WAIVE_NOT_ALLOWED_FOR_CHARGE")) {
|
||||||
return "This loan charge can be waived";
|
return "This loan charge can be waived";
|
||||||
}
|
}
|
||||||
|
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String errorCode() {
|
public String errorCode() {
|
||||||
if (name().toString().equalsIgnoreCase("ALREADY_PAID")) {
|
if (name().equalsIgnoreCase("ALREADY_PAID")) {
|
||||||
return "error.msg.loan.charge.already.paid";
|
return "error.msg.loan.charge.already.paid";
|
||||||
} else if (name().toString().equalsIgnoreCase("ALREADY_WAIVED")) {
|
} else if (name().equalsIgnoreCase("ALREADY_WAIVED")) {
|
||||||
return "error.msg.loan.charge.already.waived";
|
return "error.msg.loan.charge.already.waived";
|
||||||
} else if (name().toString().equalsIgnoreCase("LOAN_INACTIVE")) {
|
} else if (name().equalsIgnoreCase("LOAN_INACTIVE")) {
|
||||||
return "error.msg.loan.charge.associated.loan.inactive";
|
return "error.msg.loan.charge.associated.loan.inactive";
|
||||||
} else if (name().toString().equalsIgnoreCase("WAIVE_NOT_ALLOWED_FOR_CHARGE")) {
|
} else if (name().equalsIgnoreCase("WAIVE_NOT_ALLOWED_FOR_CHARGE")) {
|
||||||
return "error.msg.loan.charge.waive.not.allowed";
|
return "error.msg.loan.charge.waive.not.allowed";
|
||||||
}
|
}
|
||||||
return name().toString();
|
return name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -65,7 +65,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().toString().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
@@ -126,7 +126,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().toString().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
@@ -202,7 +202,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
@@ -249,7 +249,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
@@ -281,7 +281,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
@@ -330,7 +330,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
@@ -386,7 +386,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
@@ -424,7 +424,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
@@ -464,7 +464,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
@@ -529,7 +529,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
@@ -568,7 +568,7 @@ public final class AccountingConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ public enum AccountingRuleType {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumOptionData toEnumOptionData() {
|
public EnumOptionData toEnumOptionData() {
|
||||||
|
|||||||
+5
-3
@@ -28,6 +28,8 @@ import org.apache.fineract.infrastructure.core.serialization.JsonParserHelper;
|
|||||||
|
|
||||||
public final class ApiParameterHelper {
|
public final class ApiParameterHelper {
|
||||||
|
|
||||||
|
private static final String GENERIC_RESULT_SET = "genericResultSet";
|
||||||
|
|
||||||
private ApiParameterHelper() {
|
private ApiParameterHelper() {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -126,14 +128,14 @@ public final class ApiParameterHelper {
|
|||||||
|
|
||||||
public static boolean genericResultSet(final MultivaluedMap<String, String> queryParams) {
|
public static boolean genericResultSet(final MultivaluedMap<String, String> queryParams) {
|
||||||
boolean genericResultSet = false;
|
boolean genericResultSet = false;
|
||||||
if (queryParams.getFirst("genericResultSet") != null) {
|
if (queryParams.getFirst(GENERIC_RESULT_SET) != null) {
|
||||||
final String genericResultSetValue = queryParams.getFirst("genericResultSet");
|
final String genericResultSetValue = queryParams.getFirst(GENERIC_RESULT_SET);
|
||||||
genericResultSet = "true".equalsIgnoreCase(genericResultSetValue);
|
genericResultSet = "true".equalsIgnoreCase(genericResultSetValue);
|
||||||
}
|
}
|
||||||
return genericResultSet;
|
return genericResultSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean genericResultSetPassed(final MultivaluedMap<String, String> queryParams) {
|
public static boolean genericResultSetPassed(final MultivaluedMap<String, String> queryParams) {
|
||||||
return queryParams.getFirst("genericResultSet") != null;
|
return queryParams.getFirst(GENERIC_RESULT_SET) != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public enum PortfolioProductType {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().toString().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
|
|||||||
+3
-3
@@ -285,17 +285,17 @@ public final class CalendarUtils {
|
|||||||
NumberList nthDays = recur.getSetPosList();
|
NumberList nthDays = recur.getSetPosList();
|
||||||
Integer nthDay = null;
|
Integer nthDay = null;
|
||||||
if (!nthDays.isEmpty()) {
|
if (!nthDays.isEmpty()) {
|
||||||
nthDay = nthDays.get(0);
|
nthDay = nthDays.getFirst();
|
||||||
}
|
}
|
||||||
NumberList monthDays = recur.getMonthDayList();
|
NumberList monthDays = recur.getMonthDayList();
|
||||||
Integer monthDay = null;
|
Integer monthDay = null;
|
||||||
if (!monthDays.isEmpty()) {
|
if (!monthDays.isEmpty()) {
|
||||||
monthDay = monthDays.get(0);
|
monthDay = monthDays.getFirst();
|
||||||
}
|
}
|
||||||
WeekDayList weekdays = recur.getDayList();
|
WeekDayList weekdays = recur.getDayList();
|
||||||
WeekDay weekDay = null;
|
WeekDay weekDay = null;
|
||||||
if (!weekdays.isEmpty()) {
|
if (!weekdays.isEmpty()) {
|
||||||
weekDay = weekdays.get(0);
|
weekDay = weekdays.getFirst();
|
||||||
}
|
}
|
||||||
if (nthDay != null && weekDay != null) {
|
if (nthDay != null && weekDay != null) {
|
||||||
NthDayType nthDayType = NthDayType.fromInt(nthDay);
|
NthDayType nthDayType = NthDayType.fromInt(nthDay);
|
||||||
|
|||||||
+2
-5
@@ -61,11 +61,8 @@ public class InvestorAccountingHelper {
|
|||||||
* check if an accounting closure has happened for this branch after the transaction Date
|
* check if an accounting closure has happened for this branch after the transaction Date
|
||||||
**/
|
**/
|
||||||
GLClosure gLClosure = getLatestClosureByBranch(officeId);
|
GLClosure gLClosure = getLatestClosureByBranch(officeId);
|
||||||
if (gLClosure != null) {
|
if (gLClosure != null && !DateUtils.isAfter(transactionDate, gLClosure.getClosingDate())) {
|
||||||
if (!DateUtils.isAfter(transactionDate, gLClosure.getClosingDate())) {
|
throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, gLClosure.getClosingDate(), null, null);
|
||||||
throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, gLClosure.getClosingDate(), null,
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-8
@@ -78,6 +78,8 @@ public class ExternalAssetOwnersApiResource {
|
|||||||
private final LoanReadPlatformServiceCommon loanReadPlatformService;
|
private final LoanReadPlatformServiceCommon loanReadPlatformService;
|
||||||
private final ExternalAssetOwnersSearchApiDelegate delegate;
|
private final ExternalAssetOwnersSearchApiDelegate delegate;
|
||||||
|
|
||||||
|
private static final String COMMAND_PARAM = "command";
|
||||||
|
|
||||||
private static final CommandHandlerRegistry<String, Long, String, CommandWrapper> COMMAND_HANDLER_REGISTRY = new CommandHandlerRegistry<>(
|
private static final CommandHandlerRegistry<String, Long, String, CommandWrapper> COMMAND_HANDLER_REGISTRY = new CommandHandlerRegistry<>(
|
||||||
Map.of(CANCEL_COMMAND_VALUE, (id, json) -> new CommandWrapperBuilder().cancelTransactionByIdToExternalAssetOwner(id).build(),
|
Map.of(CANCEL_COMMAND_VALUE, (id, json) -> new CommandWrapperBuilder().cancelTransactionByIdToExternalAssetOwner(id).build(),
|
||||||
INTERMEDIARY_SALE_COMMAND_VALUE,
|
INTERMEDIARY_SALE_COMMAND_VALUE,
|
||||||
@@ -95,12 +97,12 @@ public class ExternalAssetOwnersApiResource {
|
|||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
||||||
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
||||||
public CommandProcessingResult transferRequestWithLoanId(@PathParam("loanId") final Long loanId,
|
public CommandProcessingResult transferRequestWithLoanId(@PathParam("loanId") final Long loanId,
|
||||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
@QueryParam(COMMAND_PARAM) @Parameter(description = COMMAND_PARAM) final String commandParam,
|
||||||
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
||||||
platformUserRightsContext.isAuthenticated();
|
platformUserRightsContext.isAuthenticated();
|
||||||
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
||||||
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, loanId, serializedAssetRequest,
|
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, loanId, serializedAssetRequest,
|
||||||
new UnrecognizedQueryParamException("command", commandParam));
|
new UnrecognizedQueryParamException(COMMAND_PARAM, commandParam));
|
||||||
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,13 +115,13 @@ public class ExternalAssetOwnersApiResource {
|
|||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
||||||
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
||||||
public CommandProcessingResult transferRequestWithLoanExternalId(@PathParam("loanExternalId") final String externalLoanId,
|
public CommandProcessingResult transferRequestWithLoanExternalId(@PathParam("loanExternalId") final String externalLoanId,
|
||||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
@QueryParam(COMMAND_PARAM) @Parameter(description = COMMAND_PARAM) final String commandParam,
|
||||||
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
||||||
platformUserRightsContext.isAuthenticated();
|
platformUserRightsContext.isAuthenticated();
|
||||||
final Long loanId = loanReadPlatformService.getLoanIdByLoanExternalId(externalLoanId);
|
final Long loanId = loanReadPlatformService.getLoanIdByLoanExternalId(externalLoanId);
|
||||||
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
||||||
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, loanId, serializedAssetRequest,
|
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, loanId, serializedAssetRequest,
|
||||||
new UnrecognizedQueryParamException("command", commandParam));
|
new UnrecognizedQueryParamException(COMMAND_PARAM, commandParam));
|
||||||
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -132,12 +134,12 @@ public class ExternalAssetOwnersApiResource {
|
|||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
||||||
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
||||||
public CommandProcessingResult transferRequestWithId(@PathParam("id") final Long id,
|
public CommandProcessingResult transferRequestWithId(@PathParam("id") final Long id,
|
||||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
@QueryParam(COMMAND_PARAM) @Parameter(description = COMMAND_PARAM) final String commandParam,
|
||||||
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
||||||
platformUserRightsContext.isAuthenticated();
|
platformUserRightsContext.isAuthenticated();
|
||||||
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
||||||
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, id, serializedAssetRequest,
|
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, id, serializedAssetRequest,
|
||||||
new UnrecognizedQueryParamException("command", commandParam));
|
new UnrecognizedQueryParamException(COMMAND_PARAM, commandParam));
|
||||||
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,13 +151,13 @@ public class ExternalAssetOwnersApiResource {
|
|||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))),
|
||||||
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
@ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") })
|
||||||
public CommandProcessingResult transferRequestWithId(@PathParam("externalId") final String externalId,
|
public CommandProcessingResult transferRequestWithId(@PathParam("externalId") final String externalId,
|
||||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
@QueryParam(COMMAND_PARAM) @Parameter(description = COMMAND_PARAM) final String commandParam,
|
||||||
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
|
||||||
platformUserRightsContext.isAuthenticated();
|
platformUserRightsContext.isAuthenticated();
|
||||||
final Long id = externalAssetOwnersReadService.retrieveLastTransferIdByExternalId(new ExternalId(externalId));
|
final Long id = externalAssetOwnersReadService.retrieveLastTransferIdByExternalId(new ExternalId(externalId));
|
||||||
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
|
||||||
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, id, serializedAssetRequest,
|
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, id, serializedAssetRequest,
|
||||||
new UnrecognizedQueryParamException("command", commandParam));
|
new UnrecognizedQueryParamException(COMMAND_PARAM, commandParam));
|
||||||
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ public final class CollateralApiConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().replaceAll("_", " ");
|
return name().replace("_", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
|
|||||||
+4
-4
@@ -2826,10 +2826,10 @@ public class AdvancedPaymentScheduleTransactionProcessor extends AbstractLoanRep
|
|||||||
private Predicate<LoanRepaymentScheduleInstallment> getFilterPredicate(PaymentAllocationType paymentAllocationType,
|
private Predicate<LoanRepaymentScheduleInstallment> getFilterPredicate(PaymentAllocationType paymentAllocationType,
|
||||||
MonetaryCurrency currency) {
|
MonetaryCurrency currency) {
|
||||||
return switch (paymentAllocationType.getAllocationType()) {
|
return switch (paymentAllocationType.getAllocationType()) {
|
||||||
case PENALTY -> (p) -> p.getPenaltyChargesOutstanding(currency).isGreaterThanZero();
|
case PENALTY -> p -> p.getPenaltyChargesOutstanding(currency).isGreaterThanZero();
|
||||||
case FEE -> (p) -> p.getFeeChargesOutstanding(currency).isGreaterThanZero();
|
case FEE -> p -> p.getFeeChargesOutstanding(currency).isGreaterThanZero();
|
||||||
case INTEREST -> (p) -> p.getInterestOutstanding(currency).isGreaterThanZero();
|
case INTEREST -> p -> p.getInterestOutstanding(currency).isGreaterThanZero();
|
||||||
case PRINCIPAL -> (p) -> p.getPrincipalOutstanding(currency).isGreaterThanZero();
|
case PRINCIPAL -> p -> p.getPrincipalOutstanding(currency).isGreaterThanZero();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user