a70276af - Add compliance screen for chargebacks awaiting manual approval - #1285
Conversation
The automatic chargeback release jobs skip cases whose preconditions do not
hold, and since the external tracking sheet was retired nothing surfaces that
backlog. Add a compliance list screen consuming GET /support/pending-chargebacks:
one row per stuck case with its block reasons, the verified/complete/creditor
names side by side for name mismatches, a distinct row style for blocked or
risk-flagged customers, a visible error marker should a listed case already
carry a chargebackDate, and a row link to the existing approval screen at
compliance/bank-tx/{txId}/return. Registered under compliance/pending-chargebacks
and in the sitemap. (#1278)
…dbook artifacts Loading, error and loaded content now render mutually exclusively - after a failed fetch the screen no longer claims 'No pending chargebacks found' next to the error hint. The warning styles move onto the palette this repository actually generates (dfxRed/dfxYellow); the previous default-palette classes do not exist here and rendered no color at all. Unit tests bring the screen to full statement, branch, function and line coverage and pin the hook contract; the DTO measures like every sibling DTO file. A Playwright spec with synthetic fixtures plus committed baselines and a handbook metadata entry cover the new screen's visual variants (block reasons, three-name comparison, blocked-user row, chargebackDate sentinel, empty state).
|
Three review passes to zero findings. Fixed along the way: the NAME_MISMATCH name triple no longer wraps onto separate lines; loading, error and loaded content now render mutually exclusively (a failed fetch no longer shows the empty-state text next to the error); the warning styles moved onto the palette this repo actually generates — One conformity note, resolved as out of scope: |
|
One note from a later read-through: the unit tests mock the API payload with |
Why
Chargebacks the automatic release jobs cannot promote wait indefinitely, and since the external tracking sheet was retired nobody sees them — the backlog is invisible and refunds sit unprocessed for weeks. The API side merged as DFXswiss/api#4729:
GET /support/pending-chargebacks(roleCOMPLIANCE) lists every stuck case with the reason(s) the automatic job cannot release it, oldest customer request first.What
A compliance list screen making that backlog actionable, following the
compliance-recall-listpattern:src/dto/chargeback.dto.ts— mirrors the API response (ChargebackBlockReason,PendingChargebackEntry).getPendingChargebacks()incompliance.hook.ts, same mechanics asgetRecalls().compliance-chargeback-list.screen.tsx— guarded byuseComplianceGuard(); columns: requested date, transaction, customer, input, chargeback, block reasons, names. The API's oldest-first order is kept, no client-side sort. Loading, error and loaded content render mutually exclusively.NameMismatchrows showverifiedName/completeName/creditorNameside by side on one line — that is the data the clerk decides on, visible without leaving the list.UserNotReleasedrows are visually distinct (yellow row, red badge): blocked or risk-flagged customers must not be waved through casually.chargebackDateis a safety sentinel and must always be empty here; if it is ever populated, the row turns red with an explicit error marker instead of hiding the inconsistency.compliance/bank-tx/{txId}/return(transaction id, not entity id).compliance/pending-chargebacks+ sitemap entry.Tests & handbook
support/pending-chargebacks, GET). The DTO file measures 0% like every sibling DTO file (repo-wide measurement artifact, e.g.recall.dto.ts).e2e/compliance-chargeback-list.spec.tswith synthetic fixtures (real admin auth, mocked endpoint) plus committedchromium-darwinbaselines for the loaded list (all row variants incl. the sentinel) and the empty state; handbook metadata entrycompliance-chargeback-list.dfxRed/dfxYellow) — the default-palette classes do not exist in this config.Notes
Closes #1278