Skip to content
Permalink
Browse files
Merge pull request #50 from ndelvos78/DepositAndLoanTermValidation
Deposit and loan term validation, custom field length and precision validation
  • Loading branch information
markvanveen committed Oct 26, 2017
2 parents 87593c0 + 5789865 commit 7bd3278d58a58898fa3cbcd9dc49a9fab2d10f1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
@@ -34,8 +34,8 @@ export class FieldFormService {
hint: ['', [Validators.maxLength(512)]],
description: ['', [Validators.maxLength(4096)]],
mandatory: [''],
length: ['', [FimsValidators.minValue(1)]],
precision: ['', [FimsValidators.minValue(0)]],
length: ['', [FimsValidators.minValue(1), FimsValidators.maxScale(0)]],
precision: ['', [FimsValidators.minValue(0), FimsValidators.maxScale(0)]],
minValue: ['', [FimsValidators.minValue(0)]],
maxValue: ['', [FimsValidators.minValue(1)]],
options: this.formBuilder.array([], optionValueUnique)
@@ -137,7 +137,7 @@ export class DepositProductFormComponent implements OnInit, OnDestroy, OnChanges
const termTimeUnitControl: FormControl = this.formGroup.get('termTimeUnit') as FormControl;

if (enabled) {
this.enable(termPeriodControl, [Validators.required, FimsValidators.minValue(1)]);
this.enable(termPeriodControl, [Validators.required, FimsValidators.minValue(1), FimsValidators.maxScale(0)]);
this.enable(termTimeUnitControl, [Validators.required]);
} else {
this.disable(termPeriodControl);
@@ -63,7 +63,7 @@ export class ProductDetailFormComponent extends FormComponent<DetailFormData> im
currencyCode: ['', [Validators.required]],
minimumBalance: ['', [Validators.required, FimsValidators.minValue(0)]],
maximumBalance: ['', [Validators.required, FimsValidators.minValue(0)]],
term: ['', [ Validators.required, FimsValidators.minValue(0) ]],
term: ['', [ Validators.required, FimsValidators.minValue(1), FimsValidators.maxScale(0)]],
temporalUnit: ['', Validators.required]
}, { validator: FimsValidators.greaterThanEquals('minimumBalance', 'maximumBalance') });
}

0 comments on commit 7bd3278

Please sign in to comment.