Paradaux
IssuesPAR-140Pending Release
0

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 ownerupdateAccount 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) — dedicated UPDATE accounts SET owner_uuid_bin = ? WHERE account_id = ? (kept separate from updateAccount so 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-api and delegated in TreasuryApiImpl.
  • Owner row actually changes; isOwnerForAccountId(newOwner) true, old owner false afterwards.
  • Unit/IT coverage for the new path.

Comments

No comments yet.

Activity

  • tesks changed status to Status → Pending ReleaseJun 11, 2026, 10:35 AM
  • ParadauxIO linked a commit — Commit fa4c3ec — Reconcile Treasury access on proprietorship transfer & role changes (PAR-141)Jun 11, 2026, 10:35 AM
  • tesks created the issueJun 11, 2026, 10:22 AM