Skip to content

WEB-632 Set installment in multiples of and decimal places fields to empty by default in loan product form#3053

Merged
IOhacker merged 1 commit intoopenMF:devfrom
JaySoni1:WEB-632-set-installment-in-multiples-of-and-decimal-places-fields-to-empty-by-default-in-loan-product-form
Jan 28, 2026
Merged

WEB-632 Set installment in multiples of and decimal places fields to empty by default in loan product form#3053
IOhacker merged 1 commit intoopenMF:devfrom
JaySoni1:WEB-632-set-installment-in-multiples-of-and-decimal-places-fields-to-empty-by-default-in-loan-product-form

Conversation

@JaySoni1
Copy link
Copy Markdown
Contributor

@JaySoni1 JaySoni1 commented Jan 27, 2026

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 :-
image

After :-
image

Summary by CodeRabbit

  • Bug Fixes
    • Form defaults in the currency configuration step now use empty placeholders for decimal precision and multiple-based fields (including installment amounts) instead of numeric defaults.
    • Initialization and update logic preserved currency selection behavior while aligning field defaults with validation and UX expectations.

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

@JaySoni1 JaySoni1 marked this pull request as ready for review January 27, 2026 21:11
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 27, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Defaults for three currency-related loan product form fields were changed: digitsAfterDecimal, inMultiplesOf, and installmentAmountInMultiplesOf now use empty-string defaults during form creation and patching; digitsAfterDecimal maps decimalPlaces 0/undefined/null to '' while preserving existing currencyCode logic.

Changes

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

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JaySoni1 JaySoni1 force-pushed the WEB-632-set-installment-in-multiples-of-and-decimal-places-fields-to-empty-by-default-in-loan-product-form branch from 9a230b7 to 4e4b4c7 Compare January 27, 2026 21:39
Copy link
Copy Markdown
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JaySoni1 JaySoni1 force-pushed the WEB-632-set-installment-in-multiples-of-and-decimal-places-fields-to-empty-by-default-in-loan-product-form branch from 4e4b4c7 to 3dd7e79 Compare January 28, 2026 13:32
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IOhacker IOhacker merged commit 30a143f into openMF:dev Jan 28, 2026
5 checks passed
@JaySoni1
Copy link
Copy Markdown
Contributor Author

@IOhacker Thank You for the review

parth-sharma-10 pushed a commit to parth-sharma-10/web-app that referenced this pull request Feb 17, 2026
parth-sharma-10 pushed a commit to parth-sharma-10/web-app that referenced this pull request Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants