Skip to content

refactor(web): reconcile sales:status* duplicate onto shared enums:status (#182) - #254

Merged
mforce merged 1 commit into
mainfrom
f182-sales-status-enums
Jul 28, 2026
Merged

mforce merged 1 commit into
mainfrom
f182-sales-status-enums

Conversation

@mforce

@mforce mforce commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Closes the "Reconcile the temporary sales:status* duplicate into a then-translated shared enums:status" follow-up tracked on #182.

What

The SalesPage status-filter dropdown (4 options) and the voided-payment badge rendered their labels from sales-local statusDraft/statusConfirmed/statusCancelled/statusVoided keys — a translated duplicate of enums:status.{Draft,Confirmed,Cancelled,Voided}. That duplicate existed only to avoid English-only labels back when enums wasn't translated; since enums joined TRANSLATED_NAMESPACES it's dead weight.

  • SalesPage.tsx — 5 sites now render via statusLabel(...) (already imported and used elsewhere on the screen for the order-row badges). Option values (the server filter param) are untouched.
  • en/es/tl — delete the 4 sales keys. Keep sales:allOption (filter-only "no status filter" chrome — no enums equivalent).

Behavior-preserving

enums:status values are byte-identical to the removed sales values in all three packs:

Draft Confirmed Cancelled Voided
en Draft Confirmed Cancelled Voided
es Borrador Confirmado Cancelado Anulado
tl Draft Kumpirmado Kinansela Na-void

Tests

  • New wiring test: overriding enums:status.Confirmed flows through to the filter option text while its value stays the raw "Confirmed" code (mirrors the AuditPage precedent). Mutation-probed — hardcoding the label fails it.
  • npm run test 1141 green · typecheck clean · build succeeds · i18n:scan still 3 (false positives) · catalogParity green (packs stay symmetric).

Scope

HistoryPage's separate history:status* set (its own vocabulary incl. statusSubmitted) is out of scope — the tracker item names sales specifically.

Not included

Unrelated local working-tree edits (deploy/docker-compose.yml, web/vite.config.ts) are deliberately not in this branch.

…atus (#182)

The SalesPage status-filter dropdown and the voided-payment badge rendered
their labels from sales-local statusDraft/statusConfirmed/statusCancelled/
statusVoided keys — a translated duplicate of enums:status.{Draft,Confirmed,
Cancelled,Voided}. Since enums joined TRANSLATED_NAMESPACES the duplicate is
no longer needed to avoid English-only labels.

- SalesPage: 5 sites now render via statusLabel(...) (already imported/used
  elsewhere on the screen); option VALUEs (the server filter param) unchanged.
- Delete the 4 sales keys from en/es/tl; keep sales:allOption (filter-only
  chrome with no enums equivalent). Behavior-preserving: enums:status values
  are byte-identical to the removed sales values in all three packs.
- Add a wiring test proving the filter option TEXT reads enums:status while
  its VALUE stays the raw code (mutation-probed).

Closes the 'reconcile sales:status* duplicate' follow-up tracked on #182.
HistoryPage's separate history:status* set is out of scope (own vocabulary).
@mforce

mforce commented Jul 28, 2026

Copy link
Copy Markdown
Owner Author

Review — unanimous approve (codex + 2 Claude agents + pi)

Reviewer Verdict
codex ✅ approve — no correctness findings
pi ✅ approve — caveats were all verify-outside-diff, pre-satisfied
Claude (spec/correctness) ✅ approve — 8/8 checks green
Claude (adversarial) ✅ approve — no issues at confidence ≥ 80

Independently confirmed by reviewers:

  • Byte-identity of enums:status.{Draft,Confirmed,Cancelled,Voided} vs the removed sales:status* in all three packs (en/es/tl) — no silent translation drift.
  • Option value= attributes stay the raw status code (server filter param); only the child label changed.
  • statusLabel imported and already used elsewhere on the screen; all four values are valid StatusValues (fallback path never hit).
  • Wiring test is a real mutation-catcher, not a tautology: keySeparator:false makes "status.Confirmed" a literal key, so the override lands exactly where statusLabel reads; a hardcoded label or re-added local key would make the marker absent and the assertion throw.
  • No other consumers of the deleted keys — HistoryPage's history:status* is a separate, out-of-scope namespace; Dashboard already uses statusLabel.
  • Voided-payment badge: not a new semantic change — badge and dropdown already shared the same sales:statusVoided string; both now resolve to the byte-identical enums value.

Non-blocking suggestion (pi): a future multi-site/multi-locale test (voided badge + es/tl) would add breadth. The single wiring test + the removal's symmetry (caught by catalogParity) cover the regression surface for now.

Verified: npm run test 1141 green · typecheck clean · build ok · i18n:scan still 3 (false positives).

@mforce
mforce merged commit a5e0d59 into main Jul 28, 2026
7 checks passed
@mforce
mforce deleted the f182-sales-status-enums branch July 28, 2026 06:48
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