From cab103b60661968c89b4a073fa497cc7cc6b684f Mon Sep 17 00:00:00 2001 From: Naphlin Akena Date: Fri, 20 Dec 2024 15:36:01 +0000 Subject: [PATCH] Merged PR 7999: Sync with fiter code 20122024 Related work items: #1338, #1339, #1340, #1343, #1344, #1345, #1347, #1348, #1349, #1350, #1351, #1352, #1353, #1354, #1355, #1356, #1357, #1358, #1361, #1362, #1363, #1364, #1365, #1366, #1367, #1368, #1369, #1371, #1374, #1375, #1381, #1382, #1383, #1384, #1385, #1388, #1391, #1403, #1417, #29692 --- ...initionCommandFromApiJsonDeserializer.java | 23 ++-- .../db/changelog/tenant/changelog-tenant.xml | 3 + ...3000000_EA_110_delete_blocking_reasons.xml | 39 ++++++ ...143000001_EA_111_delete_interest_rates.xml | 37 ++++++ ...71143000002_EA_111_add_detalles_column.xml | 121 ++++++++++++++++++ 5 files changed, 214 insertions(+), 9 deletions(-) create mode 100644 fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000000_EA_110_delete_blocking_reasons.xml create mode 100644 fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000001_EA_111_delete_interest_rates.xml create mode 100644 fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000002_EA_111_add_detalles_column.xml diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/serialization/ChargeDefinitionCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/serialization/ChargeDefinitionCommandFromApiJsonDeserializer.java index e7012df8840..a6a812b6386 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/serialization/ChargeDefinitionCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/serialization/ChargeDefinitionCommandFromApiJsonDeserializer.java @@ -39,7 +39,11 @@ import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; import org.apache.fineract.portfolio.charge.api.ChargesApiConstants; -import org.apache.fineract.portfolio.charge.domain.*; +import org.apache.fineract.portfolio.charge.domain.ChargeAppliesTo; +import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType; +import org.apache.fineract.portfolio.charge.domain.ChargeInsuranceType; +import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode; +import org.apache.fineract.portfolio.charge.domain.ChargeTimeType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -508,7 +512,8 @@ 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, @@ -541,28 +546,28 @@ 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); } diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml index c23345cb22e..8ccb9e604d3 100644 --- a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml +++ b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml @@ -335,4 +335,7 @@ + + + diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000000_EA_110_delete_blocking_reasons.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000000_EA_110_delete_blocking_reasons.xml new file mode 100644 index 00000000000..be8fe19ffa1 --- /dev/null +++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000000_EA_110_delete_blocking_reasons.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000001_EA_111_delete_interest_rates.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000001_EA_111_delete_interest_rates.xml new file mode 100644 index 00000000000..907c3e0aac8 --- /dev/null +++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000001_EA_111_delete_interest_rates.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000002_EA_111_add_detalles_column.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000002_EA_111_add_detalles_column.xml new file mode 100644 index 00000000000..9764a611e2d --- /dev/null +++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/202412171143000002_EA_111_add_detalles_column.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +