WEB-462 Lock-in Period Field Allows Zero and Negative Values in Save Product Creation Form (#2888)

This commit is contained in:
Soni Jay
2025-12-15 10:48:50 -06:00
committed by GitHub
parent bc40094342
commit e9376f6305
2 changed files with 21 additions and 1 deletions
@@ -19,7 +19,20 @@
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">
@@ -72,7 +72,14 @@ export class SavingProductSettingsStepComponent implements OnInit {
createSavingProductSettingsForm() {
this.savingProductSettingsForm = this.formBuilder.group({
minRequiredOpeningBalance: [''],
lockinPeriodFrequency: [''],
lockinPeriodFrequency: [
'',
[
Validators.required,
Validators.min(1),
Validators.pattern('^[1-9]\\d*$')
]
],
lockinPeriodFrequencyType: [''],
withdrawalFeeForTransfers: [false],
minBalanceForInterestCalculation: [''],