Skip to content

Commit

Permalink
Merge pull request #1417 from fiterlatam/EA-113
Browse files Browse the repository at this point in the history
EA-113 Disable the mandatory options for Insurance Charge
  • Loading branch information
Napho authored Dec 20, 2024
2 parents 4cce9e4 + 931173b commit fa6fe9c
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ private void validateChargeInsuranceDetails(ChargeCalculationType calculationTyp
if (!penalty) {
if (calculationType.isVoluntaryInsurance()) {
final String insuranceName = this.fromApiJsonHelper.extractStringNamed(ChargesApiConstants.insuranceNameParamName, element);
baseDataValidator.reset().parameter(ChargesApiConstants.insuranceNameParamName).value(insuranceName).notBlank()
baseDataValidator.reset().parameter(ChargesApiConstants.insuranceNameParamName).value(insuranceName)
.notExceedingLengthOf(100);

final Long insuranceChargedAs = this.fromApiJsonHelper.extractLongNamed(ChargesApiConstants.insuranceChargedAsParamName,
Expand Down Expand Up @@ -541,28 +541,26 @@ private void validateChargeInsuranceDetails(ChargeCalculationType calculationTyp

final Integer daysInArrears = this.fromApiJsonHelper.extractIntegerWithLocaleNamed(ChargesApiConstants.DAYS_IN_ARREARS,
element.getAsJsonObject());
baseDataValidator.reset().parameter(ChargesApiConstants.DAYS_IN_ARREARS).value(daysInArrears).notNull()
baseDataValidator.reset().parameter(ChargesApiConstants.DAYS_IN_ARREARS).value(daysInArrears)
.integerEqualToOrGreaterThanNumber(1);
}
if (calculationType.isInsurance()) {

final String insuranceCompany = this.fromApiJsonHelper.extractStringNamed(ChargesApiConstants.insuranceCompanyParamName,
element);
baseDataValidator.reset().parameter(ChargesApiConstants.insuranceCompanyParamName).value(insuranceCompany).notBlank()
baseDataValidator.reset().parameter(ChargesApiConstants.insuranceCompanyParamName).value(insuranceCompany)
.notExceedingLengthOf(100);

final String insurerName = this.fromApiJsonHelper.extractStringNamed(ChargesApiConstants.insurerNameParamName, element);
baseDataValidator.reset().parameter(ChargesApiConstants.insurerNameParamName).value(insurerName).notBlank()
.notExceedingLengthOf(100);
baseDataValidator.reset().parameter(ChargesApiConstants.insurerNameParamName).value(insurerName).notExceedingLengthOf(100);

final Long insuranceCode = this.fromApiJsonHelper.extractLongNamed(ChargesApiConstants.insuranceCodeParamName,
element.getAsJsonObject());
baseDataValidator.reset().parameter(ChargesApiConstants.insuranceCodeParamName).value(insuranceCode).notNull()
.longGreaterThanZero();
baseDataValidator.reset().parameter(ChargesApiConstants.insuranceCodeParamName).value(insuranceCode).longGreaterThanZero();

final Integer daysInArrears = this.fromApiJsonHelper.extractIntegerWithLocaleNamed(ChargesApiConstants.DAYS_IN_ARREARS,
element.getAsJsonObject());
baseDataValidator.reset().parameter(ChargesApiConstants.DAYS_IN_ARREARS).value(daysInArrears).notNull()
baseDataValidator.reset().parameter(ChargesApiConstants.DAYS_IN_ARREARS).value(daysInArrears)
.integerEqualToOrGreaterThanNumber(1);

}
Expand Down

0 comments on commit fa6fe9c

Please sign in to comment.