# Gap Closure Implementation Plan (Post Phase 10A)

**Date:** 2026-03-26  
**Baseline:** [docs/business-requirement-gap-analysis.md](docs/business-requirement-gap-analysis.md)  
**Program Goal:** Close all PARTIAL and GAP business requirements and reach full business parity for all 20 requirement areas.

---

## 1. Scope and Outcome

This plan extends the existing apps-mode roadmap and defines execution for all open gaps across:
- Core wallet capabilities (funding, transfers, wallet lifecycle, PIN, QR, IBAN)
- External integrations (AFEX core, payment rails, bank rails, WPS, remittance)
- Customer support and localization (Arabic/multilingual, FAQ/chatbot, disputes)
- Compliance/reporting (CBUAE reporting, statements, reconciliations, auditable exports)
- Commercial expansion (merchant acquiring, lending, investment, VAS)

Target end state:
- **All 20 business requirement areas at DONE**
- No critical/high gaps open
- Production controls and regulatory artifacts in place

---

## 2. Delivery Model

## 2.1 Program Waves

- **Wave A (Go-Live Core):** close all Critical gaps (items 1-8 from gap matrix)
- **Wave B (Regulatory + Service Completeness):** close High gaps (items 9-15)
- **Wave C (Commercial Expansion):** close Medium and Lower gaps (items 16-30)

## 2.2 Sprint Cadence

- 2-week sprints
- 3 sprints per phase
- 15 phases total weeks: ~30 weeks for full closure

## 2.3 Delivery Principle

- Keep existing app boundaries; add new apps only when a bounded context is clearly separate.
- Integrations must be adapter-driven through `wallet_integrations` with contract tests.
- Financial changes must preserve ledger invariants and idempotency.
- Every new flow requires policy coverage, audit events, and observability metrics.

---

## 3. Target Architecture Additions (Apps Mode)

## 3.1 New or Expanded Apps

- `wallet_payments` (new): request money, QR receive/pay, funding orchestration, remittance intake orchestration.
- `wallet_beneficiaries` (new optional or extracted from web): persistent beneficiary domain + validation workflows.
- `wallet_reporting` (new): KPI, operational, regulatory, and export report pipelines.
- `wallet_disputes` (new): dispute lifecycle, SLA tracking, escalation workflow.
- `wallet_merchant` (new): merchant onboarding, acceptance channels, merchant settlement hooks.
- `wallet_lending` (new): origination/disbursement/repayment domain and salary advance/BNPL policies.
- `wallet_investments` (new): investment provider adapters, order lifecycle and holdings snapshot.
- `wallet_vas` (new): goals, micro-saving, budgeting, categorization, analytics hooks.

Existing apps to extend heavily:
- `wallet_accounts`, `wallet_auth`, `wallet_transfers`, `wallet_cards`, `wallet_integrations`, `wallet_settlement`, `wallet_notifications`, `wallet_limits_fees`, `wallet_web`, `wallet_database`, `wallet_compliance`, `wallet_risk`.

---

## 4. Phase Plan (Phase 11-15)

## Phase 11: Core Rails and Lifecycle Completion (Weeks 1-6)

Primary objective:
- Close all core capability blockers to make wallet operations truly functional end-to-end.

Workstreams:
1. Funding rails integration
- Lean, Checkout, AANI, AFEX Card funding adapters in `wallet_integrations`
- Branch cash-in interface + operator workflow
- Instant posting confirmation to `wallet_ledger`

2. Wallet lifecycle and profile synchronization
- Extend wallet states to `pending`, `active`, `suspended`, `frozen`, `closed` in `wallet_accounts`
- AFEX customer master sync (real-time events + periodic reconciliation)
- Canonical customer profile merge strategy

3. Virtual IBAN and bank transfer foundations
- Virtual IBAN allocation and mapping service
- Wallet-to-bank (P2A) via IBAN/account routing adapters

4. PIN-first transaction authorization
- 6-digit wallet PIN creation during onboarding
- PIN verification for transaction authorization
- PIN retry/lockout/reset/recovery via OTP flows

5. Transfer identity enhancement
- P2P by phone lookup and QR-based receiver resolution

Deliverables:
- Production-grade funding and bank-transfer rails
- Expanded wallet lifecycle state machine
- PIN authorization framework wired in customer UX
- Virtual IBAN issuance and inbound mapping

Exit criteria:
- Requirement areas #1, #2, #6, #7 move to DONE baseline (subject to Wave B reporting/compliance dependencies)

---

## Phase 12: Customer Journey and Channel Completeness (Weeks 7-12)

