Skip to content

Commit

Permalink
Merged PR 7999: Sync with fiter code 20122024
Browse files Browse the repository at this point in the history
  • Loading branch information
naphlin-fiter authored and Yeison Noreña Osorio committed Dec 20, 2024
1 parent 3aea0f6 commit cab103b
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,7 @@
<include file="parts/20241209011009142_EA_49_tipo_identificacion.xml" relativeToChangelogFile="true"/>
<include file="parts/2024070222441925_SU_272_add_column_point_of_sales_code.xml" relativeToChangelogFile="true" />
<include file="parts/202412131143000000_EA_66_add_min_max_interest.xml" relativeToChangelogFile="true"/>
<include file="parts/202412171143000000_EA_110_delete_blocking_reasons.xml" relativeToChangelogFile="true"/>
<include file="parts/202412171143000001_EA_111_delete_interest_rates.xml" relativeToChangelogFile="true"/>
<include file="parts/202412171143000002_EA_111_add_detalles_column.xml" relativeToChangelogFile="true" />
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">

<changeSet author="fineract" id="1" >
<sql>
<![CDATA[
delete from m_client_block_list;
delete from m_client_blocking_reason ;
update m_client set blocking_reason_id = null;
update m_loan set block_status_id = null;
delete from m_credit_blocking_reason;
delete from m_blocking_reason_setting;
]]>
</sql>

</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">

<changeSet author="fineract" id="2" >
<sql>
<![CDATA[
update m_product_loan set interest_rate_id = null;
update m_charge set interest_rate_id = null;
delete from m_interest_rate_history ;
delete from m_interest_rate ;
]]>
</sql>

</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">

<changeSet author="fineract" id="1" >
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="Detalles de Contacto"/>
</not>
</preConditions>
<sql>
<![CDATA[
CREATE TABLE "Detalles de Contacto" (
"client_id" BIGINT NOT NULL REFERENCES m_client(id),
"YesNo_cd_Requiere Visita" INTEGER,
"Canal de visita_cd_Canal de visita" INTEGER,
"Causal Rechazo Visita_cd_Causal Rechazo Visita" INTEGER,
"Observacion Rechazo Visita" TEXT,
"Usuario asignado" TEXT,
"Correo Usuario Asignado" TEXT,
"Fecha Inicio Contactabilidad" TEXT,
"Validacion contactabilidad" TEXT,
"Causal Rechazo Contactabilidad" TEXT,
"Observacion Rechazo Contactabilidad" TEXT,
"Observacion Contactabilidad" TEXT,
"Segunda Observacion Contactabilidad" TEXT,
"Tercera Observacion Contactabilidad" TEXT,
"Telefono de Contactabilidad" TEXT,
"Fecha Fin Contactabilidad" DATE,
"created_at" TIMESTAMP,
"updated_at" TIMESTAMP
);
]]>
</sql>

</changeSet>
<changeSet author="fineract" id="2" >
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="Detalles_de_Contacto"/>
</not>
</preConditions>
<sql>
<![CDATA[
CREATE TABLE "Detalles_de_Contacto" (
"client_id" BIGINT NOT NULL REFERENCES m_client(id),
"YesNo_cd_Requiere Visita" INTEGER,
"Canal de visita_cd_Canal de visita" INTEGER,
"Causal Rechazo Visita_cd_Causal Rechazo Visita" INTEGER,
"Observacion Rechazo Visita" TEXT,
"Usuario asignado" TEXT,
"Correo Usuario Asignado" TEXT,
"Fecha Inicio Contactabilidad" TEXT,
"Validacion contactabilidad" TEXT,
"Causal Rechazo Contactabilidad" TEXT,
"Observacion Rechazo Contactabilidad" TEXT,
"Observacion Contactabilidad" TEXT,
"Segunda Observacion Contactabilidad" TEXT,
"Tercera Observacion Contactabilidad" TEXT,
"Telefono de Contactabilidad" TEXT,
"Fecha Fin Contactabilidad" DATE,
"created_at" TIMESTAMP,
"updated_at" TIMESTAMP);
]]>
</sql>

</changeSet>

<changeSet id="3" author="fineract">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">
<![CDATA[
Select count(1) from x_registered_table where registered_table_name = 'Detalles de Contacto';
]]>
</sqlCheck>
</preConditions>
<sql>
<![CDATA[
INSERT INTO x_registered_table (registered_table_name, application_table_name, entity_subtype, category) VALUES('Detalles de Contacto', 'm_client', 'Entity', 100);
]]>
</sql>
</changeSet>

<changeSet id="4" author="fineract">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">
<![CDATA[
Select count(1) from x_registered_table where registered_table_name = 'Detalles_de_Contacto';
]]>
</sqlCheck>
</preConditions>
<sql>
<![CDATA[
INSERT INTO x_registered_table (registered_table_name, application_table_name, entity_subtype, category) VALUES('Detalles_de_Contacto', 'm_client', 'Person', 100);
]]>
</sql>
</changeSet>

</databaseChangeLog>

0 comments on commit cab103b

Please sign in to comment.