PAR-140
Add account-owner reassignment to TreasuryApi
Problem
canAccessAccount = isOwner OR isAuthorizer OR isMember, and isOwner reads accounts.owner_uuid_bin. There is currently no API to change an account's owner — updateAccount deliberately updates only displayName/requiresAuth/archived/overdraft/creditLimit.
This blocks Business from fully reconciling a firm-account when a firm's proprietorship is transferred: the new proprietor cannot be made owner, and the previous owner keeps owner-level access forever. See the sibling Business issue.
Change
Add a narrow public API to reassign an account's owner:
TreasuryApi.reassignOwner(int accountId, UUID newOwnerUuid)(treasury-api)AccountService.reassignOwner(int accountId, UUID newOwnerUuid)+ impl (@Transactional, validates the account exists)AccountMapper.updateOwner(accountId, ownerUuid)— dedicatedUPDATE accounts SET owner_uuid_bin = ? WHERE account_id = ?(kept separate fromupdateAccountso general updates can't accidentally move ownership)
Scope guard: intended for non-PERSONAL accounts (BUSINESS firm accounts). Do not allow it to collide with the one-PERSONAL-per-player virtual unique index — callers use it for BUSINESS accounts only.
Acceptance
- New API method present in
treasury-apiand delegated inTreasuryApiImpl. - Owner row actually changes;
isOwnerForAccountId(newOwner)true, old owner false afterwards. - Unit/IT coverage for the new path.
Resources
- commitfa4c3ec Reconcile Treasury access on proprietorship transfer & role changes (PAR-141)MCCitiesNetwork/Business
Comments
No comments yet.
Activity
- tesks changed status to Status → Pending Release
- ParadauxIO linked a commit — Commit fa4c3ec — Reconcile Treasury access on proprietorship transfer & role changes (PAR-141)
- tesks created the issue