Skip to content

MPDX-9657 Frontend - Add localized labels for missing staff expense categories and subcategories#1823

Merged
zweatshirt merged 1 commit into
mainfrom
staff-expense-category
Jun 5, 2026
Merged

MPDX-9657 Frontend - Add localized labels for missing staff expense categories and subcategories#1823
zweatshirt merged 1 commit into
mainfrom
staff-expense-category

Conversation

@zweatshirt

@zweatshirt zweatshirt commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description

Testing

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels (Add the label "Preview" to automatically create a preview environment)
  • I have run the Claude Code /pr-review command locally and fixed any relevant suggestions
  • I have requested a review from another person on the project
  • I have tested my changes in preview or in staging
  • I have cleaned up my commit history

@zweatshirt zweatshirt self-assigned this Jun 5, 2026
@zweatshirt zweatshirt added the Preview Environment Add this label to create an Amplify Preview label Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Preview branch generated at https://staff-expense-category.d3dytjb8adxkk5.amplifyapp.com

@zweatshirt zweatshirt added the Staging API Run GraphQL codegen against the staging API label Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against 2d5c268

No significant changes found

@zweatshirt zweatshirt marked this pull request as ready for review June 5, 2026 14:21

@zweatshirt zweatshirt left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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: StaffExpenseCategoryEnum 13/13 and StaffExpensesSubCategoryEnum 74/74 mapped, zero gaps/drift. The Record<Enum, string> typing makes tsc enforce this regardless.
  • i18n correct — all 8 strings use t('literal') with static keys; yarn extract will pick them up. No interpolation, no dynamic keys.
  • Label conventions'PA Card' keeps PA uppercase (matches existing Earnings MHA/REG/Other ER Charges); 'Staff Card' correctly splits the collapsed STAFFCARD token.
  • 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 same other bucket they already fell into via the Unknown Category fallback. 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 — see src/lib/functions/getLocalizedReminderStatus.test.ts (an it.each over enum→label pairs). Optional to mirror; TypeScript's exhaustive Record check 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.

@zweatshirt zweatshirt removed the Staging API Run GraphQL codegen against the staging API label Jun 5, 2026
@zweatshirt zweatshirt force-pushed the staff-expense-category branch from 6d0b69f to 2205717 Compare June 5, 2026 14:58

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zweatshirt zweatshirt merged commit fead42f into main Jun 5, 2026
23 of 24 checks passed
@zweatshirt zweatshirt deleted the staff-expense-category branch June 5, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Preview Environment Add this label to create an Amplify Preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant