Added Charges cap
This commit is contained in:
@@ -147,6 +147,16 @@
|
|||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field fxFlex="48%">
|
||||||
|
<mat-label>Minimum Charge Cap</mat-label>
|
||||||
|
<input matInput formControlName="minCap">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field fxFlex="48%">
|
||||||
|
<mat-label>Maximum Charge Cap</mat-label>
|
||||||
|
<input matInput formControlName="maxCap">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
<div fxFlex="48%" fxLayout="row" fxLayoutGap="2%" fxLayout.lt-md="column">
|
<div fxFlex="48%" fxLayout="row" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||||
<div fxFlex="50%" class="active-wrapper">
|
<div fxFlex="50%" class="active-wrapper">
|
||||||
<mat-checkbox labelPosition="before" formControlName="active">
|
<mat-checkbox labelPosition="before" formControlName="active">
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ export class CreateChargeComponent implements OnInit {
|
|||||||
'amount': ['', [Validators.required, Validators.pattern('^\\s*(?=.*[1-9])\\d*(?:\\.\\d+)?\\s*$')]],
|
'amount': ['', [Validators.required, Validators.pattern('^\\s*(?=.*[1-9])\\d*(?:\\.\\d+)?\\s*$')]],
|
||||||
'active': [false],
|
'active': [false],
|
||||||
'penalty': [false],
|
'penalty': [false],
|
||||||
'taxGroupId': ['']
|
'taxGroupId': [''],
|
||||||
|
'minCap': [''],
|
||||||
|
'maxCap': ['']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +227,12 @@ export class CreateChargeComponent implements OnInit {
|
|||||||
if (!charge.taxGroupId) {
|
if (!charge.taxGroupId) {
|
||||||
delete charge.taxGroupId;
|
delete charge.taxGroupId;
|
||||||
}
|
}
|
||||||
|
if (!charge.minCap) {
|
||||||
|
delete charge.minCap;
|
||||||
|
}
|
||||||
|
if (!charge.maxCap) {
|
||||||
|
delete charge.maxCap;
|
||||||
|
}
|
||||||
this.productsService.createCharge(charge).subscribe((response: any) => {
|
this.productsService.createCharge(charge).subscribe((response: any) => {
|
||||||
this.router.navigate(['../'], { relativeTo: this.route });
|
this.router.navigate(['../'], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user