Primary objective:
- Complete customer money movement and support journeys beyond the financial core.

Workstreams:
1. Request money and QR receive
- P2P request creation/approval/decline/expiry in `wallet_payments`
- QR generation and deep-link handling

2. Beneficiary robustness
- Persistent beneficiary storage in `wallet_database`
- Phone and QR validation + external account verification APIs

3. Card and wallet channel enhancements
- Real AFEX card linking with tokenization/BIN validation
- Card-wallet balance synchronization pipeline
- AANI linking for funding and transfers

4. Withdrawals and merchant-ready transfer patterns
- Branch cash-out workflow
- ATM withdrawal path through linked cards
- Split payment orchestration

5. Statements and receipt depth
- Statement generation engine (PDF/CSV)
- Detailed transaction receipt pages

Deliverables:
- Request money end-to-end flows
- Persistent beneficiaries with verification
- Production card-linking and sync
- Statement generation and richer transaction details

Exit criteria:
- Requirement areas #3, #4, #5, #8, #9 move to DONE

---

## Phase 13: Compliance, Reporting, and Settlement Maturity (Weeks 13-18)

Primary objective:
- Close regulated go-live readiness gaps and strengthen back-office controls.

Workstreams:
1. Regulatory and operational reporting
- `wallet_reporting` pipelines for KPI, usage, settlement, dispute, and CBUAE packs
- Scheduled and on-demand report generation with evidence logs

2. Dispute and refunds
- `wallet_disputes` domain with SLA timers and escalation states
- Partial/full refund and reversal admin workflows

3. GL and reconciliation externalization
- AFEX core GL posting adapter
- Card-wallet GL sync reconciliation jobs
- WPS DIFF generation and salary credit integration

4. Notification production adapters
- Push, SMS, email adapters + template manager UI
- Delivery observability and retry/dead-letter controls

Deliverables:
- Regulatory report packs with sign-off evidence
- Dispute lifecycle with SLA tracking
- External GL posting and reconciliation integrity checks
- Production notification channels

Exit criteria:
- Requirement areas #10, #12, #13, #17 move to DONE
- High-priority gap set (9-15) closed

---

## Phase 14: Admin and Merchant Expansion (Weeks 19-24)

Primary objective:
- Complete administration and merchant/acquiring capabilities.

Workstreams:
1. Admin portal hardening
- Admin wallet PIN reset and wallet suspend/close actions
- Advanced transaction filters (date, amount, corridor, service)
- Custom report builder (CSV/Excel/PDF)
- Dynamic risk and rules configuration UI

2. Merchant acquiring
- `wallet_merchant` onboarding workflow
- POS/SoftPOS/QR acceptance flows
- Wallet-as-payment-option SDK/API contracts

3. Inward remittance
- Inbound remittance adapter and crediting flow
- Sender/country metadata and receipt generation
- Remittance notifications

Deliverables:
- Full admin operations console
- Merchant acceptance channel MVP
- Inward remittance production flow

Exit criteria:
- Requirement areas #18, #19, #20 move to DONE

---

## Phase 15: Lending, Investments, and VAS Completion (Weeks 25-30)

Primary objective:
- Close product expansion gaps and reach complete parity with business target model.

Workstreams:
1. Lending engine
- Loan origination/approval/disbursement
- Salary advance and BNPL products
- Risk + compliance gating and repayment workflows

2. Investment integrations
- Licensed provider onboarding
- Buy/sell/order-state and holdings summary

3. Value-added services
- Goal-based saving, micro-saving, expense categorization, budgeting
- Personal finance insights and analytics features
- Micro-insurance premium collection
- IoT linking hooks
- SME wallet/sub-wallet model

4. Rewards and growth maturity
- Referral program and referral tracking
- Campaign segmentation and targeting rules
- Rules-driven loyalty earning engine

Deliverables:
- Lending + investment + VAS production modules
- Expanded growth and analytics capabilities

Exit criteria:
- Requirement areas #11, #14, #15, #16 move to DONE
- All residual medium/lower-priority gaps closed

---

## 5. Requirement-to-Phase Traceability

