WEB-684 Allow negative values in Fund Mapping

This commit is contained in:
JaySoni1
2026-02-10 01:38:37 +05:30
parent f7e936aa30
commit ca81e0d09f
2 changed files with 39 additions and 6 deletions
@@ -132,6 +132,7 @@
type="number"
matInput
required
min="0"
formControlName="minOutStandingAmountPercentage"
placeholder="{{ 'labels.inputs.Minimum Value' | translate }}"
/>
@@ -150,6 +151,7 @@
type="number"
matInput
required
min="0"
formControlName="outStandingAmountPercentage"
placeholder="{{ 'labels.inputs.Comparison Value' | translate }}"
/>
@@ -168,6 +170,7 @@
type="number"
matInput
required
min="0"
formControlName="maxOutStandingAmountPercentage"
placeholder="{{ 'labels.inputs.Maximum Value' | translate }}"
/>
@@ -213,6 +216,7 @@
type="number"
matInput
required
min="0"
formControlName="minOutstandingAmount"
placeholder="{{ 'labels.inputs.Minimum Value' | translate }}"
/>
@@ -231,6 +235,7 @@
type="number"
matInput
required
min="0"
formControlName="outstandingAmount"
placeholder="{{ 'labels.inputs.Comparison Value' | translate }}"
/>
@@ -249,6 +254,7 @@
type="number"
matInput
required
min="0"
formControlName="maxOutstandingAmount"
placeholder="{{ 'labels.inputs.Maximum Value' | translate }}"
/>
@@ -186,17 +186,26 @@ export class FundMappingComponent implements OnInit {
if (_value === 'between') {
this.fundMappingForm.addControl(
'minOutStandingAmountPercentage',
new UntypedFormControl('', Validators.required)
new UntypedFormControl('', [
Validators.required,
Validators.min(0)
])
);
this.fundMappingForm.addControl(
'maxOutStandingAmountPercentage',
new UntypedFormControl('', Validators.required)
new UntypedFormControl('', [
Validators.required,
Validators.min(0)
])
);
this.fundMappingForm.removeControl('outStandingAmountPercentage');
} else {
this.fundMappingForm.addControl(
'outStandingAmountPercentage',
new UntypedFormControl('', Validators.required)
new UntypedFormControl('', [
Validators.required,
Validators.min(0)
])
);
this.fundMappingForm.removeControl('minOutStandingAmountPercentage');
this.fundMappingForm.removeControl('maxOutStandingAmountPercentage');
@@ -216,11 +225,29 @@ export class FundMappingComponent implements OnInit {
this.fundMappingForm.addControl('outstandingAmountCondition', new UntypedFormControl('', Validators.required));
this.fundMappingForm.get('outstandingAmountCondition').valueChanges.subscribe((_value: string) => {
if (_value === 'between') {
this.fundMappingForm.addControl('minOutstandingAmount', new UntypedFormControl('', Validators.required));
this.fundMappingForm.addControl('maxOutstandingAmount', new UntypedFormControl('', Validators.required));
this.fundMappingForm.addControl(
'minOutstandingAmount',
new UntypedFormControl('', [
Validators.required,
Validators.min(0)
])
);
this.fundMappingForm.addControl(
'maxOutstandingAmount',
new UntypedFormControl('', [
Validators.required,
Validators.min(0)
])
);
this.fundMappingForm.removeControl('outstandingAmount');
} else {
this.fundMappingForm.addControl('outstandingAmount', new UntypedFormControl('', Validators.required));
this.fundMappingForm.addControl(
'outstandingAmount',
new UntypedFormControl('', [
Validators.required,
Validators.min(0)
])
);
this.fundMappingForm.removeControl('minOutstandingAmount');
this.fundMappingForm.removeControl('maxOutstandingAmount');
}