Skip to content

Commit 9b07218

Browse files
Merge pull request #2859 from JaySoni1/WEB-454-nominal-annual-interest-field-allows-zero-and-negative-values-in-saving-product-creation-form
WEB-454 Nominal annual interest field allows zero and negative values in saving product creation form
2 parents 733dad6 + d933827 commit 9b07218

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
matTooltip="{{ 'tooltips.The default interest rate set' | translate }}"
99
formControlName="nominalAnnualInterestRate"
1010
required
11+
min="0"
12+
step="0.01"
1113
/>
12-
<mat-error>
14+
<mat-error *ngIf="savingProductTermsForm.get('nominalAnnualInterestRate').hasError('required')">
1315
{{ 'labels.inputs.Nominal Annual Interest' | translate }} {{ 'labels.commons.is' | translate }}
1416
<strong>{{ 'labels.commons.required' | translate }}</strong>
1517
</mat-error>
18+
<mat-error *ngIf="savingProductTermsForm.get('nominalAnnualInterestRate').hasError('min')">
19+
{{ 'labels.inputs.Nominal Annual Interest' | translate }} must be zero or greater
20+
</mat-error>
1621
</mat-form-field>
1722

1823
<span class="flex-48 hide-lt-md"></span>

src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export class SavingProductTermsStepComponent implements OnInit {
5252
this.savingProductTermsForm = this.formBuilder.group({
5353
nominalAnnualInterestRate: [
5454
'',
55-
Validators.required
55+
[
56+
Validators.required,
57+
Validators.min(0)]
5658
],
5759
interestCompoundingPeriodType: [
5860
'',

0 commit comments

Comments
 (0)