WEB-566 Validation Missing: Negative Values Accepted in Currency in multiples of ,Installment in multiples of and Decimal Places Fields (#2981)
This commit is contained in:
+25
-2
@@ -31,30 +31,53 @@
|
||||
<mat-label>{{ 'labels.inputs.Decimal Places' | translate }}</mat-label>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
matTooltip="{{ 'tooltips.Number of decimal places to be used to track and report' | translate }}"
|
||||
matInput
|
||||
formControlName="digitsAfterDecimal"
|
||||
required
|
||||
/>
|
||||
<mat-error>
|
||||
<mat-error *ngIf="loanProductCurrencyForm.get('digitsAfterDecimal')?.hasError('required')">
|
||||
{{ 'labels.inputs.Decimal Places' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="loanProductCurrencyForm.get('digitsAfterDecimal')?.hasError('min')">
|
||||
{{ 'labels.inputs.Decimal Places' | translate }} {{ 'labels.commons.Minimum Value must be' | translate }}
|
||||
<strong>0</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Currency in multiples of' | translate }}</mat-label>
|
||||
<input
|
||||
type="number"
|
||||
min="1"
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Enter multiples of currency value' | translate }}"
|
||||
formControlName="inMultiplesOf"
|
||||
required
|
||||
/>
|
||||
<mat-error *ngIf="loanProductCurrencyForm.get('inMultiplesOf')?.hasError('required')">
|
||||
{{ 'labels.inputs.Currency in multiples of' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="loanProductCurrencyForm.get('inMultiplesOf')?.hasError('min')">
|
||||
{{ 'labels.inputs.Currency in multiples of' | translate }}
|
||||
{{ 'labels.commons.Minimum Value must be' | translate }} <strong>1</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Installment in multiples of' | translate }}</mat-label>
|
||||
<input type="number" matInput formControlName="installmentAmountInMultiplesOf" />
|
||||
<input type="number" min="1" matInput formControlName="installmentAmountInMultiplesOf" required />
|
||||
<mat-error *ngIf="loanProductCurrencyForm.get('installmentAmountInMultiplesOf')?.hasError('required')">
|
||||
{{ 'labels.inputs.Installment in multiples of' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="loanProductCurrencyForm.get('installmentAmountInMultiplesOf')?.hasError('min')">
|
||||
{{ 'labels.inputs.Installment in multiples of' | translate }}
|
||||
{{ 'labels.commons.Minimum Value must be' | translate }} <strong>1</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
+20
-5
@@ -45,8 +45,8 @@ export class LoanProductCurrencyStepComponent implements OnInit {
|
||||
digitsAfterDecimal: this.loanProductsTemplate.currency.decimalPlaces
|
||||
? this.loanProductsTemplate.currency.decimalPlaces
|
||||
: 2,
|
||||
inMultiplesOf: this.loanProductsTemplate.currency.inMultiplesOf,
|
||||
installmentAmountInMultiplesOf: this.loanProductsTemplate.installmentAmountInMultiplesOf
|
||||
inMultiplesOf: this.loanProductsTemplate.currency.inMultiplesOf ?? 1,
|
||||
installmentAmountInMultiplesOf: this.loanProductsTemplate.installmentAmountInMultiplesOf ?? 1
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,10 +58,25 @@ export class LoanProductCurrencyStepComponent implements OnInit {
|
||||
],
|
||||
digitsAfterDecimal: [
|
||||
2,
|
||||
Validators.required
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(0)
|
||||
]
|
||||
],
|
||||
inMultiplesOf: '',
|
||||
installmentAmountInMultiplesOf: ''
|
||||
inMultiplesOf: [
|
||||
1,
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(1)
|
||||
]
|
||||
],
|
||||
installmentAmountInMultiplesOf: [
|
||||
'',
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(1)
|
||||
]
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user