Skip to content

Commit 923f792

Browse files
Merge pull request #2853 from budaidev/WEB-455/full-term-tranches-configuration
WEB-455: add full term tranches configuration
2 parents a0bf474 + 1ab397f commit 923f792

File tree

8 files changed

+53
-3
lines changed

8 files changed

+53
-3
lines changed

src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,15 @@ <h4 class="mat-h4 flex-98">
487487
<div class="flex-100 layout-row" *ngIf="allowAddDisbursementDetails()">
488488
<h4 class="mat-h4 flex-98">{{ 'labels.heading.Loan Tranche Details' | translate }}</h4>
489489
</div>
490+
<mat-checkbox
491+
*ngIf="isFullTermTrancheEditable()"
492+
class="flex-48 margin-v"
493+
labelPosition="before"
494+
formControlName="allowFullTermForTranche"
495+
matTooltip="{{ 'tooltips.Allow full term length for each tranche disbursement' | translate }}"
496+
>
497+
{{ 'labels.inputs.Allow full term for each tranche' | translate }}
498+
</mat-checkbox>
490499
<div class="flex-100 layout-row">
491500
<mat-form-field class="flex-48">
492501
<mat-label>{{ 'labels.inputs.Maximum allowed outstanding balance' | translate }}</mat-label>

src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
255255
this.loansAccountTermsForm.addControl('enableDownPayment', new UntypedFormControl(enableDownPayment));
256256
}
257257

258+
if (this.isFullTermTrancheEditable()) {
259+
const allowFullTermForTranche =
260+
this.loansAccountTermsData.allowFullTermForTranche ?? this.loanProduct?.allowFullTermForTranche ?? false;
261+
this.loansAccountTermsForm.patchValue({ allowFullTermForTranche });
262+
}
263+
258264
const allowAttributeOverrides = this.loansAccountTermsData.product.allowAttributeOverrides;
259265
if (!allowAttributeOverrides.repaymentEvery) {
260266
this.loansAccountTermsForm.controls.repaymentEvery.disable();
@@ -517,7 +523,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
517523
multiDisburseLoan: [false],
518524
interestRateFrequencyType: [''],
519525
balloonRepaymentAmount: [''],
520-
interestRecognitionOnDisbursementDate: [false]
526+
interestRecognitionOnDisbursementDate: [false],
527+
allowFullTermForTranche: [false]
521528
});
522529
}
523530

@@ -700,4 +707,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
700707
collateral: this.collateralDataSource
701708
};
702709
}
710+
711+
/**
712+
* Check if full term tranche option should be editable at loan level.
713+
* Only available if the loan product has it enabled and is PROGRESSIVE schedule type.
714+
*/
715+
isFullTermTrancheEditable(): boolean {
716+
return this.isProgressive && this.loanProduct?.allowFullTermForTranche === true;
717+
}
703718
}

src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<span class="flex-60">{{ loanDetails.maxOutstandingLoanBalance | formatNumber }}</span>
55
</div>
66

7+
<div class="flex-fill" *ngIf="loanDetails.allowFullTermForTranche">
8+
<span class="flex-40">{{ 'labels.inputs.Allow full term for each tranche' | translate }}:</span>
9+
<span class="flex-60">{{ loanDetails.allowFullTermForTranche | yesNo }}</span>
10+
</div>
11+
712
<h3>{{ 'labels.heading.Loan Tranche Details' | translate }}</h3>
813

914
<div class="layout-row margin-t layout-xs-column layout-align-end gap-2percent">

src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
import { MatTooltip } from '@angular/material/tooltip';
2828
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
2929
import { FormatNumberPipe } from '../../../pipes/format-number.pipe';
30+
import { YesnoPipe } from '../../../pipes/yesno.pipe';
3031
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
3132

