# Multi-Wallet Phase Tracker

Reference index: docs/multi-wallet/README.md

## 1. Tracker Usage
- Update at least weekly or at sprint close.
- Allowed status values: not-started, in-progress, blocked, done.
- Every done milestone must include evidence (PR, test run, runbook, or doc link).

## 2. Program Snapshot
- Program start date: 2026-03-30
- Current status: in-progress
- Current phase: Phase 8 (done) → Phase 9 next
- Next review date: 2026-04-06
- Release target date: TBD

## 3. Phase Status Board
| Phase | Name | Status | Start | Target End | Owner | Exit Criteria Met | Notes |
|---|---|---|---|---|---|---|---|
| 1 | Discovery and Gap Mapping | done | 2026-03-30 | 2026-03-30 | Architecture + Product | yes | All 4 deliverables complete |
| 2 | Domain Contract and ADR Alignment | done | 2026-03-30 | 2026-03-30 | Architecture + Domain Leads | yes | 3 deliverables complete, all 5 ADRs conformant |
| 3 | Persistence and Migration Foundation | done | 2026-03-30 | 2026-03-30 | Database + Platform | yes | 8 migrations, 5 new schemas, 4 updated schemas, migration runbook |
| 4 | Wallet Product and Sub-wallet Domain Services | done | 2026-03-31 | 2026-03-31 | Accounts + Transfers | yes | 3 structs + 3 ETS stores + 10 events + 11 commands + 4 queries; 39 tests, 0 failures |
| 5 | Ledger Transactions and Idempotency Controls | done | 2026-03-31 | 2026-03-31 | Ledger + Platform | yes | IdempotencyStore + SubWalletTransfer + GetSubWalletBalance; 24 tests, 0 failures |
| 6 | API and Channel Integration | done | 2026-03-31 | 2026-03-31 | API + Wallet Web | yes | 3 API controllers + 2 customer LiveViews + 1 admin LiveView + router + 17 tests |
| 7 | Eventing, Observability, Compliance Hardening | done | 2026-03-31 | 2026-03-31 | Observability + Security + Compliance | yes | MultiWalletTelemetry (12 typed events) + 4 compliance controls + event-audit-matrix; 27 tests, 0 failures |
| 8 | E2E Validation and Release Readiness | done | 2026-03-31 | 2026-03-31 | QA + SRE + Product | yes | MultiWalletReadinessProbe + 7 E2E scenarios + release-readiness-checklist (GO decision); 14 new tests, 132 total across Phases 4-8, 0 failures |
| 9 | Rollout, Migration, and Hypercare | not-started | TBD | TBD | Operations + Platform | no | Safe rollout and stabilization |

## 4. Cross-Phase Milestones
- [x] M1: Product scope and non-goals signed off
- [x] M2: Domain model approved and traceable to APIs
- [x] M3: Database migrations applied in lower environments
- [x] M4: Core transaction flows pass invariants and idempotency tests
- [x] M5: API and UI journeys validated
- [x] M6: Observability, audit, and compliance evidence complete
- [x] M7: Release readiness gate approved
- [ ] M8: Production rollout complete with hypercare closure

## 5. Risk Register
| Risk ID | Description | Impact | Mitigation | Owner | Status |
|---|---|---|---|---|---|
| R1 | Existing table model diverges from suggested model | High | Phase 1 mapping and compatibility design | Architecture | **mitigated** — all 11 gaps have resolution paths, no incompatible blockers |
| R2 | Data migration causes downtime or lock contention | High | Online migration strategy and rollback rehearsal | Platform + DBA | **mitigated** — all ALTER TABLE ops are nullable-column adds (metadata-only on InnoDB); rollback matrix and backfill idempotency in migration-plan-and-runbook.md |
| R3 | Cross-currency behavior regression in existing flows | High | Contract tests and E2E regression pack | QA + Payments | **mitigated** — E2E scenarios test currency-scoped sub-wallet transfers; currency mismatch validated in sub_wallet_transfer_test.exs |
| R4 | Idempotency gaps in transfer or FX paths | High | Mandatory idempotency tests and replay checks | Platform | **mitigated** — TransferBetweenSubWallets requires idempotency_key; contract defined in Phase 2 |
| R5 | Incomplete audit trail for regulated events | Medium | Event/audit matrix and compliance review | Compliance | **mitigated** — event-audit-matrix.md complete; all 11 accounts + 2 transfer outcomes emit audit; 4 controls registered in ControlCatalog |

