FINERACT-2384: Incorrect reage transaction date and repayment schedule

This commit is contained in:
Soma Sörös
2025-10-01 12:12:43 +02:00
committed by Adam Saghy
parent d6323be7dd
commit d50906bef2
5 changed files with 186 additions and 84 deletions
@@ -1017,6 +1017,25 @@ public class DataValidatorBuilder {
return this;
}
public DataValidatorBuilder validateDateAfterOrEqual(final LocalDate date) {
if (this.value == null && this.ignoreNullValue) {
return this;
}
if (this.value != null && date != null) {
final LocalDate dateVal = (LocalDate) this.value;
if (DateUtils.isBefore(dateVal, date)) {
String validationErrorCode = "validation.msg." + this.resource + "." + this.parameter + ".is.before.than.date";
String defaultEnglishMessage = "The parameter `" + this.parameter + "` must be greater than or equal to the provided date: "
+ date;
final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode, defaultEnglishMessage, this.parameter,
dateVal, date);
this.dataValidationErrors.add(error);
}
}
return this;
}
public DataValidatorBuilder validateDateBeforeOrEqual(final LocalDate date) {
if (this.value == null && this.ignoreNullValue) {
return this;