Backdated delinquency pause with end date in the past validation

This commit is contained in:
Jose Alberto Hernandez
2024-01-19 10:28:17 +01:00
committed by Adam Saghy
parent 3e589894ce
commit 780c469ee4
2 changed files with 19 additions and 4 deletions
@@ -129,7 +129,22 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
isCurrentAndPauseAction(item: LoanDelinquencyAction): boolean {
if (this.currentLoanDelinquencyAction != null) {
return (this.currentLoanDelinquencyAction.id === item.id && item.action === 'PAUSE');
if (this.currentLoanDelinquencyAction.id === item.id) {
if (item.action === 'PAUSE') {
const businessDate: Date = this.settingsService.businessDate;
const startDate: Date = this.dateUtils.parseDate(item.startDate);
if (businessDate < startDate) {
return false;
}
if (item.endDate) {
const endDate: Date = this.dateUtils.parseDate(item.endDate);
if (businessDate > endDate) {
return false;
}
}
return true;
}
}
}
return false;
}