WEB-632 Set installment in multiples of and decimal places fields to empty by default in loan product form#3053
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Loan Product Currency Step Form Defaults src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.ts |
Adjusted default handling and initialization: digitsAfterDecimal becomes '' when decimalPlaces is 0/undefined/null; inMultiplesOf and installmentAmountInMultiplesOf default to '' (previously 1); updated patchValue and createLoanProductCurrencyForm assignments accordingly while retaining currencyCode logic. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
- WEB-566 Validation missing negative values accepted in currency in multiples of installment in multiples of and decimal places fields #2981 — Modifies the same form controls (
digitsAfterDecimal,inMultiplesOf,installmentAmountInMultiplesOf) with related changes to defaults and validators.
Suggested reviewers
- IOhacker
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and specifically describes the main change: setting form fields to empty by default in the loan product form. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.ts`:
- Around line 43-48: The patchValue call on loanProductCurrencyForm uses ||
which treats 0 as falsy; update the assignment expressions in
loanProductCurrencyForm.patchValue to use nullish coalescing (??) so valid zero
values are preserved: replace uses of
this.loanProductsTemplate.currency.decimalPlaces || '' with
this.loanProductsTemplate.currency.decimalPlaces ?? '', and similarly change
this.loanProductsTemplate.currency.inMultiplesOf || '' and
this.loanProductsTemplate.installmentAmountInMultiplesOf || '' to use ?? so only
null/undefined fall back to the default; keep currency.code logic as-is unless a
0 code is expected.
9a230b7 to
4e4b4c7
Compare
…Empty by Default in Loan Product Form
4e4b4c7 to
3dd7e79
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.ts`:
- Around line 45-50: The digitsAfterDecimal assignment wrongly treats
decimalPlaces === 0 as empty string; update the logic in the
loan-product-currency-step component so digitsAfterDecimal uses the actual value
when decimalPlaces is 0 and only defaults when decimalPlaces is null or
undefined (e.g., use nullish check on
loanProductsTemplate.currency.decimalPlaces or the ?? operator) so existing
products with decimalPlaces = 0 render correctly and remain compatible with
Validators.min(0).
|
@IOhacker Thank You for the review |
…Empty by Default in Loan Product Form (openMF#3053)
…Empty by Default in Loan Product Form (openMF#3053)
Changes Made :-
-Set the "Installment in multiples of" and "Decimal Places" fields in the Loan Product form to be empty by default.
WEB-631
Before :-

After :-

Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.