WEB-657: Working Capital loan Breach and Near Breach update#3663
WEB-657: Working Capital loan Breach and Near Breach update#3663alberto-art3ch wants to merge 1 commit into
Conversation
|
Note
|
| Layer / File(s) | Summary |
|---|---|
Data models and service methods src/app/loans/models/working-capital/working-capital-loan-account.model.ts, src/app/loans/loans.service.ts |
Adds four interfaces (WorkingCapitalBreachActionRequest, WorkingCapitalBreachAction, WorkingCapitalNearBreachActionRequest, WorkingCapitalNearBreachActions) and two LoansService methods: GET and POST to /working-capital-loans/{loanId}/near-breach-actions. |
Breach and Near Breach resolvers src/app/loans/common-resolvers/working-capital/loan-breach-actions.resolver.ts, src/app/loans/common-resolvers/working-capital/loan-near-breach-actions.resolver.ts, src/app/loans/common-resolvers/loan-action-button.resolver.ts |
New LoanBreachActionsResolver and LoanNearBreachActionsResolver extending LoanBaseResolver conditionally fetch breach or near-breach actions when isWorkingCapital is true. LoanActionButtonResolver gains ProductsService injection and branches for Update Near Breach and Update Breach. |
Routing wiring src/app/loans/loans-routing.module.ts |
Registers LoanNearBreachActionsResolver in providers; wires loanNearBreachActions into the accountdetail and breach-actions route resolve maps. |
BreachConfig form component src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.ts, ...html, ...scss |
Standalone BreachConfigComponent with a reactive form for frequency, frequency type, minimum payment, and minimum payment type; on submit posts a WorkingCapitalBreachActionRequest with action='RESCHEDULE' and navigates to breach-actions. |
NearBreachConfig form component src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.ts, ...html, ...scss |
Standalone NearBreachConfigComponent with a reactive form for frequency, frequency type, and validated threshold; on submit posts a WorkingCapitalNearBreachActionRequest with action='RESCHEDULE' and navigates to breach-actions. |
LoanBreachActionsTab component src/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.ts, ...html, ...scss |
New LoanBreachActionsTabComponent displaying Breach Actions and Near Breach Actions Material tables from route data, with permission-gated Update buttons, formatted columns, and enablement getters based on loanDetails. |
Near Breach History dialog src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.ts, ...html, ...scss |
New WorkingCapitalNearBreachHistoryDialogComponent showing a grouped table of effective date, previous/new thresholds and frequencies, and a reversed status indicator; sets dialog width to 800px; SCSS styles grouped header cells and reversed-yes/no circular indicators. |
Account details and loan view wiring src/app/loans/loans-view/account-details/account-details.component.ts, ...html, src/app/loans/loans-view/loans-view.component.ts, ...html |
AccountDetailsComponent reads loanNearBreachActions from route data and shows a Near Breach History icon button. LoansViewComponent.setConditionalButtons() appends Update Near Breach and Update Breach buttons. The loans-view template adds a Breach Actions tab link when loanDetailsData.breach is set. |
LoanAccountActions component wiring src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts, ...html |
Imports and registers NearBreachConfigComponent and BreachConfigComponent; adds Update Near Breach and Update Breach keys to the actions map; template conditionally renders both action components. |
Shared utilities and fixes src/app/shared/icons.module.ts, src/app/shared/input-amount/input-amount.component.html, src/app/products/loan-products/working-capital/near-breach-configuration/near-breach-configuration.component.ts |
Registers faHistory icon; guards mifosxFormatAmount and mat-hint on currency presence in input-amount; removes unused MatTooltip import from near-breach-configuration. |
Translations across 14 locales src/assets/translations/* |
Adds heading (Breach Actions, Near Breach Actions, Near Breach History), inputs (Breach Actions, New, Previous), menus (Update Breach, Update Near Breach), and text (No Breach Actions, No Near Breach Actions) keys to all 14 locale JSON files. |
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
Suggested reviewers
- adamsaghy
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly summarizes the main change: implementing Working Capital loan Breach and Near Breach update functionality, which is the primary objective of the changeset. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ 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.
There was a problem hiding this comment.
Actionable comments posted: 13
🧹 Nitpick comments (1)
src/app/loans/loans.service.ts (1)
914-916: ⚡ Quick winTighten
loanIdtype in the near-breach update method.Line 914 uses
loanId: any, which weakens type safety on a public service contract. Usestring | number(orstring, if that is the route contract) to keep callers type-safe.Suggested fix
- updateWorkingCapitalNearBreachConfig(loanId: any, payload: WorkingCapitalNearBreachConfigRequest) { + updateWorkingCapitalNearBreachConfig(loanId: string | number, payload: WorkingCapitalNearBreachConfigRequest) { return this.http.put(`/working-capital-loans/${loanId}/near-breach-config`, payload); }As per coding guidelines, “Use TypeScript for all application code with strict typing conventions.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/loans/loans.service.ts` around lines 914 - 916, The updateWorkingCapitalNearBreachConfig method in the loans service has a weakly typed loanId parameter set to any, which reduces type safety. Replace the loanId: any parameter with a more specific type such as string | number or string (depending on what your API route contract expects) to enforce proper type checking at the call site and improve code maintainability.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/app/loans/common-resolvers/working-capital/loan-near-breach-data.resolver.ts`:
- Around line 31-35: In the LoanNearBreachDataResolver, the loanId validation
check using isNaN is insufficient because null and empty string values coerce to
0, allowing invalid route states to proceed. Add an explicit check to ensure
loanId is neither null nor an empty string before applying the isNaN validation
on the coerced numeric value. This will prevent false-positive numeric checks
and ensure the getWorkingCapitalLoanNearBreachData service method is only called
when a valid loanId is present.
In
`@src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scss`:
- Around line 11-97: The SCSS file contains hard-coded pixel values and colors
that do not align with the 8px grid system and shared design tokens. Replace all
hard-coded spacing values (16px, 8px, 9.5px, 11px, 12px, 2px) in the selectors
like .dialog-header, .dialog-title, .close-button, .near-breach-table,
th.grp-header, th.mat-mdc-header-cell, th.col-grp-start, th.col-grp-end, and
.reversed-indicator with corresponding SCSS variables from src/main.scss and
src/theme/mifosx-theme.scss, and align all spacing to the 8px grid scale.
Additionally, replace hard-coded color values (var(--ch-text-3),
var(--ch-blue-700), var(--ch-blue-600), var(--ch-blue-100), var(--ch-paid),
var(--ch-alert)) with the appropriate SCSS variables from the shared theme files
to maintain design consistency.
In `@src/app/loans/loans-routing.module.ts`:
- Line 137: Replace the hardcoded string 'Account Detail' in the route data
object's title and breadcrumb properties with appropriate translation keys from
your i18n configuration. Instead of using literal strings in the data property,
use the proper translation key identifiers (typically in the format 'KEY_NAME'
or similar as defined in your i18n files) that correspond to the localized text.
This ensures the breadcrumb and title values will be properly localized through
the `@ngx-translate/core` service.
In `@src/app/loans/loans-view/account-details/account-details.component.html`:
- Around line 102-112: The icon-only button for the Near Breach History function
(openNearBreachHistory) is missing an aria-label attribute, which means screen
readers cannot announce a proper action name to users. Add an aria-label
attribute to the mat-icon-button element with a clear and descriptive label that
matches or describes the tooltip content. The aria-label should use the same
translation key or a similar accessible description to ensure both sighted and
non-sighted users understand the button's purpose.
In `@src/app/loans/loans-view/account-details/account-details.component.ts`:
- Around line 78-80: The lastNearBreachConfig getter currently uses find to
return the first non-reversed item, which depends on API ordering and can show
stale data. To fix this, modify the getter method to first sort the
loanNearBreachData array by date or timestamp in descending order (latest first)
before calling find to get the first non-reversed entry. This ensures that the
latest non-reversed Near Breach entry is returned deterministically, regardless
of the API response order.
In `@src/app/loans/loans-view/loans-view.component.ts`:
- Around line 404-410: The condition on line 404 uses the `in` operator to check
for property existence with `'nearBreach' in this.loanDetailsData`, but this
returns true even when the value is null or undefined, causing the "Update Near
Breach" button to be displayed in invalid states. Replace the property-existence
check with a value-presence check by directly accessing
`this.loanDetailsData?.nearBreach` or `this.loanDetailsData.nearBreach` within a
condition that verifies the value is actually present and not null, ensuring the
button only displays when the data is genuinely available.
In
`@src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.ts`:
- Around line 60-61: The form validator for the threshold field in the
near-breach-config.component.ts file uses Validators.min(0) which allows zero as
a valid value, but this contradicts the HTML template constraint that sets the
input minimum to 1. Update the Validators.min(0) call to Validators.min(1) to
align the TypeScript form validation with the template's UI constraint, ensuring
consistent validation behavior across both layers.
- Around line 69-75: The submit() method in the near-breach-config component
does not validate the form before attempting to build the payload and call the
API. Add an explicit guard at the start of the submit() method to check if
nearBreachConfigForm exists and is valid (using form.valid property) before
setting isSubmitting to true and creating the payload. If the form is null or
invalid, return early from the method to prevent incomplete data from being sent
to the API.
In `@src/app/shared/loan/breach-display/breach-display.component.html`:
- Around line 86-119: The template bindings in the breach-display.component.html
file are referencing incorrect field names that do not exist in the
WorkingCapitalNearBreachData contract. In the singleRow block, replace the
references to nearBreach.name, nearBreachData.frequency,
nearBreachData.frequencyType.code, and nearBreachData.threshold with the correct
property names from the WorkingCapitalNearBreachData interface. Similarly,
verify that the !singleRow block is using the correct field names for
nearBreachData.name, nearBreachData.newFrequency,
nearBreachData.newFrequencyType, nearBreachData.newThreshold, and
nearBreachData.effectiveDate. Check the WorkingCapitalNearBreachData type
definition to identify the actual available properties and update both
conditional blocks to consistently use the correct field names.
In `@src/assets/translations/es-MX.json`:
- Line 1411: Unify the Spanish translation terminology for "Near Breach" in the
es-MX.json file. The key "Near Breach History" at line 1411 currently uses
"Historial de incumplimiento inminente" while the same concept at line 3280 uses
"Incumplimiento Cercano". Replace all instances of "incumplimiento inminente"
with "Incumplimiento Cercano" to maintain consistent terminology across all
related labels, headings, menu items, and input texts so users see a single
unified concept throughout the interface.
In `@src/assets/translations/fr-FR.json`:
- Line 1411: The translation for "Near Breach History" in the fr-FR.json locale
file uses "Historique des violations proches" which is inconsistent with the
established terminology elsewhere in the same file that uses "Quasi-Dépassement"
for Near Breach references. Replace "Historique des violations proches" with a
translation that uses "Quasi-Dépassement" instead of "violations proches" to
maintain consistent terminology. Apply the same correction to the other
occurrence of this translation issue at line 3282.
In `@src/assets/translations/it-IT.json`:
- Line 1408: The Italian translation file uses multiple different terms for the
"Near Breach" feature (quasi-violazione, violazione prossima, and violazioni
prossime), creating inconsistency in the UI. Choose one standardized Italian
term for "Near Breach" and replace all instances throughout the file, including
the occurrence at the "Near Breach History" entry and the related entry
mentioned in the also applies section, to ensure consistent terminology across
the entire translation file.
In `@src/assets/translations/pt-PT.json`:
- Line 1407: The Portuguese translation file has an inconsistent use of
terminology for the Near Breach feature. The "Near Breach History" entry at line
1407 currently uses "violação próxima" but the rest of the file uses "quase
incumprimento" / "Quase Incumprimento" for the same feature. Update the "Near
Breach History" translation to use the consistent terminology "Histórico de
Quase Incumprimento" (or similar variation with "quase incumprimento" depending
on context) to match the rest of the file. Also apply the same fix to the
similar occurrence at line 3278 to ensure consistent terminology throughout the
entire translation file.
---
Nitpick comments:
In `@src/app/loans/loans.service.ts`:
- Around line 914-916: The updateWorkingCapitalNearBreachConfig method in the
loans service has a weakly typed loanId parameter set to any, which reduces type
safety. Replace the loanId: any parameter with a more specific type such as
string | number or string (depending on what your API route contract expects) to
enforce proper type checking at the call site and improve code maintainability.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0e18c12c-c181-4c74-8bbd-a7e9b003763e
📒 Files selected for processing (32)
src/app/loans/common-resolvers/loan-action-button.resolver.tssrc/app/loans/common-resolvers/working-capital/loan-near-breach-data.resolver.tssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.htmlsrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scsssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.tssrc/app/loans/loans-routing.module.tssrc/app/loans/loans-view/account-details/account-details.component.htmlsrc/app/loans/loans-view/account-details/account-details.component.tssrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.htmlsrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.tssrc/app/loans/loans-view/loans-view.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.tssrc/app/loans/loans.service.tssrc/app/loans/models/working-capital/working-capital-loan-account.model.tssrc/app/shared/icons.module.tssrc/app/shared/loan/breach-display/breach-display.component.htmlsrc/app/shared/loan/breach-display/breach-display.component.tssrc/assets/translations/cs-CS.jsonsrc/assets/translations/de-DE.jsonsrc/assets/translations/en-US.jsonsrc/assets/translations/es-CL.jsonsrc/assets/translations/es-MX.jsonsrc/assets/translations/fr-FR.jsonsrc/assets/translations/it-IT.jsonsrc/assets/translations/ko-KO.jsonsrc/assets/translations/lt-LT.jsonsrc/assets/translations/lv-LV.jsonsrc/assets/translations/ne-NE.jsonsrc/assets/translations/pt-PT.jsonsrc/assets/translations/sw-SW.json
193272e to
72a6404
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/shared/loan/breach-display/breach-display.component.html`:
- Around line 96-115: Add the missing translation keys to all locale files. The
breach-display.component.html template uses three translation keys via the
translate pipe: labels.inputs.Frequency, labels.inputs.Threshold, and
labels.inputs.Effective Date. These keys must be added to each of the 14 locale
files with appropriate translations for each language. Ensure the keys are
placed in the correct nested structure under labels.inputs in the locale JSON
files.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3ed8fd26-6a3b-4cf2-98a4-a77c4f8b6bc9
📒 Files selected for processing (32)
src/app/loans/common-resolvers/loan-action-button.resolver.tssrc/app/loans/common-resolvers/working-capital/loan-near-breach-data.resolver.tssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.htmlsrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scsssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.tssrc/app/loans/loans-routing.module.tssrc/app/loans/loans-view/account-details/account-details.component.htmlsrc/app/loans/loans-view/account-details/account-details.component.tssrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.htmlsrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.tssrc/app/loans/loans-view/loans-view.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.tssrc/app/loans/loans.service.tssrc/app/loans/models/working-capital/working-capital-loan-account.model.tssrc/app/shared/icons.module.tssrc/app/shared/loan/breach-display/breach-display.component.htmlsrc/app/shared/loan/breach-display/breach-display.component.tssrc/assets/translations/cs-CS.jsonsrc/assets/translations/de-DE.jsonsrc/assets/translations/en-US.jsonsrc/assets/translations/es-CL.jsonsrc/assets/translations/es-MX.jsonsrc/assets/translations/fr-FR.jsonsrc/assets/translations/it-IT.jsonsrc/assets/translations/ko-KO.jsonsrc/assets/translations/lt-LT.jsonsrc/assets/translations/lv-LV.jsonsrc/assets/translations/ne-NE.jsonsrc/assets/translations/pt-PT.jsonsrc/assets/translations/sw-SW.json
✅ Files skipped from review due to trivial changes (9)
- src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.scss
- src/assets/translations/ko-KO.json
- src/assets/translations/es-CL.json
- src/assets/translations/cs-CS.json
- src/assets/translations/it-IT.json
- src/assets/translations/en-US.json
- src/assets/translations/es-MX.json
- src/assets/translations/lv-LV.json
- src/assets/translations/lt-LT.json
🚧 Files skipped from review as they are similar to previous changes (21)
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scss
- src/app/shared/icons.module.ts
- src/app/loans/models/working-capital/working-capital-loan-account.model.ts
- src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.ts
- src/app/loans/common-resolvers/working-capital/loan-near-breach-data.resolver.ts
- src/assets/translations/ne-NE.json
- src/app/loans/common-resolvers/loan-action-button.resolver.ts
- src/assets/translations/fr-FR.json
- src/app/shared/loan/breach-display/breach-display.component.ts
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.ts
- src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
- src/app/loans/loans-view/account-details/account-details.component.ts
- src/app/loans/loans-routing.module.ts
- src/assets/translations/de-DE.json
- src/assets/translations/sw-SW.json
- src/app/loans/loans-view/loans-view.component.ts
- src/app/loans/loans-view/account-details/account-details.component.html
- src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.html
- src/assets/translations/pt-PT.json
- src/app/loans/loans.service.ts
- src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
72a6404 to
6e8345f
Compare
There was a problem hiding this comment.
Actionable comments posted: 9
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/app/loans/common-resolvers/working-capital/loan-breach-actions.resolver.ts`:
- Around line 30-37: The resolve method in the loan-breach-actions.resolver.ts
file does not handle errors from the getWorkingCapitalLoanBreachActions()
service call, which will prevent route activation if the HTTP request fails.
Since the component has a fallback handler for missing breach actions
(breachActions || []), errors should not block navigation. Add the RxJS
catchError operator to the return statement where
getWorkingCapitalLoanBreachActions(loanId) is called to catch any HTTP errors
and return of([]) as a safe fallback, allowing the route to activate
successfully even when the service call fails.
In
`@src/app/loans/common-resolvers/working-capital/loan-near-breach-actions.resolver.ts`:
- Around line 30-37: The resolve method in the LoanNearBreachActionsResolver
class returns the observable from getWorkingCapitalLoanNearBreachActions without
any error handling, which causes route navigation to fail if the HTTP call
fails. Add a catchError operator to the return statement that returns of([])
when the observable throws an error, ensuring graceful degradation since
near-breach actions are supplementary data and the component already initializes
with an empty array.
In `@src/app/loans/loans-view/loans-view.component.html`:
- Around line 371-384: The `@if` condition on the breach-actions tab link
currently only checks loanDetailsData.breach, which prevents the tab from
appearing for loans that have Near Breach configuration or actions but no Breach
object. Broaden the visibility condition to include both breach and near breach
states so users can discover and access the Near Breach workflow. Modify the `@if`
statement to check for both loanDetailsData.breach and the appropriate near
breach state property (verify the exact property name for near breach status in
the loanDetailsData object).
In
`@src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.html`:
- Line 66: The mat-card-actions element in breach-config.component.html uses the
gap-5px class which violates the 8px grid system spacing guidelines for HTML
files. Replace the gap-5px class with an appropriate 8px-grid compliant spacing
class such as gap-8px (or the next multiple of 8 if 8px is too small) in the
class attribute of the mat-card-actions element to align with the coding
standards that require all src/**/*.html files to use multiples of 8 for spacing
values.
In
`@src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.ts`:
- Around line 22-31: The BreachConfigComponent decorator includes an imports
array but is missing the required standalone: true property. In the `@Component`
decorator for BreachConfigComponent (which contains selector, templateUrl,
styleUrl, and the imports array with STANDALONE_SHARED_IMPORTS,
InputPositiveIntegerComponent, and InputAmountComponent), add the standalone:
true property to make this a valid standalone component.
In
`@src/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.html`:
- Line 12: The spacing class gap-5px used in the div with class layout-row
m-t-10 m-b-10 align-end align-items-center breaks the 8px grid requirement for
this project. Replace gap-5px with an appropriate 8px-grid spacing class token
(such as gap-8px) on line 12. Apply the same fix to line 68 where the same
gap-5px class is also used.
In
`@src/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.ts`:
- Line 62: The `loanDetails` property on line 62 and the route-data/loan payload
types on lines 84-85 are currently typed as `any`, which violates strict typing
conventions. Replace the `any` type on `loanDetails` with a concrete interface
that describes the loan details structure. Similarly, replace the `any` types on
lines 84-85 with explicit interfaces for the route-data and loan payload
contracts. If full model typing is not yet available, create local minimal
interfaces within the component that define the shape of these objects to
maintain strict type safety.
In `@src/app/loans/loans.service.ts`:
- Around line 920-928: The parameter `loanId: any` in both the
addWorkingCapitalNearBreachAction and addWorkingCapitalBreachAction methods
weakens type safety. Replace the `any` type with `string` for the loanId
parameter in both methods to match the established pattern used elsewhere in the
service and to align with how loanId is sourced from route parameters.
In `@src/assets/translations/lt-LT.json`:
- Around line 1119-1120: The Lithuanian translations for the breach-related
labels at keys "Breach Actions" and "Near Breach Actions" (appearing at lines
1119-1120 and also at lines 1584, 3352-3353) use unnatural phrasing and casing
that will read awkwardly in the UI. Update these translations to use proper
Lithuanian grammar and natural word order, ensuring that adjectives and nouns
are properly declined according to Lithuanian grammatical rules and that the
phrase reads naturally when displayed to users in the interface.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9f07a490-827c-49a5-8a1e-1210d5965056
📒 Files selected for processing (40)
src/app/loans/common-resolvers/loan-action-button.resolver.tssrc/app/loans/common-resolvers/working-capital/loan-breach-actions.resolver.tssrc/app/loans/common-resolvers/working-capital/loan-near-breach-actions.resolver.tssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.htmlsrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scsssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.tssrc/app/loans/loans-routing.module.tssrc/app/loans/loans-view/account-details/account-details.component.htmlsrc/app/loans/loans-view/account-details/account-details.component.tssrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.htmlsrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.tssrc/app/loans/loans-view/loans-view.component.htmlsrc/app/loans/loans-view/loans-view.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.tssrc/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.htmlsrc/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.scsssrc/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.tssrc/app/loans/loans.service.tssrc/app/loans/models/working-capital/working-capital-loan-account.model.tssrc/app/products/loan-products/working-capital/near-breach-configuration/near-breach-configuration.component.tssrc/app/shared/icons.module.tssrc/app/shared/input-amount/input-amount.component.htmlsrc/assets/translations/cs-CS.jsonsrc/assets/translations/de-DE.jsonsrc/assets/translations/en-US.jsonsrc/assets/translations/es-CL.jsonsrc/assets/translations/es-MX.jsonsrc/assets/translations/fr-FR.jsonsrc/assets/translations/it-IT.jsonsrc/assets/translations/ko-KO.jsonsrc/assets/translations/lt-LT.jsonsrc/assets/translations/lv-LV.jsonsrc/assets/translations/ne-NE.jsonsrc/assets/translations/pt-PT.jsonsrc/assets/translations/sw-SW.json
💤 Files with no reviewable changes (1)
- src/app/products/loan-products/working-capital/near-breach-configuration/near-breach-configuration.component.ts
✅ Files skipped from review due to trivial changes (14)
- src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.scss
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scss
- src/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.scss
- src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.scss
- src/assets/translations/lv-LV.json
- src/assets/translations/es-MX.json
- src/assets/translations/en-US.json
- src/assets/translations/es-CL.json
- src/assets/translations/ko-KO.json
- src/assets/translations/it-IT.json
- src/assets/translations/de-DE.json
- src/assets/translations/pt-PT.json
- src/assets/translations/sw-SW.json
- src/assets/translations/ne-NE.json
🚧 Files skipped from review as they are similar to previous changes (3)
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.html
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.ts
- src/app/shared/icons.module.ts
| </mat-form-field> | ||
| </div> | ||
|
|
||
| <mat-card-actions class="layout-row align-center gap-5px responsive-column"> |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use 8px-grid spacing instead of gap-5px.
gap-5px breaks the spacing rule for src/**/*.{scss,html} files.
💡 Suggested fix
- <mat-card-actions class="layout-row align-center gap-5px responsive-column">
+ <mat-card-actions class="layout-row align-center gap-8px responsive-column">As per coding guidelines, src/**/*.{scss,html} must “Stick to the 8px grid system for visual design and spacing”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.html`
at line 66, The mat-card-actions element in breach-config.component.html uses
the gap-5px class which violates the 8px grid system spacing guidelines for HTML
files. Replace the gap-5px class with an appropriate 8px-grid compliant spacing
class such as gap-8px (or the next multiple of 8 if 8px is too small) in the
class attribute of the mat-card-actions element to align with the coding
standards that require all src/**/*.html files to use multiples of 8 for spacing
values.
Source: Coding guidelines
6e8345f to
544f18b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/loans/loans-view/account-details/account-details.component.html`:
- Around line 92-108: The Near Breach section is missing the actual value
display that shows the current near breach status to users. Within the flex-fill
layout-row that contains the "Near Breach" label, add a value display (likely in
a second flex-50 container) that renders the actual near breach value or status
from the loanDetails property. This value should appear after the label and
before or alongside the history button to restore the visible account detail
context.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 53a04102-a21a-458e-898a-3c9e3f980c51
📒 Files selected for processing (41)
.gitignoresrc/app/loans/common-resolvers/loan-action-button.resolver.tssrc/app/loans/common-resolvers/working-capital/loan-breach-actions.resolver.tssrc/app/loans/common-resolvers/working-capital/loan-near-breach-actions.resolver.tssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.htmlsrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scsssrc/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.tssrc/app/loans/loans-routing.module.tssrc/app/loans/loans-view/account-details/account-details.component.htmlsrc/app/loans/loans-view/account-details/account-details.component.tssrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.htmlsrc/app/loans/loans-view/loan-account-actions/loan-account-actions.component.tssrc/app/loans/loans-view/loans-view.component.htmlsrc/app/loans/loans-view/loans-view.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.tssrc/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.htmlsrc/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.scsssrc/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.tssrc/app/loans/loans.service.tssrc/app/loans/models/working-capital/working-capital-loan-account.model.tssrc/app/products/loan-products/working-capital/near-breach-configuration/near-breach-configuration.component.tssrc/app/shared/icons.module.tssrc/app/shared/input-amount/input-amount.component.htmlsrc/assets/translations/cs-CS.jsonsrc/assets/translations/de-DE.jsonsrc/assets/translations/en-US.jsonsrc/assets/translations/es-CL.jsonsrc/assets/translations/es-MX.jsonsrc/assets/translations/fr-FR.jsonsrc/assets/translations/it-IT.jsonsrc/assets/translations/ko-KO.jsonsrc/assets/translations/lt-LT.jsonsrc/assets/translations/lv-LV.jsonsrc/assets/translations/ne-NE.jsonsrc/assets/translations/pt-PT.jsonsrc/assets/translations/sw-SW.json
💤 Files with no reviewable changes (1)
- src/app/products/loan-products/working-capital/near-breach-configuration/near-breach-configuration.component.ts
✅ Files skipped from review due to trivial changes (17)
- .gitignore
- src/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.scss
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.scss
- src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.scss
- src/assets/translations/lv-LV.json
- src/assets/translations/en-US.json
- src/assets/translations/es-CL.json
- src/assets/translations/ko-KO.json
- src/assets/translations/it-IT.json
- src/assets/translations/lt-LT.json
- src/assets/translations/cs-CS.json
- src/assets/translations/pt-PT.json
- src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.html
- src/assets/translations/es-MX.json
- src/assets/translations/de-DE.json
- src/assets/translations/sw-SW.json
- src/assets/translations/ne-NE.json
🚧 Files skipped from review as they are similar to previous changes (22)
- src/app/loans/loans-view/loans-view.component.html
- src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
- src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.scss
- src/app/shared/icons.module.ts
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.ts
- src/app/loans/custom-dialog/working-capital-near-breach-history-dialog/working-capital-near-breach-history-dialog.component.html
- src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
- src/app/loans/common-resolvers/working-capital/loan-breach-actions.resolver.ts
- src/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.ts
- src/app/shared/input-amount/input-amount.component.html
- src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.html
- src/app/loans/common-resolvers/loan-action-button.resolver.ts
- src/app/loans/loans-view/working-capital/loan-breach-actions-tab/loan-breach-actions-tab.component.html
- src/app/loans/loans-view/working-capital/loan-account-actions/near-breach-config/near-breach-config.component.ts
- src/assets/translations/fr-FR.json
- src/app/loans/loans-view/loans-view.component.ts
- src/app/loans/common-resolvers/working-capital/loan-near-breach-actions.resolver.ts
- src/app/loans/models/working-capital/working-capital-loan-account.model.ts
- src/app/loans/loans.service.ts
- src/app/loans/loans-routing.module.ts
- src/app/loans/loans-view/account-details/account-details.component.ts
- src/app/loans/loans-view/working-capital/loan-account-actions/breach-config/breach-config.component.ts
| @if (loanDetails.nearBreach || loanNearBreachActions.length) { | ||
| <div class="flex-fill layout-row"> | ||
| <span class="flex-50"> {{ 'labels.inputs.Near Breach' | translate }} </span> | ||
| <span class="flex-50" | ||
| ><mifosx-breach-display [singleRow]="false" [nearBreach]="loanDetails.nearBreach" | ||
| /></span> | ||
| @if (loanNearBreachActions.length > 0) { | ||
| <button | ||
| mat-icon-button | ||
| color="primary" | ||
| class="m-l-10" | ||
| [matTooltip]="'labels.heading.Near Breach History' | translate" | ||
| [attr.aria-label]="'labels.heading.Near Breach History' | translate" | ||
| (click)="openNearBreachHistory()" | ||
| > | ||
| <mat-icon> | ||
| <fa-icon icon="history" size="sm"></fa-icon> | ||
| </mat-icon> | ||
| </button> | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Restore visible Near Breach value in this row.
This block now renders the “Near Breach” label (and maybe history icon) but no current near-breach value/config, so users lose key account detail context.
🔧 Minimal fix sketch
`@if` (loanDetails.nearBreach || loanNearBreachActions.length) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Near Breach' | translate }} </span>
+ <span class="flex-40">
+ <mifosx-breach-display
+ [value]="loanDetails.nearBreach"
+ [isNearBreach]="true"
+ ></mifosx-breach-display>
+ </span>
`@if` (loanNearBreachActions.length > 0) {
<button
mat-icon-button🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/app/loans/loans-view/account-details/account-details.component.html`
around lines 92 - 108, The Near Breach section is missing the actual value
display that shows the current near breach status to users. Within the flex-fill
layout-row that contains the "Near Breach" label, add a value display (likely in
a second flex-50 container) that renders the actual near breach value or status
from the loanDetails property. This value should appear after the label and
before or alongside the history button to restore the visible account detail
context.
Description
User should be able to change the Near Breach Threshold (% field) and Frequency fields in the middle of the active loan. Supported multiple change (even on same date)
Related issues and discussion
WEB-657
Screenshots
Screen.Recording.2026-06-23.at.8.25.03.PM.mov
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Chores