WEB-657: Working Capital Loan - Charge-Off - #3790
Conversation
|
Note
|
| 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.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
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
📒 Files selected for processing (28)
src/app/loans/common-resolvers/loan-action-button.resolver.tssrc/app/loans/loans-view/general-tab/general-tab.component.htmlsrc/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.scsssrc/app/loans/loans-view/loans-view.component.tssrc/app/loans/loans-view/transactions-tab/transactions-tab.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/charge-off/charge-off.component.tssrc/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.htmlsrc/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.scsssrc/app/loans/loans-view/working-capital/loan-account-actions/undo-charge-off-dialog/undo-charge-off-dialog.component.tssrc/app/loans/models/working-capital/working-capital-loan-account.model.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
a9286ae to
cdc8629
Compare
|
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. |
Description
Allow to mark a Working Capital Loan as Charg-Off and Undo Charge-Off
Related issues and discussion
WEB-657
Screenshots
Screen.Recording.2026-08-03.at.5.31.58.PM.mov
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