WEB-280: Add additional field which would return available disbursement amount with over applied amount

This commit is contained in:
mariiaKraievska
2025-08-20 14:19:14 +03:00
parent f6e55c4006
commit 36f7ac7bbd
24 changed files with 150 additions and 18 deletions
@@ -17,7 +17,9 @@ import { Currency } from 'app/shared/models/general.model';
import { InputAmountComponent } from '../../../../shared/input-amount/input-amount.component';
import { MatSlideToggle } from '@angular/material/slide-toggle';
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
import { FormatNumberPipe } from '../../../../pipes/format-number.pipe';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { MatIcon } from '@angular/material/icon';
/**
* Disburse Loan Option
@@ -30,7 +32,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
...STANDALONE_SHARED_IMPORTS,
InputAmountComponent,
MatSlideToggle,
CdkTextareaAutosize
CdkTextareaAutosize,
FormatNumberPipe,
MatIcon
]
})
export class DisburseComponent implements OnInit {
@@ -78,6 +82,19 @@ export class DisburseComponent implements OnInit {
if (this.dataObject.currency) {
this.currency = this.dataObject.currency;
}
// Get delinquency data for available disbursement amount with over applied
this.loanService.getLoanDelinquencyDataForTemplate(this.loanId).subscribe((delinquencyData: any) => {
// Check if the field is at root level
if (delinquencyData.availableDisbursementAmountWithOverApplied !== undefined) {
this.dataObject.availableDisbursementAmountWithOverApplied =
delinquencyData.availableDisbursementAmountWithOverApplied;
}
// Also check if it's in delinquent object
if (delinquencyData.delinquent) {
this.dataObject.delinquent = delinquencyData.delinquent;
}
});
}
/**