FINERACT-2326: CodeValue serialization enhancement (#5007)

This commit is contained in:
Adam Saghy
2025-09-04 11:53:02 -06:00
committed by GitHub
parent fdcb013e7a
commit a81f4f8fe9
3 changed files with 14 additions and 19 deletions
@@ -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);
}
@@ -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);
}
}
@@ -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) {