Phase 4.3 — AccountService (Claude)
Implement AccountService in backend/src/services/mod.rs.
Methods
create_account(pool, user_id, req) -> anyhow::Result<Account> — uses a DB transaction to insert the account and write an audit log entry atomically
get_account(pool, user_id, account_id) -> anyhow::Result<Option<Account>>
list_accounts(pool, user_id) -> anyhow::Result<Vec<Account>>
update_account_balance(pool, account_id, new_balance) -> anyhow::Result<Account>
Prerequisite: Phase 3 models + Phase 4.1 UserService.
Phase 4.3 — AccountService (Claude)
Implement
AccountServiceinbackend/src/services/mod.rs.Methods
create_account(pool, user_id, req) -> anyhow::Result<Account>— uses a DB transaction to insert the account and write an audit log entry atomicallyget_account(pool, user_id, account_id) -> anyhow::Result<Option<Account>>list_accounts(pool, user_id) -> anyhow::Result<Vec<Account>>update_account_balance(pool, account_id, new_balance) -> anyhow::Result<Account>Prerequisite: Phase 3 models + Phase 4.1 UserService.