WEB-707 Allowing Negative Values in Loan Product Numeric Fields#3398
WEB-707 Allowing Negative Values in Loan Product Numeric Fields#3398JaySoni1 wants to merge 1 commit intoopenMF:devfrom
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Loans Account Terms Step src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html, src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts |
Adds min="0" to the maxOutstandingLoanBalance number input and adds Validators.min(0) to the maxOutstandingLoanBalance form control in all initialization branches (keeps existing Validators.required where present). |
Loan Product Settings Step src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html, src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts |
Adds min="0" to several <input type="number"> fields and applies Validators.min(0) to dynamically added form controls: maxTrancheCount, outstandingLoanBalance, minimumGap, maximumGap, mandatoryGuarantee, minimumGuaranteeFromOwnFunds, and minimumGuaranteeFromGuarantor (preserves existing Validators.required where applicable). |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- WEB-569 Negative values allowed for repayment event days in loan product creation form #2984: Also adds
min="0"andValidators.min(0)to numeric fields in the loan-product-settings-step component. - WEB-568 Negative values allowed for arrears ageing overdue days for npa and principal threshold fields in loan product settings #2983: Modifies loan-product-settings-step to add non-negative constraints to related numeric controls.
- WEB-567 Negative Values Allowed in Loan Product Setting Fields #2982: Adds
Validators.min(0)andmin="0"constraints to other numeric fields in the LoanProductSettingsStepComponent.
Suggested reviewers
- IOhacker
- alberto-art3ch
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Title check | The PR title states 'Allowing Negative Values' but the actual changes prevent negative values by adding min(0) validators and min="0" HTML constraints. | Change the title to reflect the actual intent, such as 'WEB-707 Prevent Negative Values in Loan Product Numeric Fields' or 'WEB-707 Add min(0) Validation to Loan Product Numeric Fields'. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| 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 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.
alberto-art3ch
left a comment
There was a problem hiding this comment.
Please wait to release the updated Loan Account views
23e4f43 to
ed8c414
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html`:
- Around line 380-393: The template mistakenly injects the tranche-field block
inside the transactionProcessingStrategyCode <mat-select>, leaving unbalanced
tags and bypassing the multi-disbursal guards; move the entire tranche-related
fragment out of that <mat-select> and into the existing multi-disbursal section
guarded by multiDisburseLoan and isFullTermTrancheEditable() (the same area that
renders tranche controls around the existing maxOutstandingLoanBalance), remove
the duplicated tranche controls, and add min="0" to the existing <input
formControlName="maxOutstandingLoanBalance"> so the real control uses the
non-negative constraint while keeping transactionProcessingStrategyCode and
loansAccountTermsForm intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7951f2b7-716e-4eee-a6a3-4d3a2cd11b89
📒 Files selected for processing (4)
src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.htmlsrc/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.tssrc/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.htmlsrc/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
- src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html
- src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts
...loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html
Outdated
Show resolved
Hide resolved
ed8c414 to
d8a575a
Compare
Changes Made :-
-Prevent negative values in loan product numeric input fields .
WEB-707
Before :-
After :-
Summary by CodeRabbit