Allow Undo Loan re-aging transaction

This commit is contained in:
Jose Alberto Hernandez
2024-03-05 08:54:45 -06:00
parent b76b61bae5
commit 2ac05d26d8
16 changed files with 81 additions and 43 deletions
@@ -174,10 +174,16 @@ export class LoansViewComponent implements OnInit {
// Allow Re-Ageing only when there is not any Re-Age transaction
if (!this.loanReAged) {
this.buttonConfig.addButton({
name: 'Re-Ageing',
name: 'Re-Age',
icon: 'calendar',
taskPermissionName: 'REAGE_LOAN',
});
} else {
this.buttonConfig.addButton({
name: 'Undo Re-Age',
icon: 'undo',
taskPermissionName: 'UNDO_REAGE_LOAN',
});
}
}
}
@@ -197,6 +203,9 @@ export class LoansViewComponent implements OnInit {
const queryParams: any = { loanId: this.loanId, accountType: 'fromloans' };
this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams });
break;
case 'Undo Re-Age':
this.undoReAge();
break;
default:
this.router.navigate(['actions', button], { relativeTo: this.route });
break;
@@ -230,6 +239,21 @@ export class LoansViewComponent implements OnInit {
}
}
undoReAge(): void {
const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Undo Transaction'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + ' ReAge'
}
});
undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.loansService.executeLoansAccountTransactionsCommand(String(this.loanId), 'undoReAge', {}).subscribe(() => {
this.reload();
});
}
});
}
iconLoanStatusColor() {
if (this.loanDetailsData.chargedOff) {
return 'loanStatusType.chargeoff';