Skip to content

Commit 35b428f

Browse files
Merge pull request #3458 from alberto-art3ch/WEB-711/wc-product-discount-attribute
WEB-711: WC Product with discount attribute
2 parents 4b9b2d4 + f506417 commit 35b428f

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ <h3 class="mat-h3 flex-fill">{{ 'labels.heading.Terms' | translate }}</h3>
103103
}})
104104
</span>
105105
</div>
106+
<div class="flex-fill layout-row">
107+
<span class="flex-40">{{ 'labels.inputs.Discount' | translate }}:</span>
108+
<span class="flex-60">{{ loanProduct.discount | formatNumber }}</span>
109+
</div>
106110
}
107111
@if (loanProductService.isLoanProduct) {
108112
<div class="flex-fill layout-row">

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ <h4 class="mat-h4 flex-98">
148148
<strong>{{ loanProductTermsForm.get('maxPeriodPaymentRate')?.errors?.['min']?.min || 0.01 }}</strong>
149149
</mat-error>
150150
</mat-form-field>
151+
152+
<mat-form-field class="flex-31">
153+
<mat-label>{{ 'labels.inputs.Discount' | translate }}</mat-label>
154+
<input type="number" matInput formControlName="discount" [min]="0" step="0.01" />
155+
<mat-error *ngIf="loanProductTermsForm.get('discount')?.hasError('min')">
156+
{{ 'labels.commons.Minimum Value must be' | translate }}
157+
<strong>{{ loanProductTermsForm.get('discount')?.errors?.['min']?.min || 0 }}</strong>
158+
</mat-error>
159+
</mat-form-field>
160+
<mat-divider class="flex-98"></mat-divider>
151161
}
152162

153163
@if (loanProductService.isLoanProduct) {

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ export class LoanProductTermsStepComponent extends LoanProductBaseComponent impl
203203
repaymentEvery: this.loanProductsTemplate.repaymentEvery,
204204
repaymentFrequencyType: this.loanProductsTemplate.repaymentFrequencyType
205205
? this.loanProductsTemplate.repaymentFrequencyType.id
206-
: null
206+
: null,
207+
discount: this.loanProductsTemplate.discount
207208
});
208209
}
209210
}
@@ -349,6 +350,12 @@ export class LoanProductTermsStepComponent extends LoanProductBaseComponent impl
349350
repaymentFrequencyType: [
350351
'',
351352
Validators.required
353+
],
354+
discount: [
355+
'',
356+
[
357+
Validators.min(0)
358+
]
352359
]
353360
});
354361
}

0 commit comments

Comments
 (0)