MPDX-9657 Frontend - Add localized labels for missing staff expense categories and subcategories#1823
Conversation
|
Preview branch generated at https://staff-expense-category.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against 2d5c268 No significant changes found |
zweatshirt
left a comment
There was a problem hiding this comment.
🤖 Multi-Agent Code Review — ✅ CLEAN
Mode: standard · Agents: 4 (Standards, Testing, Architecture, Financial Reporting) · Risk: 1/10 (LOW)
No blockers and no important issues. This is a clean, type-safe, fully-localized 8-line addition; all four agents independently approved.
Verified
- Exhaustiveness confirmed — map keys diffed against the enum definitions:
StaffExpenseCategoryEnum13/13 andStaffExpensesSubCategoryEnum74/74 mapped, zero gaps/drift. TheRecord<Enum, string>typing makestscenforce this regardless. - i18n correct — all 8 strings use
t('literal')with static keys;yarn extractwill pick them up. No interpolation, no dynamic keys. - Label conventions —
'PA Card'keepsPAuppercase (matches existingEarnings MHA/REG/Other ER Charges);'Staff Card'correctly splits the collapsedSTAFFCARDtoken. - No financial impact — labels are display-only. Both consumers (
filterTransactions.tsx,MPGAIncomeExpensesReport) key grouping/summing on the raw enum; the new categories land in the sameotherbucket they already fell into via theUnknown Categoryfallback. Dollar totals unchanged.
Suggestions (informational — do not block)
- [Suggestion · 3/10] No colocated
transformStaffExpenseEnums.test.ts. Pre-existing gap (the file shipped untested). Repo convention exists — seesrc/lib/functions/getLocalizedReminderStatus.test.ts(anit.eachover enum→label pairs). Optional to mirror; TypeScript's exhaustiveRecordcheck already prevents the main risk. Reasonable to defer.
Findings on Related Files (Not in This PR)
[Pre-existing · informational] src/hooks/useExpenseCategories.ts:21-29 — Expense totals are bucketed by string-matching the localized category label against hardcoded English literals ('Ministry Reimbursement', 'Healthcare Reimbursement', 'Assessment', 'Additional Salary', 'Benefits', 'Salary'). Under any non-English locale this mis-buckets every expense subtotal into other, and it breaks if a label is reworded. Untouched by this PR — worth a separate ticket.
Generated by /quality:agent-review (standard mode). Debate rounds skipped — all findings below severity 7.
6d0b69f to
2205717
Compare
There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: LOW (1/10)
Verdict: CLEAN (no issues found)
This PR was auto-approved because:
- The multi-agent AI review determined it is low risk
- No blocking issues were found
If you believe this PR needs human review, dismiss this approval and request a review manually.
Description
Backend PR: https://github.com/CruGlobal/mpdx_api/pull/3348
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions