FINERACT-2208: Penalties are not recalculated after backdated transactions

This commit is contained in:
Arnold Galovics
2025-03-12 16:52:30 +01:00
committed by Arnold Gálovics
parent 91f0662998
commit 3198b1b99e
19 changed files with 1099 additions and 234 deletions
@@ -799,6 +799,15 @@ public class CommandWrapperBuilder {
return this;
}
public CommandWrapperBuilder deactivateOverdueLoanCharges(final Long loanId, final Long loanChargeId) {
this.actionName = "DEACTIVATEOVERDUE";
this.entityName = "LOANCHARGE";
this.entityId = loanChargeId;
this.loanId = loanId;
this.href = "/loans/" + loanId + "/charges/" + loanChargeId;
return this;
}
public CommandWrapperBuilder deleteLoanCharge(final Long loanId, final Long loanChargeId) {
this.actionName = "DELETE";
this.entityName = "LOANCHARGE";
@@ -302,6 +302,10 @@ public final class DateUtils {
return isAfterBusinessDate(localDate);
}
public static boolean isDateInThePast(final LocalDate localDate) {
return isBeforeBusinessDate(localDate);
}
public static int compare(LocalDate first, LocalDate second) {
return compare(first, second, true);
}
@@ -334,6 +338,10 @@ public final class DateUtils {
return first != null && (second == null || first.isAfter(second));
}
public static boolean isAfterInclusive(LocalDate first, LocalDate second) {
return isAfter(first, second) || isEqual(first, second);
}
public static long getDifference(LocalDate first, LocalDate second, @NotNull ChronoUnit unit) {
if (first == null || second == null) {
throw new IllegalArgumentException("Dates must not be null to get difference");