feat(admin): manual full-order refund + ledger CSV export #233
Reference in New Issue
Block a user
Delete Branch "feature/e7-refund-export"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
/_gmfinance panel gains a Refund action(
payments.RefundOrderFull): a full-order refund the operator records after doing the actualmoney refund on the rail (Robokassa cabinet / VK support / Telegram
refundStarPayment). It writesa
refundledger row and revokes the funded chips floored at 0 (never negative — D27); chipsalready 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) → idempotentsecond refund → the CSV export carries the fund + refund rows; the refund POST is CSRF-guarded.