3233
@Component({
@@ -49,7 +50,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
4950
MatRowDef,
5051
MatRow,
5152
DateFormatPipe,
52-
FormatNumberPipe
53+
FormatNumberPipe,
54+
YesnoPipe
5355
]
5456
})
5557
export class LoanTrancheDetailsComponent implements OnInit {

src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ <h3 class="mat-h3 flex-96">{{ 'labels.inputs.Loan Tranche Details' | translate }
157157
<mat-checkbox class="flex-48 margin-v" labelPosition="before" formControlName="disallowExpectedDisbursements">
158158
{{ 'labels.inputs.Disallow Expected Disbursements' | translate }}
159159
</mat-checkbox>
160+
161+
<mat-checkbox
162+
*ngIf="loanProductSettingsForm.value.loanScheduleType === 'PROGRESSIVE'"
163+
class="flex-48 margin-v"
164+
labelPosition="before"
165+
formControlName="allowFullTermForTranche"
166+
matTooltip="{{ 'tooltips.Allow full term length for each tranche disbursement' | translate }}"
167+
>
168+
{{ 'labels.inputs.Allow full term for each tranche' | translate }}
169+
</mat-checkbox>
160170
</div>
161171

162172
<h3 class="mat-h3 flex-96">{{ 'labels.heading.Down Payment' | translate }}</h3>

src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
146146
multiDisburseLoan: this.loanProductsTemplate.multiDisburseLoan,
147147
maxTrancheCount: this.loanProductsTemplate.maxTrancheCount,
148148
outstandingLoanBalance: this.loanProductsTemplate.outstandingLoanBalance,
149+
allowFullTermForTranche: this.loanProductsTemplate.allowFullTermForTranche,
149150
enableDownPayment: this.loanProductsTemplate.enableDownPayment,
150151
enableInstallmentLevelDelinquency: this.loanProductsTemplate.enableInstallmentLevelDelinquency,
151152
loanScheduleType: this.loanProductsTemplate.loanScheduleType.code,
@@ -314,6 +315,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
314315
isInterestRecalculationEnabled: [false],
315316
holdGuaranteeFunds: [false],
316317
multiDisburseLoan: [false],
318+
allowFullTermForTranche: [false],
317319
allowAttributeConfiguration: [true],
318320
allowPartialPeriodInterestCalculation: [false],
319321
allowAttributeOverrides: this.formBuilder.group({
@@ -553,7 +555,10 @@ export class LoanProductSettingsStepComponent implements OnInit {
553555
} else {
554556
this.loanProductSettingsForm.removeControl('maxTrancheCount');
555557
this.loanProductSettingsForm.removeControl('outstandingLoanBalance');
556-
this.loanProductSettingsForm.patchValue({ disallowExpectedDisbursements: false });
558+
this.loanProductSettingsForm.patchValue({
559+
disallowExpectedDisbursements: false,
560+
allowFullTermForTranche: false
561+
});
557562
}
558563
});
559564

@@ -646,6 +651,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
646651
this.advancedTransactionProcessingStrategyDisabled = false;
647652
this.isAdvancedTransactionProcessingStrategy = false;
648653
this.loanProductSettingsForm.removeControl('chargeOffBehaviour');
654+
this.loanProductSettingsForm.patchValue({ allowFullTermForTranche: false });
649655
} else {
650656
// Only Advanced Payment Allocation Strategy
651657
this.transactionProcessingStrategyDataBase.some((cn: CodeName) => {

src/app/products/loan-products/models/loan-product.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export interface LoanProduct {
9797
creditAllocationAllocationTypes: OptionData[];
9898
multiDisburseLoan: boolean;
9999
maxTrancheCount: number;
100+
allowFullTermForTranche: boolean;
100101
disallowExpectedDisbursements: boolean;
101102
allowApprovedDisbursedAmountsOverApplied: boolean;
102103
overAppliedNumber: number;

src/assets/translations/en-US.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,7 @@
15991599
"Enable Dormancy Tracking": "Enable Dormancy Tracking",
16001600
"Enable Down Payment": "Enable Down Payment",
16011601
"Enable Multiple Disbursals": "Enable Multiple Disbursals",
1602+
"Allow full term for each tranche": "Allow full term for each tranche",
16021603
"Enabled": "Enabled",
16031604
"End Date": "End Date",
16041605
"End Point": "End Point",
@@ -3566,6 +3567,7 @@
35663567
"Keyboard Shortcuts": "Keyboard Shortcuts",
35673568
"Leave this checkbox checked if the loan has Down Payment": "Leave this checkbox checked if the loan has Down Payment, A Down Payment is a sum a buyer pays upfront when purchasing a good. It represents a percentage of the total purchase price, and the balance is usually financed",
35683569
"Leave this checkbox unchecked": "Leave this checkbox unchecked if the loan is a single disburse loan. Check this checkbox if the loan is a multi disburse loan. See additional fields for additional information required for this type of loan.",
3570+
"Allow full term length for each tranche disbursement": "When enabled, each tranche disbursement will follow the full loan term schedule instead of fitting within the remaining term. Only available for PROGRESSIVE loan schedule type.",
35693571
"Loan Account": "Loan Account",
35703572
"Loan Product can be used to apply for Topup Loans": "If selected, the Loan Product can be used to apply for Top Up Loans.",
35713573
"Loan products may be assigned": "Loan products may be assigned to a fund set up by your financial institution. If available, the fund field can be used for tracking and reporting on groups of loans.",

0 commit comments

Comments
 (0)