Skip to content

[4.3] AccountService: create, get, list, update_balance #9

@lomartins

Description

@lomartins

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions