Skip to content

WEB-1005: Loan account creation fix when change loan product#3661

Merged
alberto-art3ch merged 1 commit into
openMF:devfrom
alberto-art3ch:WEB-1005/loan-account-creation-got-broken-with-change-of-loan-product
Jun 16, 2026
Merged

WEB-1005: Loan account creation fix when change loan product#3661
alberto-art3ch merged 1 commit into
openMF:devfrom
alberto-art3ch:WEB-1005/loan-account-creation-got-broken-with-change-of-loan-product

Conversation

@alberto-art3ch

@alberto-art3ch alberto-art3ch commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

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

  • Bug Fixes
    • Fixed loan preview to correctly display delinquency start type and repayment frequency values from selected options.
    • Improved loan product selection to properly clear related data when switching product types.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

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

The setProductType handler in create-loans-account.component.ts now resets loansAccountProductTemplate and productId and calls detectChanges(). The preview step component adds typed option fields for repaymentFrequencyType and delinquencyStartType, resolved via new helper methods in ngOnChanges, with the template updated to render those option-backed values.

Changes

Loan Account Creation and Preview Fix

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between d981cec and f56575c.

📒 Files selected for processing (3)
  • src/app/loans/create-loans-account/create-loans-account.component.ts
  • src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.html
  • src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts

@adamsaghy adamsaghy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@alberto-art3ch alberto-art3ch merged commit e34cc9a into openMF:dev Jun 16, 2026
5 checks passed
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