Skip to content

WEB-657: Working Capital Loan - Charge-Off - #3790

Open
alberto-art3ch wants to merge 1 commit into
openMF:devfrom
alberto-art3ch:WEB-657/working-capital-loan-charge-off
Open

WEB-657: Working Capital Loan - Charge-Off#3790
alberto-art3ch wants to merge 1 commit into
openMF:devfrom
alberto-art3ch:WEB-657/working-capital-loan-charge-off

Conversation

@alberto-art3ch

@alberto-art3ch alberto-art3ch commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

Allow to mark a Working Capital Loan as Charg-Off and Undo Charge-Off

Related issues and discussion

WEB-657

Screenshots

  • Apply Charge-Off
Screen.Recording.2026-08-03.at.5.31.58.PM.mov
  • Undo Charge-Off
Screen.Recording.2026-08-03.at.6.03.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

  • New Features
    • Added charge-off and undo charge-off actions for working-capital loans.
    • Added charge-off forms with date, reason, external ID, notes, validation, and permission controls.
    • Added confirmation dialog for reversing a charge-off.
    • Added charged-off status, date, and optional reason to loan summaries and headers.
  • Localization
    • Added charge-off terminology and confirmation messages across supported languages.
  • Bug Fixes
    • Corrected charge-off and reversal actions to use the appropriate workflow for each loan type.

@alberto-art3ch
alberto-art3ch requested a review from a team August 3, 2026 23:15
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

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: "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 Plus

Run ID: 6fc976be-ec63-4b3d-a974-99db5c5afe47

📥 Commits

Reviewing files that changed from the base of the PR and between e842bba and cdc8629.

📒 Files selected for processing (28)
  • src/app/loans/common-resolvers/loan-action-button.resolver.ts
  • src/app/loans/loans-view/general-tab/general-tab.component.html
  • src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
  • src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
  • src/app/loans/loans-view/loans-view.component.html
  • src/app/loans/loans-view/loans-view.component.scss
  • src/app/loans/loans-view/loans-view.component.ts
  • src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.html
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.scss
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.ts
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.html
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.scss
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.ts
  • src/app/loans/models/working-capital/working-capital-loan-account.model.ts
  • src/assets/translations/cs-CS.json
  • src/assets/translations/de-DE.json
  • src/assets/translations/en-US.json
  • src/assets/translations/es-CL.json
  • src/assets/translations/es-MX.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/it-IT.json
  • src/assets/translations/ko-KO.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/lv-LV.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/sw-SW.json
🚧 Files skipped from review as they are similar to previous changes (28)
  • src/app/loans/loans-view/general-tab/general-tab.component.html
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.scss
  • src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.scss
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.html
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.ts
  • src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.html
  • src/app/loans/common-resolvers/loan-action-button.resolver.ts
  • src/app/loans/models/working-capital/working-capital-loan-account.model.ts
  • src/assets/translations/ne-NE.json
  • src/assets/translations/ko-KO.json
  • src/assets/translations/it-IT.json
  • src/app/loans/loans-view/loans-view.component.scss
  • src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
  • src/assets/translations/es-MX.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/sw-SW.json
  • src/assets/translations/en-US.json
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.ts
  • src/assets/translations/es-CL.json
  • src/app/loans/loans-view/loans-view.component.ts
  • src/assets/translations/lv-LV.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/cs-CS.json
  • src/assets/translations/de-DE.json
  • src/app/loans/loans-view/loans-view.component.html

Walkthrough

Working Capital loans now support dedicated charge-off and undo-charge-off workflows, including typed requests, forms, dialogs, permissions, account status displays, command selection, and translations.

Changes

Working Capital charge-off workflow

