WEB-524 Remove the lock in period (#2930)

This commit is contained in:
Soni Jay
2025-12-24 18:10:01 -06:00
committed by GitHub
parent c73815e3b3
commit 3bf162db59
15 changed files with 104 additions and 46 deletions
@@ -16,40 +16,62 @@
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<span class="flex-48 hide-lt-md"></span> <mat-divider class="flex-98"></mat-divider>
<mat-form-field class="flex-48"> <h3 class="mat-h3 flex-23">{{ 'labels.inputs.Lock-in Period' | translate }}</h3>
<mat-label>{{ 'labels.inputs.Lock-in Period' | translate }}</mat-label>
<input
type="number"
matInput
matTooltip="{{ 'tooltips.Used to indicate the length of time' | translate }}"
formControlName="lockinPeriodFrequency"
min="1"
step="1"
required
/>
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency').hasError('required')">
{{ 'labels.inputs.Frequency' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency').hasError('min')">
{{ 'tooltips.Frequency must be greater than zero' | translate }}
</mat-error>
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency').hasError('pattern')">
{{ 'tooltips.Frequency must be a positive integer' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="flex-48"> <mat-checkbox
<mat-select formControlName="lockinPeriodFrequencyType"> class="flex-73 margin-b"
@for (lockinPeriodFrequencyType of lockinPeriodFrequencyTypeData; track lockinPeriodFrequencyType) { labelPosition="before"
<mat-option [value]="lockinPeriodFrequencyType.id"> matTooltip="{{ 'tooltips.Used to indicate the length of time' | translate }}"
{{ lockinPeriodFrequencyType.value | translateKey: 'catalogs' }} formControlName="enableLockinPeriod"
</mat-option> >
} {{ 'labels.inputs.Enable Lock-in Period' | translate }}
</mat-select> </mat-checkbox>
</mat-form-field>
@if (savingProductSettingsForm.value.enableLockinPeriod) {
<div class="flex-fill layout-row-wrap gap-2percent responsive-column">
<mat-form-field class="flex-48">
<mat-label>{{ 'labels.inputs.Frequency' | translate }}</mat-label>
<input
type="number"
matInput
matTooltip="{{ 'tooltips.The number at which lock in period occurs' | translate }}"
formControlName="lockinPeriodFrequency"
min="1"
step="1"
required
/>
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency')?.hasError('required')">
{{ 'labels.inputs.Frequency' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency')?.hasError('min')">
{{ 'tooltips.Frequency must be greater than zero' | translate }}
</mat-error>
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency')?.hasError('pattern')">
{{ 'tooltips.Frequency must be a positive integer' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="flex-48">
<mat-label>{{ 'labels.inputs.Type' | translate }}</mat-label>
<mat-select formControlName="lockinPeriodFrequencyType" required>
@for (lockinPeriodFrequencyType of lockinPeriodFrequencyTypeData; track lockinPeriodFrequencyType) {
<mat-option [value]="lockinPeriodFrequencyType.id">
{{ lockinPeriodFrequencyType.value | translateKey: 'catalogs' }}
</mat-option>
}
</mat-select>
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequencyType')?.hasError('required')">
{{ 'labels.inputs.Type' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
</div>
}
<mat-divider class="flex-98"></mat-divider>
<mat-checkbox <mat-checkbox
class="flex-48 margin-v" class="flex-48 margin-v"
@@ -46,12 +46,12 @@ export class SavingProductSettingsStepComponent implements OnInit {
this.lockinPeriodFrequencyTypeData = this.savingProductsTemplate.lockinPeriodFrequencyTypeOptions; this.lockinPeriodFrequencyTypeData = this.savingProductsTemplate.lockinPeriodFrequencyTypeOptions;
this.taxGroupData = this.savingProductsTemplate.taxGroupOptions; this.taxGroupData = this.savingProductsTemplate.taxGroupOptions;
const hasLockinPeriod =
this.savingProductsTemplate.lockinPeriodFrequency && this.savingProductsTemplate.lockinPeriodFrequency > 0;
this.savingProductSettingsForm.patchValue({ this.savingProductSettingsForm.patchValue({
minRequiredOpeningBalance: this.savingProductsTemplate.minRequiredOpeningBalance, minRequiredOpeningBalance: this.savingProductsTemplate.minRequiredOpeningBalance,
lockinPeriodFrequency: this.savingProductsTemplate.lockinPeriodFrequency, enableLockinPeriod: hasLockinPeriod,
lockinPeriodFrequencyType:
this.savingProductsTemplate.lockinPeriodFrequencyType &&
this.savingProductsTemplate.lockinPeriodFrequencyType.id,
withdrawalFeeForTransfers: this.savingProductsTemplate.withdrawalFeeForTransfers, withdrawalFeeForTransfers: this.savingProductsTemplate.withdrawalFeeForTransfers,
minBalanceForInterestCalculation: this.savingProductsTemplate.minBalanceForInterestCalculation, minBalanceForInterestCalculation: this.savingProductsTemplate.minBalanceForInterestCalculation,
enforceMinRequiredBalance: this.savingProductsTemplate.enforceMinRequiredBalance, enforceMinRequiredBalance: this.savingProductsTemplate.enforceMinRequiredBalance,
@@ -67,6 +67,15 @@ export class SavingProductSettingsStepComponent implements OnInit {
daysToDormancy: this.savingProductsTemplate.daysToDormancy, daysToDormancy: this.savingProductsTemplate.daysToDormancy,
daysToEscheat: this.savingProductsTemplate.daysToEscheat daysToEscheat: this.savingProductsTemplate.daysToEscheat
}); });
if (hasLockinPeriod) {
this.savingProductSettingsForm.patchValue({
lockinPeriodFrequency: this.savingProductsTemplate.lockinPeriodFrequency,
lockinPeriodFrequencyType:
this.savingProductsTemplate.lockinPeriodFrequencyType &&
this.savingProductsTemplate.lockinPeriodFrequencyType.id
});
}
} }
createSavingProductSettingsForm() { createSavingProductSettingsForm() {
@@ -75,15 +84,7 @@ export class SavingProductSettingsStepComponent implements OnInit {
'', '',
[Validators.min(0)] [Validators.min(0)]
], ],
lockinPeriodFrequency: [ enableLockinPeriod: [false],
'',
[
Validators.required,
Validators.min(1),
Validators.pattern('^[1-9]\\d*$')
]
],
lockinPeriodFrequencyType: [''],
withdrawalFeeForTransfers: [false], withdrawalFeeForTransfers: [false],
minBalanceForInterestCalculation: [''], minBalanceForInterestCalculation: [''],
enforceMinRequiredBalance: [false], enforceMinRequiredBalance: [false],
@@ -95,6 +96,26 @@ export class SavingProductSettingsStepComponent implements OnInit {
} }
setConditionalControls() { setConditionalControls() {
this.savingProductSettingsForm.get('enableLockinPeriod').valueChanges.subscribe((enableLockinPeriod: any) => {
if (enableLockinPeriod) {
this.savingProductSettingsForm.addControl(
'lockinPeriodFrequency',
new UntypedFormControl('', [
Validators.required,
Validators.min(1),
Validators.pattern('^[1-9]\\d*$')
])
);
this.savingProductSettingsForm.addControl(
'lockinPeriodFrequencyType',
new UntypedFormControl('', Validators.required)
);
} else {
this.savingProductSettingsForm.removeControl('lockinPeriodFrequency');
this.savingProductSettingsForm.removeControl('lockinPeriodFrequencyType');
}
});
this.savingProductSettingsForm.get('allowOverdraft').valueChanges.subscribe((allowOverdraft: any) => { this.savingProductSettingsForm.get('allowOverdraft').valueChanges.subscribe((allowOverdraft: any) => {
if (allowOverdraft) { if (allowOverdraft) {
this.savingProductSettingsForm.addControl('minOverdraftForInterestCalculation', new UntypedFormControl('')); this.savingProductSettingsForm.addControl('minOverdraftForInterestCalculation', new UntypedFormControl(''));
@@ -131,6 +152,8 @@ export class SavingProductSettingsStepComponent implements OnInit {
} }
get savingProductSettings() { get savingProductSettings() {
return this.savingProductSettingsForm.value; const formValue = { ...this.savingProductSettingsForm.value };
delete formValue.enableLockinPeriod;
return formValue;
} }
} }
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "Povolit automatické splácení zálohy", "Enable Auto Repayment for Down Payment": "Povolit automatické splácení zálohy",
"Enable Dormancy Tracking": "Povolit sledování dormance", "Enable Dormancy Tracking": "Povolit sledování dormance",
"Enable Down Payment": "Povolit zálohu", "Enable Down Payment": "Povolit zálohu",
"Enable Lock-in Period": "Povolit zamykací období",
"Enable Multiple Disbursals": "Povolit vícenásobné výplaty", "Enable Multiple Disbursals": "Povolit vícenásobné výplaty",
"Enabled": "Povoleno", "Enabled": "Povoleno",
"End Date": "Datum ukončení", "End Date": "Datum ukončení",
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "Aktivieren Sie die automatische Rückzahlung für die Anzahlung", "Enable Auto Repayment for Down Payment": "Aktivieren Sie die automatische Rückzahlung für die Anzahlung",
"Enable Dormancy Tracking": "Aktivieren Sie die Ruheverfolgung", "Enable Dormancy Tracking": "Aktivieren Sie die Ruheverfolgung",
"Enable Down Payment": "Anzahlung aktivieren", "Enable Down Payment": "Anzahlung aktivieren",
"Enable Lock-in Period": "Sperrfrist aktivieren",
"Enable Multiple Disbursals": "Aktivieren Sie Mehrfachauszahlungen", "Enable Multiple Disbursals": "Aktivieren Sie Mehrfachauszahlungen",
"Enabled": "Ermöglicht", "Enabled": "Ermöglicht",
"End Date": "Endtermin", "End Date": "Endtermin",
+1
View File
@@ -1602,6 +1602,7 @@
"Enable Auto Repayment for Down Payment": "Enable Auto Repayment for Down Payment", "Enable Auto Repayment for Down Payment": "Enable Auto Repayment for Down Payment",
"Enable Dormancy Tracking": "Enable Dormancy Tracking", "Enable Dormancy Tracking": "Enable Dormancy Tracking",
"Enable Down Payment": "Enable Down Payment", "Enable Down Payment": "Enable Down Payment",
"Enable Lock-in Period": "Enable Lock-in Period",
"Enable Multiple Disbursals": "Enable Multiple Disbursals", "Enable Multiple Disbursals": "Enable Multiple Disbursals",
"Allow full term for each tranche": "Allow full term for each tranche", "Allow full term for each tranche": "Allow full term for each tranche",
"Enabled": "Enabled", "Enabled": "Enabled",
+1
View File
@@ -1597,6 +1597,7 @@
"Enable Auto Repayment for Down Payment": "Habilitar el pago automático para el pago inicial", "Enable Auto Repayment for Down Payment": "Habilitar el pago automático para el pago inicial",
"Enable Dormancy Tracking": "Habilitar seguimiento de inactividad", "Enable Dormancy Tracking": "Habilitar seguimiento de inactividad",
"Enable Down Payment": "Habilitar Pago inicial", "Enable Down Payment": "Habilitar Pago inicial",
"Enable Lock-in Period": "Habilitar período de bloqueo",
"Enable Multiple Disbursals": "Habilitar múltiples desembolsos", "Enable Multiple Disbursals": "Habilitar múltiples desembolsos",
"Enabled": "Activado", "Enabled": "Activado",
"End Date": "Fecha final", "End Date": "Fecha final",
+1
View File
@@ -1597,6 +1597,7 @@
"Enable Auto Repayment for Down Payment": "Habilitar el pago automático para el pago inicial", "Enable Auto Repayment for Down Payment": "Habilitar el pago automático para el pago inicial",
"Enable Dormancy Tracking": "Habilitar seguimiento de inactividad", "Enable Dormancy Tracking": "Habilitar seguimiento de inactividad",
"Enable Down Payment": "Habilitar Pago inicial", "Enable Down Payment": "Habilitar Pago inicial",
"Enable Lock-in Period": "Habilitar período de bloqueo",
"Enable Multiple Disbursals": "Habilitar múltiples desembolsos", "Enable Multiple Disbursals": "Habilitar múltiples desembolsos",
"Enabled": "Activado", "Enabled": "Activado",
"End Date": "Fecha final", "End Date": "Fecha final",
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "Activer le remboursement automatique pour l'acompte", "Enable Auto Repayment for Down Payment": "Activer le remboursement automatique pour l'acompte",
"Enable Dormancy Tracking": "Activer le suivi de la dormance", "Enable Dormancy Tracking": "Activer le suivi de la dormance",
"Enable Down Payment": "Activer l'acompte", "Enable Down Payment": "Activer l'acompte",
"Enable Lock-in Period": "Activer la période de blocage",
"Enable Multiple Disbursals": "Activer les décaissements multiples", "Enable Multiple Disbursals": "Activer les décaissements multiples",
"Enabled": "Activé", "Enabled": "Activé",
"End Date": "Date de fin", "End Date": "Date de fin",
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "Abilita il rimborso automatico per l'acconto", "Enable Auto Repayment for Down Payment": "Abilita il rimborso automatico per l'acconto",
"Enable Dormancy Tracking": "Abilita il monitoraggio della dormienza", "Enable Dormancy Tracking": "Abilita il monitoraggio della dormienza",
"Enable Down Payment": "Abilita l'acconto", "Enable Down Payment": "Abilita l'acconto",
"Enable Lock-in Period": "Abilita periodo di blocco",
"Enable Multiple Disbursals": "Abilita esborsi multipli", "Enable Multiple Disbursals": "Abilita esborsi multipli",
"Enabled": "Abilitato", "Enabled": "Abilitato",
"End Date": "Data di fine", "End Date": "Data di fine",
+1
View File
@@ -1599,6 +1599,7 @@
"Enable Auto Repayment for Down Payment": "계약금 자동 상환 활성화", "Enable Auto Repayment for Down Payment": "계약금 자동 상환 활성화",
"Enable Dormancy Tracking": "휴면 추적 활성화", "Enable Dormancy Tracking": "휴면 추적 활성화",
"Enable Down Payment": "계약금 활성화", "Enable Down Payment": "계약금 활성화",
"Enable Lock-in Period": "잠금 기간 활성화",
"Enable Multiple Disbursals": "다중 지불 활성화", "Enable Multiple Disbursals": "다중 지불 활성화",
"Enabled": "활성화됨", "Enabled": "활성화됨",
"End Date": "종료일", "End Date": "종료일",
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "Įgalinti automatinį pradinio įnašo grąžinimą", "Enable Auto Repayment for Down Payment": "Įgalinti automatinį pradinio įnašo grąžinimą",
"Enable Dormancy Tracking": "Įgalinti ramybės būsenos stebėjimą", "Enable Dormancy Tracking": "Įgalinti ramybės būsenos stebėjimą",
"Enable Down Payment": "Įgalinti pradinį įnašą", "Enable Down Payment": "Įgalinti pradinį įnašą",
"Enable Lock-in Period": "Įgalinti užrakinimo laikotarpį",
"Enable Multiple Disbursals": "Įgalinti kelias išmokas", "Enable Multiple Disbursals": "Įgalinti kelias išmokas",
"Enabled": "Įjungtas", "Enabled": "Įjungtas",
"End Date": "Pabaigos data", "End Date": "Pabaigos data",
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "Iespējot pirmās iemaksas automātisko atmaksu", "Enable Auto Repayment for Down Payment": "Iespējot pirmās iemaksas automātisko atmaksu",
"Enable Dormancy Tracking": "Iespējot miega režīma izsekošanu", "Enable Dormancy Tracking": "Iespējot miega režīma izsekošanu",
"Enable Down Payment": "Iespējot pirmo iemaksu", "Enable Down Payment": "Iespējot pirmo iemaksu",
"Enable Lock-in Period": "Iespējot bloķēšanas periodu",
"Enable Multiple Disbursals": "Iespējot vairākas izmaksas", "Enable Multiple Disbursals": "Iespējot vairākas izmaksas",
"Enabled": "Iespējots", "Enabled": "Iespējots",
"End Date": "Beigu datums", "End Date": "Beigu datums",
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "डाउन पेमेन्टको लागि स्वत: भुक्तानी सक्षम गर्नुहोस्", "Enable Auto Repayment for Down Payment": "डाउन पेमेन्टको लागि स्वत: भुक्तानी सक्षम गर्नुहोस्",
"Enable Dormancy Tracking": "निष्क्रियता ट्र्याकिङ सक्षम गर्नुहोस्", "Enable Dormancy Tracking": "निष्क्रियता ट्र्याकिङ सक्षम गर्नुहोस्",
"Enable Down Payment": "डाउन पेमेन्ट सक्षम गर्नुहोस्", "Enable Down Payment": "डाउन पेमेन्ट सक्षम गर्नुहोस्",
"Enable Lock-in Period": "लक-इन अवधि सक्षम गर्नुहोस्",
"Enable Multiple Disbursals": "बहुविध वितरण सक्षम गर्नुहोस्", "Enable Multiple Disbursals": "बहुविध वितरण सक्षम गर्नुहोस्",
"Enabled": "सक्षम गरियो", "Enabled": "सक्षम गरियो",
"End Date": "अन्त्य मिति", "End Date": "अन्त्य मिति",
+1
View File
@@ -1598,6 +1598,7 @@
"Enable Auto Repayment for Down Payment": "Ativar reembolso automático para adiantamento", "Enable Auto Repayment for Down Payment": "Ativar reembolso automático para adiantamento",
"Enable Dormancy Tracking": "Habilitar rastreamento de dormência", "Enable Dormancy Tracking": "Habilitar rastreamento de dormência",
"Enable Down Payment": "Ativar adiantamento", "Enable Down Payment": "Ativar adiantamento",
"Enable Lock-in Period": "Ativar período de bloqueio",
"Enable Multiple Disbursals": "Habilitar múltiplos desembolsos", "Enable Multiple Disbursals": "Habilitar múltiplos desembolsos",
"Enabled": "Habilitado", "Enabled": "Habilitado",
"End Date": "Data final", "End Date": "Data final",
+1
View File
@@ -1596,6 +1596,7 @@
"Enable Auto Repayment for Down Payment": "Washa Ulipaji Kiotomatiki kwa Malipo ya Chini", "Enable Auto Repayment for Down Payment": "Washa Ulipaji Kiotomatiki kwa Malipo ya Chini",
"Enable Dormancy Tracking": "Washa Ufuatiliaji wa Malalamiko", "Enable Dormancy Tracking": "Washa Ufuatiliaji wa Malalamiko",
"Enable Down Payment": "Washa Malipo ya Chini", "Enable Down Payment": "Washa Malipo ya Chini",
"Enable Lock-in Period": "Washa Kipindi cha Kufunga",
"Enable Multiple Disbursals": "Washa Utoaji Nyingi", "Enable Multiple Disbursals": "Washa Utoaji Nyingi",
"Enabled": "Imewashwa", "Enabled": "Imewashwa",
"End Date": "Tarehe ya mwisho", "End Date": "Tarehe ya mwisho",