FINERACT-2154: Store "Pre-close interest calculation strategy" on loan level

This commit is contained in:
Adam Saghy
2024-11-29 21:39:08 +01:00
parent 8d12bc04e9
commit f63df474f6
13 changed files with 98 additions and 46 deletions
@@ -47,4 +47,5 @@
<include relativeToChangelogFile="true" file="parts/1022_add_interest_refund_support.xml"/>
<include relativeToChangelogFile="true" file="parts/1023_add_charge_off_behaviour.xml"/>
<include relativeToChangelogFile="true" file="parts/1024_accrual_adjustment_transaction_type.xml"/>
<include relativeToChangelogFile="true" file="parts/1025_store_pre_closure_strategy_to_loan_level.xml"/>
</databaseChangeLog>
@@ -0,0 +1,38 @@
<?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.3.xsd">
<changeSet author="fineract" id="1024-1">
<addColumn tableName="m_loan_recalculation_details">
<column defaultValueNumeric="1" name="pre_close_interest_calculation_strategy" type="SMALLINT">
<constraints nullable="false"/>
</column>
</addColumn>
<sql>
UPDATE m_loan_recalculation_details SET pre_close_interest_calculation_strategy = 2 WHERE loan_id IN (
SELECT ml.id FROM m_loan ml, m_product_loan_recalculation_details plrd WHERE plrd.product_id = ml.product_id AND plrd.pre_close_interest_calculation_strategy = 2
)
</sql>
</changeSet>
</databaseChangeLog>