mariiaKraievska commented on code in PR #6143:
URL: https://github.com/apache/fineract/pull/6143#discussion_r3690847961
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoan.java:
##########
@@ -170,11 +171,57 @@ public class WorkingCapitalLoan extends
AbstractAuditableWithUTCDateTimeCustom<L
@Column(name = "total_payment_volume", scale = 6, precision = 19, nullable
= false)
private BigDecimal totalPaymentVolume;
+ /**
+ * Charge-off is a pure accounting tag: it does not affect the portfolio
(balance, schedule) and the loan stays
+ * ACTIVE. Once set, the tag is only cleared by an explicit undo (it
survives even when the loan is fully paid).
+ */
+ @Column(name = "is_charged_off", nullable = false)
+ private boolean chargedOff;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "charge_off_reason_cv_id")
+ private CodeValue chargeOffReason;
+
+ @Column(name = "charged_off_on_date")
+ private LocalDate chargedOffOnDate;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "charged_off_by_userid")
+ private AppUser chargedOffBy;
+
public Long getOfficeId() {
return client != null && client.getOffice() != null ?
client.getOffice().getId() : null;
}
public Long getClientId() {
return client != null ? client.getId() : null;
}
+
+ /**
+ * Marks the account as charged-off. The {@code chargeOffReason} is
optional and may be {@code null}.
+ */
+ public void markAsChargedOff(final LocalDate chargedOffOnDate, final
AppUser chargedOffBy, final CodeValue chargeOffReason) {
+ this.chargedOff = true;
+ this.chargedOffOnDate = chargedOffOnDate;
+ this.chargedOffBy = chargedOffBy;
+ this.chargeOffReason = chargeOffReason;
+ }
+
+ /**
+ * Reverses the charge-off tag. Only used when the charge-off was applied
in error.
+ */
+ public void liftChargeOff() {
+ this.chargedOff = false;
+ this.chargedOffOnDate = null;
+ this.chargedOffBy = null;
+ this.chargeOffReason = null;
+ }
+
+ public boolean isChargeOffOnDate(final LocalDate date) {
+ return this.chargedOffOnDate != null &&
this.chargedOffOnDate.isEqual(date);
Review Comment:
Minor(as this method is not currently used anywhere): Term loan uses <=;
here it’s equality only. Is that intentional?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]