This is an automated email from the ASF dual-hosted git repository.
adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new 0d8d6671a1 FINERACT-2304: Add versioning to LoanTransaction entity
0d8d6671a1 is described below
commit 0d8d6671a1cab945df3cfe72474f86dd81ed2a32
Author: mark.vituska <[email protected]>
AuthorDate: Wed May 28 15:57:21 2025 +0200
FINERACT-2304: Add versioning to LoanTransaction entity
---
.../loanaccount/domain/LoanTransaction.java | 4 +++
.../db/changelog/tenant/changelog-tenant.xml | 1 +
.../0180_add_version_field_to_loan_transaction.xml | 32 ++++++++++++++++++++++
3 files changed, 37 insertions(+)
diff --git
a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
index 28a7e86a27..2031438ac2 100644
---
a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
+++
b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
@@ -28,6 +28,7 @@ import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
+import jakarta.persistence.Version;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
@@ -58,6 +59,9 @@ import
org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail;
@Table(name = "m_loan_transaction", uniqueConstraints = {
@UniqueConstraint(columnNames = { "external_id" }, name = "external_id_UNIQUE")
})
public class LoanTransaction extends
AbstractAuditableWithUTCDateTimeCustom<Long> {
+ @Version
+ private Long version;
+
@ManyToOne(optional = false)
@JoinColumn(name = "loan_id", nullable = false)
private Loan loan;
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 ce67fcb5da..be91d29c08 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
@@ -198,4 +198,5 @@
<include file="parts/0177_acc_journal_entry_index.xml"
relativeToChangelogFile="true" />
<include
file="parts/0178_add_principal_from_capitalized_income_to_loan_summary.xml"
relativeToChangelogFile="true" />
<include
file="parts/0179_add_capitalized_income_adjustment_transaction.xml"
relativeToChangelogFile="true" />
+ <include file="parts/0180_add_version_field_to_loan_transaction.xml"
relativeToChangelogFile="true" />
</databaseChangeLog>
diff --git
a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0180_add_version_field_to_loan_transaction.xml
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0180_add_version_field_to_loan_transaction.xml
new file mode 100644
index 0000000000..ca6d811049
--- /dev/null
+++
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0180_add_version_field_to_loan_transaction.xml
@@ -0,0 +1,32 @@
+<?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="1">
+ <addColumn tableName="m_loan_transaction">
+ <column name="version" type="BIGINT" defaultValue="1">
+ <constraints nullable="false"/>
+ </column>
+ </addColumn>
+ </changeSet>
+</databaseChangeLog>