Layer / File(s) Summary
Charge-off contract and form
src/app/loans/models/working-capital/..., src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/*
Adds charge-off models and a reactive form with date validation, optional reason and metadata fields, guarded submission, and navigation.
Undo charge-off flow
src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/*, src/app/loans/loans-view/loans-view.component.ts, src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
Adds the undo dialog and submits the Working Capital undoChargeOff command with localized optional reversal data.
Action wiring and account display
src/app/loans/common-resolvers/loan-action-button.resolver.ts, src/app/loans/loans-view/loan-account-actions/*, src/app/loans/loans-view/loans-view.component.*, src/app/loans/loans-view/general-tab/*
Selects Working Capital action templates and displays charge-off status, date, reason, and status styling.
Charge-off translations
src/assets/translations/*
Adds charge-off labels, status text, reversal identifiers, and undo confirmations across supported catalogs.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • openMF/web-app#3752: Routes Working Capital charge-off undo requests through the appropriate command endpoint and payload.
  • openMF/web-app#3750: Updates the resolver and transaction undo selection paths for Working Capital actions.
  • openMF/web-app#3798: Adds a parallel Working Capital loan action flow with similar resolver, view, model, and reversal-field changes.

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 identifies the Working Capital Loan charge-off functionality added by the pull request.
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.
✨ 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.

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

Actionable comments posted: 18

🤖 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/loans-view.component.html`:
- Around line 93-95: Update the two span elements in the loan details template
that use the m-l-10 class to use the existing 8px-grid spacing utility or SCSS
variable instead. Preserve the current layout and conditional chargeOffReason
rendering.
- Around line 31-33: Update the account-status pill to use the charge-off status
whenever loanDetailsData.chargedOff is true: display the translated
labels.status.Charged Off text and apply the charge-off class through
iconLoanStatusColor(). Preserve the existing status value and styling for
non-charged-off loans, updating the relevant template binding and
iconLoanStatusColor logic.

In
`@src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.html`:
- Line 72: Replace the charge-off template’s gap-5px utility with an 8px-grid
spacing utility. In src/app/loans/loans-view/loans-view.component.scss lines
20-22, update the status-pill margin, padding, and radius to grid-aligned values
using shared SCSS tokens where available; in lines 69-70, likewise update the
badge padding and radius. Apply the requested changes at all three listed sites.

In
`@src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.html`:
- Line 11: Update the undo charge-off dialog template to remove the literal
question mark and pass punctuation through the translation key. Modify the
corresponding translation catalog value for “labels.dialogContext.Are you sure
you want to undo the charge-off” so it contains the complete, locale-specific
question sentence, including appropriate punctuation and spacing.

In `@src/assets/translations/cs-CS.json`:
- Line 1835: Update the Czech translation entries for “Charge-off reason” and
the related fraud-charge label near this translation block: use “Důvod odpisu”
for the charge-off reason and replace “Poplatek za podvody” with the approved
Czech expense wording, such as “Náklady na podvod”.

In `@src/assets/translations/de-DE.json`:
- Line 827: Replace the German “Charge-off” translation value "Abladen" with the
established financial terminology used by nearby entries, such as “Abschreibung”
or its appropriate grammatical form. Update all related charge-off labels,
status, confirmation, and menu entries—including menus["Charge-Off"] and
menus["Undo Charge-Off"]—to consistently use the existing Abschreibung
terminology.

In `@src/assets/translations/es-CL.json`:
- Line 825: In src/assets/translations/es-CL.json at lines 825-825, 1833-1838,
3419-3419, and 3469-3469, standardize every charge-off catalog, menu, input,
status, dialog, and permission translation on one approved Chilean Spanish term;
replace the mixed Cancelación/Cancelado and Castigo/Deshacer Castigo variants
consistently, preserving the intended distinction from loan cancellation.

In `@src/assets/translations/es-MX.json`:
- Line 827: Update the charge-off translations in
src/assets/translations/es-MX.json at lines 827, 1840-1845, 3423, and 3473: use
distinct approved es-MX charge-off terminology rather than
cancellation/write-off wording, and replace expense-label “Cargo” terms with
“Gasto.” Confirm every affected label, including “Charge-off,” “Charged Off,”
and the undo confirmation, against the approved accounting glossary.

In `@src/assets/translations/fr-FR.json`:
- Line 825: Update the French translations for the Charge-off workflow,
including the "Charge-off" entry and the referenced related entries, replacing
amortization terms such as "Amortir" and "Amorti" with the established
charge-off terminology used elsewhere in the file: "Radier", "Montant radié",
"Date de radiation", "Radié le", "Radié", and "annuler la radiation" as
appropriate to each message.

In `@src/assets/translations/it-IT.json`:
- Line 825: Use one approved Italian term for the Charge-off workflow throughout
src/assets/translations/it-IT.json: update lines 825-825, 1833-1838, 3417-3417,
and 3467-3467 so the action, fields, status, and undo confirmation consistently
use the approved charge-off terminology rather than “addebito.”

In `@src/assets/translations/ko-KO.json`:
- Around line 1834-1839: Update the Korean translations for “Charge-Off Date”
and “Charged Off On” so their visible labels are clearly distinct: use wording
for the former that denotes the effective/input charge-off date and wording for
the latter that denotes the charged-off display date. Leave the other charge-off
translations unchanged.
- Line 2863: Update the Korean translation for “Reversal External Id” to use the
approved transaction-reversal terminology, matching the term used by the
`Reversed` translation or glossary (such as `반대`) instead of `취소`. Preserve the
existing translation key and JSON structure.
- Line 825: Update the “Charge-off” translation in the Korean locale to use the
same `상각` term as the related charge-off labels, including the existing
translation at line 1836, so all labels for this action are consistent.

In `@src/assets/translations/lt-LT.json`:
- Line 825: Use consistent Lithuanian charge-off terminology throughout
src/assets/translations/lt-LT.json: at lines 825-825 replace “Atsakingas už”
with “Nurašymas”; at lines 1832-1837 use “Nurašyta suma”, “Nurašymo data”, and
“Nurašyta”; at line 3417 use the approved Lithuanian “Charged Off” status; and
at lines 3467-3467 use “Ar tikrai norite atšaukti nurašymą?”.

In `@src/assets/translations/lv-LV.json`:
- Around line 1835-1837: Update the Latvian values for “Charge-off reason”,
“ChargeOff Expense”, and “ChargeOff Fraud Expense” to use the catalog’s
established “Norakstīšana”/“Norakstīts” terminology; preserve the fraud
qualifier in the final label while replacing the inconsistent “Izmaksas” and
“Atstāj” wording.

In `@src/assets/translations/ne-NE.json`:
- Around line 1832-1837: Update the `ChargeOff Fraud Expense` translation in
`ne-NE.json` to use a Nepali noun phrase meaning “charge-off fraud expense,” not
an imperative meaning “charge the fraud expense”; preserve the `चार्ज-अफ`
wording used by the adjacent charge-off labels.

In `@src/assets/translations/pt-PT.json`:
- Line 825: Use consistent Portuguese charge-off terminology in
src/assets/translations/pt-PT.json: change line 825 to “Baixa”, lines 1832-1837
to “Valor baixado”, “Data de baixa”, and “Baixado em”, line 3417 to “Baixado”,
and line 3467 to “desfazer a baixa”.

In `@src/assets/translations/sw-SW.json`:
- Around line 1832-1835: Update src/assets/translations/sw-SW.json lines
1832-1835 so “Charge-off reason”, “ChargeOff Expense”, “ChargeOff Fraud
Expense”, and “Charged Off On” consistently use the approved Swahili charge-off
term from “Reason for Charge-Off” at line 2781, preserving the charge-off
context. Also update “Charged Off” at line 3414 to use a status term distinct
from the “Disabled” translation.
🪄 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 Plus

Run ID: 5d096f01-4e95-4283-aa6e-cbd3586d3e32

📥 Commits

Reviewing files that changed from the base of the PR and between 815600b and a9286ae.

📒 Files selected for processing (28)
  • src/app/loans/common-resolvers/loan-action-button.resolver.ts
  • src/app/loans/loans-view/general-tab/general-tab.component.html
  • src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
  • src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
  • src/app/loans/loans-view/loans-view.component.html
  • src/app/loans/loans-view/loans-view.component.scss
  • src/app/loans/loans-view/loans-view.component.ts
  • src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.html
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.scss
  • src/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.ts
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.html
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.scss
  • src/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.ts
  • src/app/loans/models/working-capital/working-capital-loan-account.model.ts
  • src/assets/translations/cs-CS.json
  • src/assets/translations/de-DE.json
  • src/assets/translations/en-US.json
  • src/assets/translations/es-CL.json
  • src/assets/translations/es-MX.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/it-IT.json
  • src/assets/translations/ko-KO.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/lv-LV.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/sw-SW.json

Comment thread src/app/loans/loans-view/loans-view.component.html
Comment thread src/app/loans/loans-view/loans-view.component.html
Comment thread src/assets/translations/cs-CS.json
Comment thread src/assets/translations/lt-LT.json
Comment thread src/assets/translations/lv-LV.json
Comment thread src/assets/translations/ne-NE.json
Comment thread src/assets/translations/pt-PT.json
Comment thread src/assets/translations/sw-SW.json
@alberto-art3ch
alberto-art3ch force-pushed the WEB-657/working-capital-loan-charge-off branch from a9286ae to cdc8629 Compare August 5, 2026 03:18
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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.

1 participant