Skip to content

WEB-680 Fix provisioning criteria dialog allows negative values in age percentage fields#3111

Merged
alberto-art3ch merged 1 commit intoopenMF:devfrom
JaySoni1:WEB-680-fix-provisioning-criteria-dialog-allows-negative-values-in-age-percentage-fields
Feb 9, 2026
Merged

WEB-680 Fix provisioning criteria dialog allows negative values in age percentage fields#3111
alberto-art3ch merged 1 commit intoopenMF:devfrom
JaySoni1:WEB-680-fix-provisioning-criteria-dialog-allows-negative-values-in-age-percentage-fields

Conversation

@JaySoni1
Copy link
Contributor

@JaySoni1 JaySoni1 commented Feb 9, 2026

Changes Made :-

-Adds min=0 validation to age/percentage fields by implementing Validators.min() in FormGroupService and HTML min attribute in formfield template.

WEB-680

Before :-

image

After :-

image

Summary by CodeRabbit

  • New Features
    • Added runtime min/max validation for numeric form inputs, enabling real-time range checks.
  • Improvements
    • Numeric inputs now expose native min/max attributes for browser-level enforcement and UX.
  • Bug Fixes
    • Loan provisioning forms now enforce non-negative values for age and provisioning percentage fields.

@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

Adds runtime Validators.min/Validators.max support and HTML min/max attribute bindings; applies min: 0 constraints to three numeric loan provisioning criteria fields.

Changes

Cohort / File(s) Summary
Form validation core & template
src/app/shared/form-dialog/form-group.service.ts, src/app/shared/form-dialog/formfield/formfield.component.html
FormGroupService.buildValidators now adds Validators.min/Validators.max when formfield.min/formfield.max are defined; input elements bind [attr.min] and [attr.max].
Loan provisioning criteria forms
src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.ts, src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.ts
Introduced min: 0 for minAge, maxAge, and provisioningPercentage fields to enforce non-negative values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • IOhacker
  • alberto-art3ch
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding min value validation to prevent negative values in age and percentage fields for the provisioning criteria dialog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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.

@JaySoni1 JaySoni1 force-pushed the WEB-680-fix-provisioning-criteria-dialog-allows-negative-values-in-age-percentage-fields branch from 579d0b3 to 2cb554e Compare February 9, 2026 09:59
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.

LGTM

@alberto-art3ch alberto-art3ch merged commit 99e7354 into openMF:dev Feb 9, 2026
5 checks passed
@JaySoni1
Copy link
Contributor Author

JaySoni1 commented Feb 9, 2026

@alberto-art3ch Thank You for the 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