WEB-1005: Loan account creation fix when change loan product#3661
Conversation
|
Note
|
| Layer / File(s) | Summary |
|---|---|
Clear product template on product type change src/app/loans/create-loans-account/create-loans-account.component.ts |
setProductType resets loansAccountProductTemplate and productId then calls cdr.detectChanges() after the product type is initialized. |
Preview step option-backed field resolution and template rendering src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts, src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.html |
Imports OptionData and StringEnumOptionData, adds repaymentFrequencyTypeOption and delinquencyStartTypeOption fields, extends ngOnChanges with a missing-product guard and working-capital option lookups, adds helper methods to map IDs/codes to typed option shapes, hardens camalize to accept unknown, and switches the template to render both display values from the new option fields. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly identifies a specific bug fix related to loan account creation when the loan product is changed, which aligns with the PR's core objective of handling product changes correctly. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
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
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts`:
- Around line 136-138: In the loans-account-preview-step component's ngOnChanges
method, the early return statement when loansAccountProductTemplate.product is
falsy does not clear the repaymentFrequencyTypeOption and
delinquencyStartTypeOption properties before returning. Reset these derived
preview options to null or empty state before the return statement to prevent
stale UI data from displaying when the product switches and the template is
being resolved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6d487b5c-81cf-49d9-a3fe-e39bdd7f448e
📒 Files selected for processing (3)
src/app/loans/create-loans-account/create-loans-account.component.tssrc/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.htmlsrc/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts
Description
Fix in the Loan account creation when the user select a Loan Product, then set some values and then change the Loan Product, even with a different Product Type
Related issues and discussion
#{Issue Number}
WEB-1005
Screenshots
Uploading Screen Recording 2026-06-15 at 9.34.51 PM.mov…
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit
Release Notes