From 1ab397f850028b6518559cc422993446af7f1160 Mon Sep 17 00:00:00 2001 From: Attila Budai Date: Thu, 4 Dec 2025 15:06:07 +0100 Subject: [PATCH] WEB-455: add full term tranches configuration --- .../loans-account-terms-step.component.html | 9 +++++++++ .../loans-account-terms-step.component.ts | 17 ++++++++++++++++- .../loan-tranche-details.component.html | 5 +++++ .../loan-tranche-details.component.ts | 4 +++- .../loan-product-settings-step.component.html | 10 ++++++++++ .../loan-product-settings-step.component.ts | 8 +++++++- .../loan-products/models/loan-product.model.ts | 1 + src/assets/translations/en-US.json | 2 ++ 8 files changed, 53 insertions(+), 3 deletions(-) diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html index 82b3c03e9..cb50a65bc 100644 --- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html +++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html @@ -487,6 +487,15 @@

{{ 'labels.heading.Loan Tranche Details' | translate }}

+ + {{ 'labels.inputs.Allow full term for each tranche' | translate }} +
{{ 'labels.inputs.Maximum allowed outstanding balance' | translate }} diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts index 464de16a3..479c20c4a 100644 --- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts @@ -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; + } } diff --git a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.html b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.html index 3f851cc98..9200519c4 100644 --- a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.html +++ b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.html @@ -4,6 +4,11 @@ {{ loanDetails.maxOutstandingLoanBalance | formatNumber }}
+
+ {{ 'labels.inputs.Allow full term for each tranche' | translate }}: + {{ loanDetails.allowFullTermForTranche | yesNo }} +
+

{{ 'labels.heading.Loan Tranche Details' | translate }}

diff --git a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts index 33c004fb6..f6bbde9b9 100644 --- a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts +++ b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts @@ -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 { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html index 5e4752302..995bd0f35 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html @@ -157,6 +157,16 @@ {{ 'labels.inputs.Disallow Expected Disbursements' | translate }} + + + {{ 'labels.inputs.Allow full term for each tranche' | translate }} +

{{ 'labels.heading.Down Payment' | translate }}

diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts index cd3665d81..eee52c613 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts @@ -146,6 +146,7 @@ export class LoanProductSettingsStepComponent implements OnInit { multiDisburseLoan: this.loanProductsTemplate.multiDisburseLoan, maxTrancheCount: this.loanProductsTemplate.maxTrancheCount, outstandingLoanBalance: this.loanProductsTemplate.outstandingLoanBalance, + allowFullTermForTranche: this.loanProductsTemplate.allowFullTermForTranche, enableDownPayment: this.loanProductsTemplate.enableDownPayment, enableInstallmentLevelDelinquency: this.loanProductsTemplate.enableInstallmentLevelDelinquency, loanScheduleType: this.loanProductsTemplate.loanScheduleType.code, @@ -314,6 +315,7 @@ export class LoanProductSettingsStepComponent implements OnInit { isInterestRecalculationEnabled: [false], holdGuaranteeFunds: [false], multiDisburseLoan: [false], + allowFullTermForTranche: [false], allowAttributeConfiguration: [true], allowPartialPeriodInterestCalculation: [false], allowAttributeOverrides: this.formBuilder.group({ @@ -553,7 +555,10 @@ export class LoanProductSettingsStepComponent implements OnInit { } else { this.loanProductSettingsForm.removeControl('maxTrancheCount'); this.loanProductSettingsForm.removeControl('outstandingLoanBalance'); - this.loanProductSettingsForm.patchValue({ disallowExpectedDisbursements: false }); + this.loanProductSettingsForm.patchValue({ + disallowExpectedDisbursements: false, + allowFullTermForTranche: false + }); } }); @@ -646,6 +651,7 @@ export class LoanProductSettingsStepComponent implements OnInit { this.advancedTransactionProcessingStrategyDisabled = false; this.isAdvancedTransactionProcessingStrategy = false; this.loanProductSettingsForm.removeControl('chargeOffBehaviour'); + this.loanProductSettingsForm.patchValue({ allowFullTermForTranche: false }); } else { // Only Advanced Payment Allocation Strategy this.transactionProcessingStrategyDataBase.some((cn: CodeName) => { diff --git a/src/app/products/loan-products/models/loan-product.model.ts b/src/app/products/loan-products/models/loan-product.model.ts index 9ad7c3c83..d66039b64 100644 --- a/src/app/products/loan-products/models/loan-product.model.ts +++ b/src/app/products/loan-products/models/loan-product.model.ts @@ -97,6 +97,7 @@ export interface LoanProduct { creditAllocationAllocationTypes: OptionData[]; multiDisburseLoan: boolean; maxTrancheCount: number; + allowFullTermForTranche: boolean; disallowExpectedDisbursements: boolean; allowApprovedDisbursedAmountsOverApplied: boolean; overAppliedNumber: number; diff --git a/src/assets/translations/en-US.json b/src/assets/translations/en-US.json index 65dc2d853..33ee0a706 100644 --- a/src/assets/translations/en-US.json +++ b/src/assets/translations/en-US.json @@ -1599,6 +1599,7 @@ "Enable Dormancy Tracking": "Enable Dormancy Tracking", "Enable Down Payment": "Enable Down Payment", "Enable Multiple Disbursals": "Enable Multiple Disbursals", + "Allow full term for each tranche": "Allow full term for each tranche", "Enabled": "Enabled", "End Date": "End Date", "End Point": "End Point", @@ -3566,6 +3567,7 @@ "Keyboard Shortcuts": "Keyboard Shortcuts", "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", "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.", + "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.", "Loan Account": "Loan Account", "Loan Product can be used to apply for Topup Loans": "If selected, the Loan Product can be used to apply for Top Up Loans.", "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.",