WEB-772 Prevent negative values in savings product settings fields (#3206)
This commit is contained in:
+12
@@ -180,6 +180,8 @@
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Sets the overdraft required for interest calculation' | translate }}"
|
||||
formControlName="minOverdraftForInterestCalculation"
|
||||
min="0"
|
||||
step="0.01"
|
||||
/>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-31">
|
||||
@@ -189,6 +191,8 @@
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Default interest rate on overdraft' | translate }}"
|
||||
formControlName="nominalAnnualInterestRateOverdraft"
|
||||
min="0"
|
||||
step="0.01"
|
||||
/>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-31">
|
||||
@@ -198,6 +202,8 @@
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Sets the maximum allowed overdraft amount' | translate }}"
|
||||
formControlName="overdraftLimit"
|
||||
min="0"
|
||||
step="0.01"
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
@@ -225,6 +231,8 @@
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Inactive period to mark an account as Inactive' | translate }}"
|
||||
formControlName="daysToInactive"
|
||||
min="0"
|
||||
step="1"
|
||||
required
|
||||
/>
|
||||
<mat-error>
|
||||
@@ -240,6 +248,8 @@
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Inactive period to mark an account as Dormant' | translate }}"
|
||||
formControlName="daysToDormancy"
|
||||
min="0"
|
||||
step="1"
|
||||
required
|
||||
/>
|
||||
<mat-error>
|
||||
@@ -254,6 +264,8 @@
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Inactive period to mark an account as Escheat' | translate }}"
|
||||
formControlName="daysToEscheat"
|
||||
min="0"
|
||||
step="1"
|
||||
required
|
||||
/>
|
||||
<mat-error>
|
||||
|
||||
+30
-6
@@ -132,9 +132,15 @@ export class SavingProductSettingsStepComponent implements OnInit {
|
||||
|
||||
this.savingProductSettingsForm.get('allowOverdraft').valueChanges.subscribe((allowOverdraft: any) => {
|
||||
if (allowOverdraft) {
|
||||
this.savingProductSettingsForm.addControl('minOverdraftForInterestCalculation', new UntypedFormControl(''));
|
||||
this.savingProductSettingsForm.addControl('nominalAnnualInterestRateOverdraft', new UntypedFormControl(''));
|
||||
this.savingProductSettingsForm.addControl('overdraftLimit', new UntypedFormControl(''));
|
||||
this.savingProductSettingsForm.addControl(
|
||||
'minOverdraftForInterestCalculation',
|
||||
new UntypedFormControl('', [Validators.min(0)])
|
||||
);
|
||||
this.savingProductSettingsForm.addControl(
|
||||
'nominalAnnualInterestRateOverdraft',
|
||||
new UntypedFormControl('', [Validators.min(0)])
|
||||
);
|
||||
this.savingProductSettingsForm.addControl('overdraftLimit', new UntypedFormControl('', [Validators.min(0)]));
|
||||
} else {
|
||||
this.savingProductSettingsForm.removeControl('minOverdraftForInterestCalculation');
|
||||
this.savingProductSettingsForm.removeControl('nominalAnnualInterestRateOverdraft');
|
||||
@@ -154,9 +160,27 @@ export class SavingProductSettingsStepComponent implements OnInit {
|
||||
.get('isDormancyTrackingActive')
|
||||
.valueChanges.subscribe((isDormancyTrackingActive: any) => {
|
||||
if (isDormancyTrackingActive) {
|
||||
this.savingProductSettingsForm.addControl('daysToInactive', new UntypedFormControl('', Validators.required));
|
||||
this.savingProductSettingsForm.addControl('daysToDormancy', new UntypedFormControl('', Validators.required));
|
||||
this.savingProductSettingsForm.addControl('daysToEscheat', new UntypedFormControl('', Validators.required));
|
||||
this.savingProductSettingsForm.addControl(
|
||||
'daysToInactive',
|
||||
new UntypedFormControl('', [
|
||||
Validators.required,
|
||||
Validators.min(0)
|
||||
])
|
||||
);
|
||||
this.savingProductSettingsForm.addControl(
|
||||
'daysToDormancy',
|
||||
new UntypedFormControl('', [
|
||||
Validators.required,
|
||||
Validators.min(0)
|
||||
])
|
||||
);
|
||||
this.savingProductSettingsForm.addControl(
|
||||
'daysToEscheat',
|
||||
new UntypedFormControl('', [
|
||||
Validators.required,
|
||||
Validators.min(0)
|
||||
])
|
||||
);
|
||||
} else {
|
||||
this.savingProductSettingsForm.removeControl('daysToInactive');
|
||||
this.savingProductSettingsForm.removeControl('daysToDormancy');
|
||||
|
||||
Reference in New Issue
Block a user