Skip to content

WEB-685 Fix default values for due overdue days repayment event fields in loan product creation#3116

Open
JaySoni1 wants to merge 1 commit intoopenMF:devfrom
JaySoni1:WEB-685-fix-default-values-for-due-overdue-days-repayment-event-fields-in-loan-product-creation
Open

WEB-685 Fix default values for due overdue days repayment event fields in loan product creation#3116
JaySoni1 wants to merge 1 commit intoopenMF:devfrom
JaySoni1:WEB-685-fix-default-values-for-due-overdue-days-repayment-event-fields-in-loan-product-creation

Conversation

@JaySoni1
Copy link
Contributor

@JaySoni1 JaySoni1 commented Feb 9, 2026

Changes Made :-

-Changed default values for [dueDaysForRepaymentEvent and [overDueDaysForRepaymentEvent] fields from inheriting global configuration value to empty string, allowing users to enter their own values when creating new loan products while preserving existing values when editing.

WEB-685

Before :-

image

After :-

image

Summary by CodeRabbit

  • Bug Fixes
    • Fixed repayment configuration handling so editing preserves repayment event fields only when both day values are present; otherwise configuration is enabled and fields are cleared.
    • When creating/new entries, repayment configuration is disabled and repayment day fields are reset to empty values.
    • Replaced nulls with empty values for non-edit flows to improve consistency.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 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

When editing, repayment-event day fields are patched only if both dueDaysForRepaymentEvent and overDueDaysForRepaymentEvent are non-null; otherwise useDueForRepaymentsConfigurations is enabled and the day fields are cleared to empty strings. In non-edit mode, useDueForRepaymentsConfigurations is set to false and the day fields are cleared to empty strings.

Changes

Cohort / File(s) Summary
Repayment Event Configuration Logic
src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts
Adjust conditional patching: in edit mode only apply repayment day fields when both values exist; otherwise enable useDueForRepaymentsConfigurations and clear day fields to "". In non-edit mode set useDueForRepaymentsConfigurations to false and clear day fields to "" (replacing previous null).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 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 directly describes the main change: fixing default values for due/overdue days repayment event fields in loan product creation, which aligns with the code changes that modify how these fields are initialized.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts (1)

172-195: The create-mode and edit-mode branching logic looks correct for the stated goal.

The conditional handling properly preserves existing values when editing and defaults to empty strings for new products.

One subtle point: useDueForRepaymentsConfigurations is already patched from the template at line 161, which can trigger the valueChanges subscription (lines 662–676) and set the day fields to global-config values or null before this block runs and overwrites them again. It works because the later patchValue wins, but consider removing useDueForRepaymentsConfigurations from the initial patch at line 161 (since it is unconditionally overridden here) to avoid the intermediate subscription side-effect and make the intent clearer.

♻️ Remove redundant initial patch
     loanProductSettingsForm.patchValue({
       ...
-      useDueForRepaymentsConfigurations: this.loanProductsTemplate.useDueForRepaymentsConfigurations,
       allowAccrualPostingInArrears: this.loanProductsTemplate.allowAccrualPostingInArrears,
       ...
     });

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
Collaborator

@alberto-art3ch alberto-art3ch left a comment

Choose a reason for hiding this comment

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

Could we review this requiremente? Because those two product parameters by default will came from Global Configuration variables (useDueForRepaymentsConfigurations = true)

The users (If they want) can to override them, but by default the initial values must be from the configurations

@JaySoni1 JaySoni1 force-pushed the WEB-685-fix-default-values-for-due-overdue-days-repayment-event-fields-in-loan-product-creation branch from 51b68ea to 7bd4090 Compare February 11, 2026 18:01
@JaySoni1
Copy link
Contributor Author

@alberto-art3ch I have updated the PR please review

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