feat(admin): manual full-order refund + ledger CSV export #233

Merged
developer merged 1 commits from feature/e7-refund-export into development 2026-07-10 04:52:49 +00:00
Owner

Final slice of the admin / reports / catalog work (#230 panel, #231 catalog, #232 grant + hint fix) — closes E7.

Manual refund (full order)

Each fund row on the /_gm finance panel gains a Refund action
(payments.RefundOrderFull): a full-order refund the operator records after doing the actual
money refund on the rail (Robokassa cabinet / VK support / Telegram refundStarPayment). It writes
a refund ledger row and revokes the funded chips floored at 0 (never negative — D27); chips
already spent become a recorded loss + abuse flag. Idempotent — a second refund of the same order
reports already-refunded (unique on (admin, order_id)).

Ledger CSV export

/_gm/ledger.csv (payments.LedgerExport) streams the whole append-only ledger (all accounts,
newest first) as a CSV attachment — tax reporting + future rail reconciliation.

Tests

  • TestConsoleRefundAndExport — fund → refund in full (100 chips revoked, a refund row) → idempotent
    second refund → the CSV export carries the fund + refund rows; the refund POST is CSRF-guarded.
  • Full backend unit + integration green; build/vet/gofmt clean.
Final slice of the admin / reports / catalog work (#230 panel, #231 catalog, #232 grant + hint fix) — closes E7. ## Manual refund (full order) Each **fund** row on the `/_gm` finance panel gains a **Refund** action (`payments.RefundOrderFull`): a full-order refund the operator records **after** doing the actual money refund on the rail (Robokassa cabinet / VK support / Telegram `refundStarPayment`). It writes a `refund` ledger row and revokes the funded chips **floored at 0** (never negative — D27); chips already spent become a recorded loss + abuse flag. Idempotent — a second refund of the same order reports already-refunded (unique on `(admin, order_id)`). ## Ledger CSV export `/_gm/ledger.csv` (`payments.LedgerExport`) streams the **whole** append-only ledger (all accounts, newest first) as a CSV attachment — tax reporting + future rail reconciliation. ## Tests - `TestConsoleRefundAndExport` — fund → refund in full (100 chips revoked, a refund row) → idempotent second refund → the CSV export carries the fund + refund rows; the refund POST is CSRF-guarded. - Full backend unit + integration green; build/vet/gofmt clean.
developer added 1 commit 2026-07-10 04:46:32 +00:00
feat(admin): manual full-order refund + ledger CSV export
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 22s
CI / ui (pull_request) Has been skipped
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m53s
1bf612a087
Closes the admin / reports / catalog work. Each fund row on the /_gm finance
panel gains a Refund action (payments.RefundOrderFull): a full-order refund the
operator records after refunding on the rail — a refund ledger row + a floor-0
chip revoke (never negative, D27), idempotent (a second refund reports
already-refunded). A ledger CSV export (/_gm/ledger.csv, payments.LedgerExport)
streams the whole append-only ledger for tax + reconciliation.

Tests: refund an order in full (chips revoked, a refund row), an idempotent
second refund, the CSV export shape; CSRF-guarded.
owner approved these changes 2026-07-10 04:52:40 +00:00
developer merged commit 2e5136b22a into development 2026-07-10 04:52:49 +00:00
developer deleted branch feature/e7-refund-export 2026-07-10 04:52:49 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#233