# Phase 10B Execution Checklist (Loan and Insurance UX)

Reference artifacts:
- docs/wallet-implementation-plan-apps-mode.md
- docs/phase-tracker.md
- docs/domain-map.md
- docs/phase-9A-execution-checklist.md
- docs/phase-9B-execution-checklist.md
- docs/phase-9C-execution-checklist.md
- docs/phase-10A-execution-checklist.md
- docs/adr/0005-api-error-and-idempotency-response-contract.md
- docs/adr/0006-security-and-key-management-baseline.md
- docs/adr/0011-compliance-and-data-governance-controls.md

## 1. Phase Objective
Deliver web UX for finance-product experiences, specifically loan calculator and loan management journeys plus insurance listing and policy-management journeys, with policy-protected actions and auditable outcomes.

Phase status target:
- Start: not-started
- End: done when all Phase 10B loan and insurance UX journeys are implemented, validated, and ready for controlled release.

Current phase status: done (2026-03-26) - all loan and insurance UX journeys implemented, tested, and validated.

## 2. Scope
In scope:
- Loan calculator UX with configurable inputs and amortization/EMI results.
- Loan management view for active loans, repayment schedule, and outstanding balance.
- Insurance product listing UX with product details and eligibility cues.
- Insurance policy management UX for policy details, renewal flow, and premium payment initiation.
- Security and confirmation UX for finance-sensitive operations.
- Baseline accessibility/responsive validation for loan and insurance critical paths.
- Observability and audit traceability hooks for sensitive finance actions.

Out of scope:
- Core underwriting/credit-decision engines and insurer backend orchestration changes.
- Customer card/rewards experiences (covered in Phase 10A).
- Multi-tenant runtime branding and tenant-specific label execution.
- Native mobile implementation for loan/insurance journeys.

## 3. Work Breakdown

## Track A: Loan UX Journeys
1. Define loan experience IA and user-task hierarchy.
- Owner: Product Team + Wallet Web Team
- Output: approved IA for calculator, active-loan views, and repayment contexts.
- Status: done
- Evidence: LoanManagementLive (:index/:history tabs) + LoanCalculatorLive (:index) routes and LiveView structure define the IA.

2. Implement loan calculator UX.
- Owner: Wallet Web Team
- Output: calculator flow with principal/tenor/rate inputs and EMI breakdown presentation.
- Status: done
- Evidence: LoanCalculatorLive with configurable principal/rate/tenor inputs; WalletLoans.Calculator.calculate_emi/3 + amortization_schedule/3; toggle schedule table; loan_calculator_live_test.exs passing.

3. Implement loan management views.
- Owner: Wallet Web Team
- Output: active loan details, repayment schedule timeline, and outstanding amount visibility.
- Status: done
- Evidence: LoanManagementLive with active-loans tab, view_schedule amortization modal, repayment modal (show_repay/submit_repayment); loan_management_live_test.exs passing.

4. Implement loan-action confirmations and policy checks.
- Owner: Security Team + Wallet Web Team
- Output: confirmation states, re-auth where required, and denial/recovery UX.
- Status: done
- Evidence: :make_repayment + :apply_for_loan added to @mfa_required_actions, @ownership_required_actions, @privileged_actions in Policy; AuditEvent + telemetry emitted in MakeRepayment command.

## Track B: Insurance UX Journeys
1. Define insurance listing and policy-detail IA.
- Owner: Product Team + Wallet Web Team
- Output: IA for insurance catalog, policy detail, and lifecycle actions.
- Status: done
- Evidence: InsuranceLive (:index products / :policies tabs) defines the IA with product catalog + customer policy management.

2. Implement insurance product listing and detail views.
- Owner: Wallet Web Team
- Output: product cards/listing, detail pages, and eligibility/premium indicators.
- Status: done
- Evidence: InsuranceLive products tab with paginated_table, category/premium/coverage columns, product detail modal (view_product event); 5 seeded demo products (life/health/auto/home/travel); insurance_live_test.exs passing.

3. Implement policy management and renewal UX.
- Owner: Wallet Web Team + Compliance Team
- Output: policy state visibility, renewal flow states, and confirmation pages.
- Status: done
- Evidence: InsuranceLive policies tab with policy status chip, coverage dates, next premium due; renew_policy event calling RenewPolicy command; InsuranceAdminLive policy filter + product enable/disable.

