WEB-720 Prevent negative values for interest rate in floating rate period form - #3148
Conversation
|
Note
|
| 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
- WEB-454 Nominal annual interest field allows zero and negative values in saving product creation form #2859: Applies the same non-negativity constraint pattern (
min="0"andValidators.min(0)) to interest-rate fields in other product components.
Suggested reviewers
- IOhacker
- alberto-art3ch
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Merge Conflict Detection | ❌ 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
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 | 🟡 MinorMissing
<mat-error>for theminvalidator.The TS adds
Validators.min(0)but the template only shows an error forrequired. When a user enters a negative value, the form silently becomes invalid with no feedback. Add amat-errorfor theminerror.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 Thank You for the review |
Changes Made :-
-Added validation to restrict the Interest Rate field in the Floating Rate Period form to zero or positive values .
WEB-720
Before :-
After :-
Summary by CodeRabbit