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 extractedTransferService.executeTransfer(from,to,amount,memo,initiator,idempotencyKey,bypassAuthRequired); body{fromAccountId,toAccountId,amount,memo},Idempotency-Keyhonoured. (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— changeaccounts.owner_uuid_bin(newAccountMapper.updateOwner). Guard theuq_one_personal_per_playervirtual 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+/unarchive—AccountMapper.archiveAccountexists (set is_archived=1); add the unarchive (is_archived=0).PATCH /api/v1/admin/firms/{id}— setdiscord_url/hq_region(admin version ofFirmController PATCH /firms/me; reuseFirmMapper.updateFirm, preserving display_name). (Backs "change business details like hq and discord".)
Notes
- Use the existing
AdminFirmController/AdminFirmServicepattern (or a siblingAdminAccountController/service). Keep@Hidden. executeTransferalready 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
- PR · merged#25 Release develop → main: admin tools batch (PAR-219/220/221/222/224)MCCitiesNetwork/economy-explorer
- commit20c1582 Admin tools: move money, account mgmt, ledger filtering, firm details + reports (PAR-219/220/221/222/224)MCCitiesNetwork/economy-explorer
- commita621f26 Merge pull request #16 from MCCitiesNetwork/developMCCitiesNetwork/treasury-rest-api
- commit3f8d8e1 Admin write endpoints: arbitrary transfer, account rename/owner/archive, firm details (PAR-217)MCCitiesNetwork/treasury-rest-api
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