Skip to content

WEB-720 Prevent negative values for interest rate in floating rate period form - #3148

Merged
IOhacker merged 1 commit into
openMF:devfrom
JaySoni1:WEB-720-prevent-negative-values-for-interest-rate-in-floating-rate-period-form
Feb 14, 2026
Merged

WEB-720 Prevent negative values for interest rate in floating rate period form#3148
IOhacker merged 1 commit into
openMF:devfrom
JaySoni1:WEB-720-prevent-negative-values-for-interest-rate-in-floating-rate-period-form

Conversation

@JaySoni1

@JaySoni1 JaySoni1 commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Changes Made :-

-Added validation to restrict the Interest Rate field in the Floating Rate Period form to zero or positive values .

WEB-720

Before :-

image

After :-

image

Summary by CodeRabbit

  • Bug Fixes
    • Interest Rate input field now enforces non-negative values, preventing negative interest rates from being entered.

@coderabbitai

coderabbitai Bot commented Feb 13, 2026

Copy link
Copy Markdown

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 non-negativity constraints to the Interest Rate input field in a floating-rate period dialog component by adding min="0" attribute to the HTML input element and Validators.min(0) to the form control validation in TypeScript.

Changes

Cohort / File(s) Summary
Floating Rate Period Dialog Validation
src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.html, src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts
Adds non-negativity constraint to Interest Rate field via HTML min="0" attribute and TypeScript Validators.min(0) validation, preventing negative values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • IOhacker
  • alberto-art3ch
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (22 files):

⚔️ README.md (content)
⚔️ angular.json (content)
⚔️ docker-compose.yml (content)
⚔️ env.sample (content)
⚔️ proxy.conf.js (content)
⚔️ proxy.localhost.conf.js (content)
⚔️ src/app/clients/client-stepper/client-general-step/client-general-step.component.html (content)
⚔️ src/app/clients/client-stepper/client-general-step/client-general-step.component.scss (content)
⚔️ src/app/clients/client-stepper/client-general-step/client-general-step.component.ts (content)
⚔️ src/app/clients/clients.service.ts (content)
⚔️ src/app/clients/edit-client/edit-client.component.html (content)
⚔️ src/app/clients/edit-client/edit-client.component.scss (content)
⚔️ src/app/clients/edit-client/edit-client.component.ts (content)
⚔️ src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.html (content)
⚔️ src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts (content)
⚔️ src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.ts (content)
⚔️ src/assets/env.js (content)
⚔️ src/assets/env.template.js (content)
⚔️ src/assets/translations/en-US.json (content)
⚔️ src/environments/environment.prod.ts (content)
⚔️ src/environments/environment.ts (content)
⚔️ src/typings.d.ts (content)

These conflicts must be resolved before merging into dev.
Resolve conflicts locally and push changes to this branch.
✅ 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 clearly and specifically summarizes the main change: preventing negative values for interest rates in the floating rate period form, which aligns with the code modifications in both the HTML and TypeScript files.
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
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch WEB-720-prevent-negative-values-for-interest-rate-in-floating-rate-period-form
  • Post resolved changes as copyable diffs 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.html (1)

29-35: ⚠️ Potential issue | 🟡 Minor

Missing <mat-error> for the min validator.

The TS adds Validators.min(0) but the template only shows an error for required. When a user enters a negative value, the form silently becomes invalid with no feedback. Add a mat-error for the min error.

Proposed fix
         `@if` (floatingRatePeriodForm.controls.interestRate.hasError('required')) {
           <mat-error>
             {{ 'labels.inputs.Interest Rate' | translate }} {{ 'labels.commons.is' | translate }}
             <strong>{{ 'labels.commons.required' | translate }}</strong>
           </mat-error>
         }
+        `@if` (floatingRatePeriodForm.controls.interestRate.hasError('min')) {
+          <mat-error>
+            {{ 'labels.inputs.Interest Rate' | translate }}
+            <strong>{{ 'labels.commons.cannot be negative' | translate }}</strong>
+          </mat-error>
+        }

Adjust the translation key to match your i18n conventions.

@IOhacker IOhacker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm

@IOhacker
IOhacker merged commit 55981a7 into openMF:dev Feb 14, 2026
5 checks passed
@JaySoni1

Copy link
Copy Markdown
Contributor Author

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