This is an automated email from the ASF dual-hosted git repository.
victorromero 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 a81f4f8fe9 FINERACT-2326: `CodeValue` serialization enhancement (#5007)
a81f4f8fe9 is described below
commit a81f4f8fe92e9828a04f8df46d61006453855881
Author: Adam Saghy <[email protected]>
AuthorDate: Thu Sep 4 19:53:02 2025 +0200
FINERACT-2326: `CodeValue` serialization enhancement (#5007)
---
.../infrastructure/codes/data/CodeValueData.java | 22 +++++++---------------
.../infrastructure/codes/domain/CodeValue.java | 2 +-
.../service/LoanReadPlatformServiceImpl.java | 9 ++++++---
3 files changed, 14 insertions(+), 19 deletions(-)
diff --git
a/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/data/CodeValueData.java
b/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/data/CodeValueData.java
index f957784652..6e6a828491 100644
---
a/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/data/CodeValueData.java
+++
b/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/data/CodeValueData.java
@@ -39,19 +39,11 @@ public class CodeValueData implements Serializable {
private String name;
private Integer position;
private String description;
- private boolean active;
- private boolean mandatory;
+ private Boolean active;
+ private Boolean mandatory;
- public static CodeValueData instance(final Long id, final String name,
final Integer position, final boolean isActive,
- final boolean mandatory) {
- String description = null;
- return new
CodeValueData().setId(id).setName(name).setPosition(position).setDescription(description).setActive(isActive)
- .setMandatory(mandatory);
- }
-
- public static CodeValueData instance(final Long id, final String name,
final String description, final boolean isActive,
- final boolean mandatory) {
- Integer position = null;
+ public static CodeValueData instance(final Long id, final String name,
final String description, final Integer position,
+ final boolean isActive, final boolean mandatory) {
return new
CodeValueData().setId(id).setName(name).setPosition(position).setDescription(description).setActive(isActive)
.setMandatory(mandatory);
}
@@ -67,10 +59,10 @@ public class CodeValueData implements Serializable {
public static CodeValueData instance(final Long id, final String name) {
String description = null;
Integer position = null;
- boolean isActive = false;
- boolean mandatory = false;
+ Boolean active = null;
+ Boolean mandatory = null;
- return new
CodeValueData().setId(id).setName(name).setPosition(position).setDescription(description).setActive(isActive)
+ return new
CodeValueData().setId(id).setName(name).setPosition(position).setDescription(description).setActive(active)
.setMandatory(mandatory);
}
diff --git
a/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
b/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
index 025268e5c4..8e5d9f2d0b 100644
---
a/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
+++
b/fineract-core/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
@@ -126,6 +126,6 @@ public class CodeValue extends
AbstractPersistableCustom<Long> {
}
public CodeValueData toData() {
- return CodeValueData.instance(getId(), this.label, this.position,
this.isActive, this.mandatory);
+ return CodeValueData.instance(getId(), this.label, this.description,
this.position, this.isActive, this.mandatory);
}
}
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
index 44a6badd49..1e63097576 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
@@ -1674,7 +1674,7 @@ public class LoanReadPlatformServiceImpl implements
LoanReadPlatformService, Loa
+ " fromtran.description as fromTransferDescription, "
+ " totran.id as toTransferId, totran.is_reversed as
toTransferReversed, "
+ " totran.transaction_date as toTransferDate,
totran.amount as toTransferAmount, "
- + " clcv.id as classCodeId, clcv.code_value as
classCodeValue, "
+ + " clcv.id as classificationCodeId, clcv.code_value as
classificationCodeValue, "
+ " totran.description as toTransferDescription from
m_loan l join m_loan_transaction tr on tr.loan_id = l.id "
+ " join m_currency rc on rc." +
sqlGenerator.escape("code") + " = l.currency_code "
+ " left JOIN m_payment_detail pd ON tr.payment_detail_id
= pd.id"
@@ -1707,8 +1707,11 @@ public class LoanReadPlatformServiceImpl implements
LoanReadPlatformService, Loa
final boolean manuallyReversed = rs.getBoolean("manuallyReversed");
PaymentDetailData paymentDetailData = null;
-
- final CodeValueData classificationData =
CodeValueData.instance(rs.getLong("classCodeId"),
rs.getString("classCodeValue"));
+ CodeValueData classificationData = null;
+ Long classificationCodeValueId = JdbcSupport.getLong(rs,
"classificationCodeId");
+ if (classificationCodeValueId != null) {
+ classificationData =
CodeValueData.instance(classificationCodeValueId,
rs.getString("classificationCodeValue"));
+ }
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentType");
if (paymentTypeId != null) {