## 6. Evidence Log
| Date | Phase | Evidence Type | Link | Owner |
|---|---|---|---|---|
| 2026-03-30 | 1 | Requirements Spec | docs/multi-wallet/deliverables/multiwallet-requirements-spec.md | Architecture |
| 2026-03-30 | 1 | Capability Matrix | docs/multi-wallet/deliverables/capability-matrix.md | Architecture + Product |
| 2026-03-30 | 1 | Ownership Map + Gap Analysis | docs/multi-wallet/deliverables/repository-ownership-map.md | Architecture + Database |
| 2026-03-30 | 2 | Domain State Machines | docs/multi-wallet/deliverables/domain-state-machines.md | Architecture |
| 2026-03-30 | 2 | Command/Query/Event Contracts | docs/multi-wallet/deliverables/command-query-event-contracts.md | Architecture + Domain Leads |
| 2026-03-30 | 2 | ADR Conformance Notes | docs/multi-wallet/deliverables/adr-conformance-notes.md | Architecture |
| 2026-03-30 | 3 | 8 Migration Files | apps/wallet_database/priv/repo/migrations/20260330{150000..220000}_*.exs | Database |
| 2026-03-30 | 3 | 5 New Ecto Schemas | apps/wallet_database/lib/wallet_database/schemas/accounts/{wallet_product_type,wallet_product,sub_wallet,wallet_currency_config}.ex + schemas/ledger/sub_wallet_transaction.ex | Database |
| 2026-03-30 | 3 | 4 Updated Ecto Schemas | accounts/account.ex + ledger/{entry,balance}.ex + transfers/transfer.ex | Database |
| 2026-03-30 | 3 | Migration Runbook | docs/multi-wallet/deliverables/migration-plan-and-runbook.md | Platform + DBA |
| 2026-03-31 | 4 | Domain Structs | apps/wallet_accounts/lib/wallet_accounts/{wallet_product,sub_wallet,currency_config}.ex | Accounts Domain |
| 2026-03-31 | 4 | ETS Stores | apps/wallet_accounts/lib/wallet_accounts/{wallet_product_store,sub_wallet_store,currency_config_store}.ex | Accounts Domain |
| 2026-03-31 | 4 | Domain Events (10) | apps/wallet_accounts/lib/wallet_accounts/events/{wallet_product_*,sub_wallet_*,currency_config_added}.ex | Accounts Domain |
| 2026-03-31 | 4 | Commands (11) | apps/wallet_accounts/lib/wallet_accounts/commands/{create,freeze,unfreeze,close,update}_wallet_product.ex + {create,freeze,unfreeze,close,update}_sub_wallet.ex + add_currency_config.ex | Accounts Domain |
| 2026-03-31 | 4 | Queries (4) | apps/wallet_accounts/lib/wallet_accounts/queries/{get_wallet_product,list_wallet_products,list_sub_wallets,list_currency_configs}.ex | Accounts Domain |
| 2026-03-31 | 4 | Tests | apps/wallet_accounts/test/wallet_accounts/wallet_product_domain_test.exs (39 tests, 0 failures) | Accounts Domain |
| 2026-03-31 | 5 | IdempotencyStore | apps/wallet_state/lib/wallet_state/idempotency_store.ex (register/store_result/reset; new/replay/conflict/in_flight) | Platform |
| 2026-03-31 | 5 | WalletState Application | apps/wallet_state/lib/wallet_state/application.ex + mix.exs updated | Platform |
| 2026-03-31 | 5 | SubWalletTransfer struct | apps/wallet_transfers/lib/wallet_transfers/sub_wallet_transfer.ex (new/complete/fail; typed ID swt_) | Transfers |
| 2026-03-31 | 5 | SubWalletTransferStore | apps/wallet_transfers/lib/wallet_transfers/sub_wallet_transfer_store.ex (ETS; idx by from_id + to_id) | Transfers |
| 2026-03-31 | 5 | Transfer Events (3) | apps/wallet_transfers/lib/wallet_transfers/events/sub_wallet_transfer_{initiated,completed,failed}.ex | Transfers |
| 2026-03-31 | 5 | TransferBetweenSubWallets command | apps/wallet_transfers/lib/wallet_transfers/commands/transfer_between_sub_wallets.ex (DI: resolver/balance_checker/ledger_poster) | Transfers |
| 2026-03-31 | 5 | GetSubWalletBalance query | apps/wallet_ledger/lib/wallet_ledger/queries/get_sub_wallet_balance.ex (credits − debits) | Ledger |
| 2026-03-31 | 5 | Tests (24) | idempotency_store_test.exs (10) + get_sub_wallet_balance_test.exs (7) + sub_wallet_transfer_test.exs (16) — 0 failures | Platform + Ledger + Transfers |
| 2026-03-31 | 6 | API Controllers (3) | apps/wallet_web/lib/wallet_web/controllers/api/{wallet_products,sub_wallets,currency_configs}_controller.ex | API Team |
| 2026-03-31 | 6 | Customer LiveViews (2) | apps/wallet_web/lib/wallet_web/live/customer/{wallet_products,sub_wallets}_live.ex | Wallet Web |
| 2026-03-31 | 6 | Admin LiveView (1) | apps/wallet_web/lib/wallet_web/live/admin/wallet_products_admin_live.ex | Wallet Web |
| 2026-03-31 | 6 | Router + Navigation | /api/v1/wallet-products + /app/wallet-products + /admin/wallet-products routes; CustomerMenu + AdminMenu entries | API + Wallet Web |
| 2026-03-31 | 6 | Policy | view_wallet_products + manage_wallet_products + manage_sub_wallets actions added to customer role | Platform |
| 2026-03-31 | 6 | Tests (17) | wallet_products_controller_test.exs (9) + sub_wallets_controller_test.exs (10) — 0 failures | API Team |
| 2026-03-31 | 7 | Audit gap fix | apps/wallet_transfers/lib/wallet_transfers/commands/transfer_between_sub_wallets.ex — failure path now emits `[:wallet_transfers, :audit]` with :failure outcome | Transfers + Compliance |
| 2026-03-31 | 7 | MultiWalletTelemetry handler | apps/wallet_accounts/lib/wallet_accounts/telemetry/multi_wallet_telemetry.ex — attach/detach/handle_event; 12 typed metric events | Observability |
| 2026-03-31 | 7 | Compliance controls (4) | WalletCompliance.ControlCatalog — CTRL-MWF-001, CTRL-MWT-001, CTRL-MWT-002, CTRL-MWB-001 added to :multi_wallet domain | Compliance |
| 2026-03-31 | 7 | Event/Audit Matrix | docs/multi-wallet/deliverables/event-audit-matrix.md — full coverage map + compliance cross-reference | Observability + Compliance |
| 2026-03-31 | 7 | Tests (27) | multi_wallet_telemetry_test.exs (15) + multi_wallet_controls_test.exs (6) + sub_wallet_transfer_audit_test.exs (6) — 0 failures | Observability + Compliance + Transfers |
| 2026-03-31 | 8 | MultiWalletReadinessProbe | apps/wallet_web/lib/wallet_web/readiness/multi_wallet_readiness_probe.ex — 5-check subsystem health probe (stores + telemetry + controls) | SRE + Platform |
| 2026-03-31 | 8 | E2E Tests (10) | apps/wallet_web/test/wallet_web/e2e/multi_wallet_e2e_test.exs — 7 scenarios (creation journey, transfer, idempotency replay, freeze, unfreeze, close, readiness) | QA + All Domains |
| 2026-03-31 | 8 | Readiness Probe Tests (4) | apps/wallet_web/test/wallet_web/readiness/multi_wallet_readiness_probe_test.exs — check/0 happy/fail + details/0 healthy/degraded | SRE |
| 2026-03-31 | 8 | Release Readiness Checklist | docs/multi-wallet/deliverables/release-readiness-checklist.md — 5 sections, 132 tests, 0 failures, GO decision | Program Lead + Product |
