Paradaux

PAR-217

0

Admin write endpoints (SERVICE-scoped): arbitrary transfer, account rename/owner/archive, firm details

DoneUnassignedTreasury APIFeature

Backend tranche for the next batch of economy-explorer admin tools — extends the PAR-210 SERVICE-scoped, @Hidden admin surface with the ledger-authoritative mutations the UIs need. All gated by requireServiceKey, controller→service→mapper, server-side audited/logged, excluded from OpenAPI.

Endpoints

  • POST /api/v1/admin/transfers — move money between arbitrary accounts with a memo. Reuse the extracted TransferService.executeTransfer(from,to,amount,memo,initiator,idempotencyKey,bypassAuthRequired); body {fromAccountId,toAccountId,amount,memo}, Idempotency-Key honoured. (Backs "move money between accounts with memo".)
  • PATCH /api/v1/admin/accounts/{id}/display-name — rename any account (AccountMapper.updateAccountDisplayName, currently firm-scoped via FirmService). Validate ≤255.
  • PATCH /api/v1/admin/accounts/{id}/owner — change accounts.owner_uuid_bin (new AccountMapper.updateOwner). Guard the uq_one_personal_per_player virtual unique index: refuse to set a PERSONAL account's owner to a player who already has one (mirror PAR-140's BUSINESS-account scope guard). Resolve owner by UUID or name (firm_players).
  • POST /api/v1/admin/accounts/{id}/archive + /unarchiveAccountMapper.archiveAccount exists (set is_archived=1); add the unarchive (is_archived=0).
  • PATCH /api/v1/admin/firms/{id} — set discord_url / hq_region (admin version of FirmController PATCH /firms/me; reuse FirmMapper.updateFirm, preserving display_name). (Backs "change business details like hq and discord".)

Notes

  • Use the existing AdminFirmController/AdminFirmService pattern (or a sibling AdminAccountController/service). Keep @Hidden.
  • executeTransfer already supports arbitrary from/to + bypassAuth; admin transfer should NOT bypass auth-required by default (that's a deliberate flag) — decide per endpoint; default false for the generic admin transfer, surface a clear error if an account requires an in-game authorizer.
  • Tests in the AdminFirmServiceIT / embedded-MariaDB style: transfer between accounts, rename, owner change (incl. the personal-uniqueness guard), archive/unarchive round-trip, firm details update, and SERVICE-key gating (403 for non-SERVICE).

Consumed by the explorer admin tools (sibling Economy Explorer issues).

Resources

Comments

No comments yet.

Activity

  • ParadauxIO linked a pull request — PR #25 merged — Release develop → main: admin tools batch (PAR-219/220/221/222/224)
  • ParadauxIO linked a commit — Commit 20c1582 — Admin tools: move money, account mgmt, ledger filtering, firm details + reports (PAR-219/220/221/222/224)
  • ParadauxIO linked a commit — Commit a621f26 — Merge pull request #16 from MCCitiesNetwork/develop
  • ParadauxIO linked a commit — Commit 3f8d8e1 — Admin write endpoints: arbitrary transfer, account rename/owner/archive, firm details (PAR-217)
  • ParadauxIO changed status to Status → Done
  • ParadauxIO linked a pull request — PR #25 open — Release develop → main: admin tools batch (PAR-219/220/221/222/224)
  • ParadauxIO linked a commit — Commit 20c1582 — Admin tools: move money, account mgmt, ledger filtering, firm details + reports (PAR-219/220/221/222/224)
  • tesks changed status to Status → Pending Release
  • ParadauxIO linked a commit — Commit 3f8d8e1 — Admin write endpoints: arbitrary transfer, account rename/owner/archive, firm details (PAR-217)
  • tesks changed status to Status → In Progress
  • tesks created the issue