Skip to content

WEB-707 Allowing Negative Values in Loan Product Numeric Fields#3398

Open
JaySoni1 wants to merge 1 commit intoopenMF:devfrom
JaySoni1:WEB-707-allowing-negative-values-in-loan-product-numeric-fields
Open

WEB-707 Allowing Negative Values in Loan Product Numeric Fields#3398
JaySoni1 wants to merge 1 commit intoopenMF:devfrom
JaySoni1:WEB-707-allowing-negative-values-in-loan-product-numeric-fields

Conversation

@JaySoni1
Copy link
Copy Markdown
Contributor

@JaySoni1 JaySoni1 commented Mar 17, 2026

Changes Made :-

-Prevent negative values in loan product numeric input fields .

WEB-707

Before :-

image image image

After :-

image image image

Summary by CodeRabbit

  • Bug Fixes / Enhancements
    • Numeric inputs in loan account and product configuration forms now enforce non-negative values (min 0) for fields like tranche counts, outstanding balances, installment gaps, and guarantee amounts.
    • Validation adjustments ensure these constraints apply consistently when controls are shown or hidden.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b412fea-08b6-49d1-b978-d8553043a6f9

📥 Commits

Reviewing files that changed from the base of the PR and between ed8c414 and d8a575a.

📒 Files selected for processing (4)
  • 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
  • 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
✅ Files skipped from review due to trivial changes (1)
  • src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html
🚧 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

Walkthrough

Adds non-negative constraints to numeric inputs by adding HTML min="0" attributes and Validators.min(0) to form controls in two loan-related components; no public APIs or exported signatures changed.

Changes

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

Suggested reviewers

  • IOhacker
  • alberto-art3ch
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning 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.

❤️ Share

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

Copy link
Copy Markdown
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.

Please wait to release the updated Loan Account views

@JaySoni1
Copy link
Copy Markdown
Contributor Author

@alberto-art3ch Ok

Copy link
Copy Markdown
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.

LGTM

@JaySoni1 JaySoni1 force-pushed the WEB-707-allowing-negative-values-in-loan-product-numeric-fields branch from 23e4f43 to ed8c414 Compare March 22, 2026 05:28
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

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

📥 Commits

Reviewing files that changed from the base of the PR and between 23e4f43 and ed8c414.

📒 Files selected for processing (4)
  • 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
  • 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
🚧 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

@JaySoni1 JaySoni1 force-pushed the WEB-707-allowing-negative-values-in-loan-product-numeric-fields branch from ed8c414 to d8a575a Compare March 22, 2026 05:48
@JaySoni1 JaySoni1 requested a review from alberto-art3ch March 24, 2026 18:55
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