WEB-455: add full term tranches configuration

This commit is contained in:
Attila Budai
2025-12-04 15:06:07 +01:00
parent f1b4ec2cf2
commit 1ab397f850
8 changed files with 53 additions and 3 deletions
@@ -487,6 +487,15 @@
<div class="flex-100 layout-row" *ngIf="allowAddDisbursementDetails()">
<h4 class="mat-h4 flex-98">{{ 'labels.heading.Loan Tranche Details' | translate }}</h4>
</div>
<mat-checkbox
*ngIf="isFullTermTrancheEditable()"
class="flex-48 margin-v"
labelPosition="before"
formControlName="allowFullTermForTranche"
matTooltip="{{ 'tooltips.Allow full term length for each tranche disbursement' | translate }}"
>
{{ 'labels.inputs.Allow full term for each tranche' | translate }}
</mat-checkbox>
<div class="flex-100 layout-row">
<mat-form-field class="flex-48">
<mat-label>{{ 'labels.inputs.Maximum allowed outstanding balance' | translate }}</mat-label>
@@ -255,6 +255,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
this.loansAccountTermsForm.addControl('enableDownPayment', new UntypedFormControl(enableDownPayment));
}
if (this.isFullTermTrancheEditable()) {
const allowFullTermForTranche =
this.loansAccountTermsData.allowFullTermForTranche ?? this.loanProduct?.allowFullTermForTranche ?? false;
this.loansAccountTermsForm.patchValue({ allowFullTermForTranche });
}
const allowAttributeOverrides = this.loansAccountTermsData.product.allowAttributeOverrides;
if (!allowAttributeOverrides.repaymentEvery) {
this.loansAccountTermsForm.controls.repaymentEvery.disable();
@@ -517,7 +523,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
multiDisburseLoan: [false],
interestRateFrequencyType: [''],
balloonRepaymentAmount: [''],
interestRecognitionOnDisbursementDate: [false]
interestRecognitionOnDisbursementDate: [false],
allowFullTermForTranche: [false]
});
}
@@ -700,4 +707,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
collateral: this.collateralDataSource
};
}
/**
* Check if full term tranche option should be editable at loan level.
* Only available if the loan product has it enabled and is PROGRESSIVE schedule type.
*/
isFullTermTrancheEditable(): boolean {
return this.isProgressive && this.loanProduct?.allowFullTermForTranche === true;
}
}
@@ -4,6 +4,11 @@
<span class="flex-60">{{ loanDetails.maxOutstandingLoanBalance | formatNumber }}</span>
</div>
<div class="flex-fill" *ngIf="loanDetails.allowFullTermForTranche">
<span class="flex-40">{{ 'labels.inputs.Allow full term for each tranche' | translate }}:</span>
<span class="flex-60">{{ loanDetails.allowFullTermForTranche | yesNo }}</span>
</div>
<h3>{{ 'labels.heading.Loan Tranche Details' | translate }}</h3>
<div class="layout-row margin-t layout-xs-column layout-align-end gap-2percent">
@@ -27,6 +27,7 @@ import {
import { MatTooltip } from '@angular/material/tooltip';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { FormatNumberPipe } from '../../../pipes/format-number.pipe';
import { YesnoPipe } from '../../../pipes/yesno.pipe';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@Component({
@@ -49,7 +50,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
MatRowDef,
MatRow,
DateFormatPipe,
FormatNumberPipe
FormatNumberPipe,
YesnoPipe
]
})
export class LoanTrancheDetailsComponent implements OnInit {