# WalletPrepaid

Kuwait Prepaid Card Program domain.

## Features

- **Prepaid Program Management** — Create and manage closed-loop prepaid card programs
- **Bulk Card Issuance** — CSV-based bulk issuance with 14-day SLA tracking
- **Batch Top-Up** — Statement-driven batch top-ups with 2-day SLA enforcement
- **Closed-Loop Enforcement** — Restrict purchases to designated merchant allowlist
- **Balance Sweep** — Bulk transfer of remaining balances to sponsor accounts
- **Monthly Reporting** — Comprehensive cardholder balance reports

## Architecture

- **ETS Stores** — In-memory event sourcing with MySQL write-through persistence
- **Domain Events** — All state changes emit events for audit trail
- **Command Pattern** — Idempotent commands for all operations
- **Policy Enforcement** — ClosedLoopPolicy for merchant authorization

## Dependencies

- `wallet_cards` — Card lifecycle management
- `wallet_accounts` — Account and sub-wallet operations
- `wallet_ledger` — Double-entry posting engine
- `wallet_database` — Canonical Ecto Repo and schemas
- `wallet_merchant` — POS authorization integration
- `nimble_csv` — CSV parsing for bulk operations

## Sprints

See `/docs/prepaid_card/PHASE_TRACKER.md` for detailed sprint breakdown.

## Tests

```bash
mix test apps/wallet_prepaid
```
