WEB-685 Fix default values for due overdue days repayment event fields in loan product creation#3116
Conversation
|
Note
|
| 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
- WEB-569 Negative values allowed for repayment event days in loan product creation form #2984: Modifies the same loan-product-settings-step repayment day fields (validation and input constraints), closely related to this patching logic change.
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:
useDueForRepaymentsConfigurationsis already patched from the template at line 161, which can trigger thevalueChangessubscription (lines 662–676) and set the day fields to global-config values ornullbefore this block runs and overwrites them again. It works because the laterpatchValuewins, but consider removinguseDueForRepaymentsConfigurationsfrom 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
alberto-art3ch
left a comment
There was a problem hiding this comment.
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
…s in loan product creation
51b68ea to
7bd4090
Compare
|
@alberto-art3ch I have updated the PR please review |
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 :-
After :-
Summary by CodeRabbit