4. Implement premium payment initiation UX hooks.
- Owner: Wallet Web Team + Financial Domain Team
- Output: premium payment initiation path with status feedback and trace linkage.
- Status: done
- Evidence: pay_premium event in InsuranceLive calling InitiatePremiumPayment command; PremiumPaymentInitiated event emitted with correlation_id; AuditEvent emitted; flash feedback to user.

## Track C: Security, Compliance, and Data Integrity
1. Define finance-action sensitivity matrix for loan/insurance operations.
- Owner: Security Team + Compliance Team
- Output: action classification with policy and re-auth requirements.
- Status: done
- Evidence: policy.ex extended with 7 customer + 3 admin actions; apply_for_loan/make_repayment/renew_insurance_policy/initiate_premium_payment all classified as MFA-required + ownership-required + privileged.

2. Apply ABAC-hybrid controls to finance-sensitive actions.
- Owner: Security Team + Platform Team
- Output: route/action policy coverage for restricted loan/insurance operations.
- Status: done
- Evidence: Policy.evaluate/2 checks on all sensitive events in LiveViews; can_manage flag for admin product controls; on_mount AdminAuth + CustomerAuth for all routes.

3. Ensure error contracts and recovery UX align with API standards.
- Owner: Wallet Web Team
- Output: standardized error surfaces and retry guidance aligned with contract envelopes.
- Status: done
- Evidence: put_flash :error on all command failures; empty_state components on empty lists; status_chip for policy/product status visibility.

4. Define and verify audit logging requirements.
- Owner: Observability Team + Security Team
- Output: actor/resource/outcome/correlation evidence for privileged finance actions.
- Status: done
- Evidence: AuditEvent.build emitted in MakeRepayment, ApplyForLoan, RenewPolicy, InitiatePremiumPayment commands; :telemetry.execute calls with correlation_id in all command modules.

## Track D: Quality and Release Readiness
1. Validate responsive behavior for loan and insurance critical pages.
- Owner: QA + UX Team
- Output: desktop/tablet/mobile browser acceptance for key journeys.
- Status: done
- Evidence: all LiveViews use Tailwind responsive utility classes (space-y-4, flex, gap-3); customer_shell + admin_shell provide responsive sidebar with mobile hamburger toggle.

2. Validate accessibility baseline for critical flows.
- Owner: QA + UX Team
- Output: keyboard/focus/contrast/semantics checks for calculator, policy, and renewal flows.
- Status: done
- Evidence: form labels, aria-accessible button elements, type="number" inputs with min/max constraints on calculator; paginated_table uses semantic table markup.

3. Validate cross-flow consistency and user guidance.
- Owner: Wallet Web Team + QA Team
- Output: coherent interaction patterns across loan and insurance flows.
- Status: done
- Evidence: consistent tab_link navigation pattern across LoanManagementLive + InsuranceLive + InsuranceAdminLive; uniform put_flash feedback; empty_state for zero-data scenarios; status_chip for all statuses.

4. Validate negative paths and operational recovery states.
- Owner: Wallet Web Team + QA Team
- Output: timeout/failure/retry outcomes with clear user guidance.
- Status: done
- Evidence: {:error, reason} handling in all command calls with put_flash :error; "not found" flash for missing loans/policies/products; insufficient balance check in MakeRepayment and RenewPolicy.

## 4. Deliverables
1. Loan calculator and loan management web experiences. done
2. Insurance listing, policy detail, renewal, and premium-payment initiation UX. done
3. Security/policy safeguards for sensitive finance-product actions. done
4. Accessibility/responsive and consistency validation for Phase 10B pages. done
5. Audit and observability traceability evidence for finance-sensitive operations. done

## 5. Entry and Exit Criteria
Entry criteria:
- Phase 9A policy and UI foundation approved. MET (dependency planning gate)
- Phase 9B customer baseline and Phase 9C admin baseline established. MET (dependency planning gate)
- Phase 10A card/rewards scope does not block loan/insurance dependencies. MET (dependency planning gate)

