# WalletAccounts

OTP application managing wallet account lifecycle within the MercuryPay umbrella.

## Public Interface

```elixir
# Open a new account
WalletAccounts.open_account(user_id, currency, opts)

# Freeze / unfreeze
WalletAccounts.freeze_account(account_id, reason, frozen_by, opts)
WalletAccounts.unfreeze_account(account_id, actor_id, opts)

# Tier management
WalletAccounts.update_tier(account_id, new_tier, actor_id, opts)

# Queries
WalletAccounts.get_account(account_id)
WalletAccounts.get_accounts_by_user(user_id)
WalletAccounts.get_status(account_id)
```

## Responsibilities
- Account lifecycle: open, freeze, unfreeze, tier changes.
- Account status queries.
- Freeze controls with reason and actor tracking.

## Forbidden Dependencies
- **wallet_ledger** — no direct ledger writes from this app.
- **wallet_auth** — no auth logic in this app.

## Dependencies
- `wallet_shared_kernel` — TypedId, Money, Correlation.
- `wallet_api_contracts` — error codes.
- `wallet_observability` — AuditEvent, Telemetry.
- `wallet_events` — DomainEvent behaviour.
- `phoenix_pubsub` — domain event broadcast.

## TypedId Prefix
- `acc_` — wallet accounts.

## Events Emitted
- `WalletAccountOpened.v1`
- `WalletAccountFrozen.v1`
- `WalletAccountUnfrozen.v1`
- `WalletTierUpdated.v1`

## Store
`WalletAccounts.AccountStore` — ETS-backed GenServer. No database required for CI.