| Requirement Area | Target Phase | Completion Definition |
|---|---|---|
| 1. Wallet Onboarding | 11 | AFEX sync + full lifecycle + virtual IBAN + Light/Full KYC tiers |
| 2. Funding & Re-loading | 11 | Lean/Checkout/AANI/AFEX cash-in + auto-load + WPS salary credit |
| 3. Beneficiary | 12 | Persistent beneficiaries + phone/QR lookup + account validation |
| 4. Request Money | 12 | Request/approve/decline + QR receive flow |
| 5. Card Linking | 12 | Real card integration + sync + AANI linking |
| 6. Authentication | 11 | 6-digit PIN lifecycle + authorization + lockout/recovery + step-up |
| 7. Withdrawals & Transfers | 11-12 | Phone/QR P2P + P2A bank + cash-out + ATM + split + merchant transfer |
| 8. Refunds and Returns | 12-13 | Automated reversals + partial/full refund workflows |
| 9. Account Management | 12 | Statement engine + full transaction detail + deactivate/close |
| 10. Language/Support/Chatbot | 13 | i18n framework + FAQ/help/chatbot + dispute UX |
| 11. Reward & Offers | 15 | Auto-earn rules + referral + targeting/segmentation |
| 12. Reconciliation | 13 | External GL posting + card-wallet sync + settlement maturity |
| 13. Reporting | 13 | KPI/usage/settlement/dispute/regulatory reporting suite |
| 14. VAS | 15 | Savings, budgeting, analytics, micro-insurance, SME wallet features |
| 15. Lending Engine | 15 | Origination + salary advance + BNPL |
| 16. Investment | 15 | Licensed provider integrations live |
| 17. Notification | 13 | Push/SMS/email live + template admin |
| 18. Acquiring & Merchant Services | 14 | Merchant onboarding + acceptance channels |
| 19. Admin Portal | 14 | Full controls, filters, refunds, reports, dynamic rules |
| 20. Inward Remittance | 14 | Inbound rail + wallet credit + metadata + notifications |

---

## 6. Cross-Cutting Implementation Backlog (Applies to Every Phase)

1. Security and policy
- ABAC matrix updates for all new actions
- Step-up authentication matrix for high-risk flows
- Secrets rotation and key management for new adapters

2. Data and migration
- Forward-only migrations with rollback playbooks
- PII classification and retention policies for each new schema

3. Testing and quality gates
- Contract tests for each external adapter
- Concurrency/idempotency tests for financial commands
- Synthetic end-to-end smoke tests for critical customer journeys

4. Observability and audit
- Correlation IDs across all command/event boundaries
- Domain metrics and SLOs per capability
- Audit evidence for regulated actions

5. Delivery governance
- Phase checklist and sign-off artifacts following existing `docs/phase-*-execution-checklist.md` pattern
- Release readiness gate before production promotion

---

## 7. Team and Ownership Model

Suggested stream-aligned ownership:
- Stream A: Core Wallet and Financial Rails (`wallet_accounts`, `wallet_ledger`, `wallet_transfers`, `wallet_limits_fees`)
- Stream B: Integrations and External Partners (`wallet_integrations`, `wallet_settlement`)
- Stream C: Customer and Admin UX (`wallet_web`, policy integration)
- Stream D: Compliance, Risk, Reporting (`wallet_compliance`, `wallet_risk`, `wallet_reporting`, `wallet_disputes`)
- Stream E: Commercial Products (`wallet_merchant`, `wallet_lending`, `wallet_investments`, `wallet_vas`, `wallet_rewards`)

Each stream maintains:
- Domain lead
- Tech lead
- QA/SDET
- Compliance/security reviewer

---

## 8. Milestones and Stage Gates

- **Gate G1 (End Phase 11):** critical go-live blockers resolved
- **Gate G2 (End Phase 13):** regulatory + reporting + dispute readiness complete
- **Gate G3 (End Phase 14):** merchant/remittance/admin completeness complete
- **Gate G4 (End Phase 15):** full business parity achieved across all 20 areas

At each gate, produce:
- signed phase checklist
- risk/exception register
- test evidence package
- operational runbook updates

---

## 9. Immediate Next Actions (Next 2 Weeks)

1. Create and approve `docs/phase-11-execution-checklist.md` from this plan.
2. Finalize partner integration contracts for Lean, Checkout, AANI, AFEX core, and bank IBAN rails.
3. Create `wallet_payments` app (or formally decide to extend `wallet_transfers`) and publish boundary ADR.
4. Define wallet PIN policy + customer UX flow and implement behind feature flags.
5. Establish AFEX profile sync event contracts and reconciliation job definitions.

---

## 10. Success Metrics

Program KPIs:
- Requirement completion: 20/20 areas DONE
- Critical/High gaps open: 0
- Financial posting mismatch rate: <0.01%
- Adapter callback replay rejection accuracy: 100%
- Regulatory report on-time generation: 100%
- Customer transaction notification delivery success: >=99%
- Dispute SLA breach rate: <2%

This is the execution baseline for post-10A delivery and can be decomposed directly into Phase 11-15 checklists and sprint tasks.