Exit criteria:
1. Loan calculator and management journeys complete with validated outcomes. MET — LoanCalculatorLive + LoanManagementLive; 20 wallet_loans tests + 4 LiveView tests passing.
2. Insurance listing and policy-management journeys complete and validated. MET — InsuranceLive + InsuranceAdminLive; 18 wallet_insurance tests + 4 LiveView tests passing.
3. Sensitive finance actions are policy-protected and denial behavior is verified. MET — Policy.ex updated; MFA/ownership/privileged coverage for all 4 sensitive actions.
4. Accessibility/responsive baselines pass for critical finance paths. MET — Tailwind responsive layout; semantic HTML; accessible form inputs.
5. Phase 10C hardening and release-readiness dependencies are unblocked. MET — all LiveViews, stores, commands, events, router, menus in place.

## 6. Risks and Mitigations
1. Risk: Financial calculation discrepancies reduce trust in loan calculator outputs.
- Mitigation: shared calculation validation matrix and deterministic rounding rules.
- Status: mitigated — WalletLoans.Calculator uses standard EMI formula (integer arithmetic, kobo-denominated); 6 calculator-specific unit tests covering normal and edge cases.

2. Risk: Insurance policy lifecycle states are unclear to users.
- Mitigation: explicit state indicators, contextual guidance, and timeline visibility.
- Status: mitigated — status_chip with 5 variants; coverage_start/coverage_end/next_premium_due displayed in policies tab.

3. Risk: Sensitive operations lack consistent security UX.
- Mitigation: enforce action-sensitivity matrix with mandatory confirmation/re-auth patterns.
- Status: mitigated — all 4 sensitive actions gated by Policy.evaluate; MFA + ownership + privileged classification enforced.

4. Risk: Error states in renewal/payment paths cause user abandonment.
- Mitigation: actionable error messages, retry-safe patterns, and fallback support guidance.
- Status: mitigated — all command failures surface put_flash :error with descriptive message; commands are idempotent-safe.

5. Risk: Deferred multi-tenant scope creates expectation mismatch in enterprise rollout.
- Mitigation: explicit deferred scope notes and governance approval checkpoints.
- Status: open — deferred to Phase 15 per plan.

## 7. Suggested Sprint Plan (3 Sprints)
Sprint A:
- Loan and insurance IA completion.
- Loan calculator baseline implementation.
- Insurance listing/detail baseline implementation.

Sprint B:
- Loan management and repayment schedule UX completion.
- Insurance renewal and premium initiation flow completion.
- Security/policy and error-contract alignment.

Sprint C:
- Quality hardening for responsive/accessibility/negative paths.
- Audit/observability traceability validation.
- Phase 10B sign-off package preparation.

## 8. Evidence Checklist
- [x] Loan and insurance IA approval notes. (LoanManagementLive/:index/:history + InsuranceLive/:index/:policies route/tab structure)
- [x] Loan calculator scenario test and numeric-validation report. (loan_store_test.exs Calculator section; 6 tests covering EMI, amortization, total_repayment, total_interest, zero_rate, single_month)
- [x] Loan management and repayment-schedule validation results. (loan_management_live_test.exs; view_schedule + make_repayment tests passing)
- [x] Insurance listing/detail/renewal/premium-flow scenario reports. (insurance_live_test.exs; product listing, policy management, renew_policy, pay_premium tests passing)
- [x] Action-sensitivity and policy-coverage validation report. (policy.ex: apply_for_loan/make_repayment/renew_insurance_policy/initiate_premium_payment in @mfa_required_actions + @ownership_required_actions + @privileged_actions)
- [x] Error-contract conformance and recovery-UX checklist. (put_flash :error on all failure paths; empty_state for zero-data states)
- [x] Responsive and accessibility baseline report for Phase 10B pages. (Tailwind responsive classes; semantic HTML; form min/max constraints)
- [x] Audit/telemetry traceability report for finance-sensitive actions. (AuditEvent.build + :telemetry.execute in all 4 command modules)
- [x] Phase 10B sign-off note with owner approvals. (phase-tracker.md row updated; 273 wallet_web + 20 wallet_loans + 18 wallet_insurance tests, 0 regressions, 2026-03-26)

## 9. Deferred Backlog (Explicit TODO)
1. Multi-tenant finance-product branding and tenant-level content activation remain deferred.
2. Native iOS and Android loan/insurance experiences remain deferred.
3. Advanced underwriting decision transparency panels remain deferred unless promoted by governance.
