Skip to content

feat-013: KYC Verification (Mock Provider)#3

Closed
leecampbell-codeagent wants to merge 6 commits into
ralph/feat-004-account-registration-onboardingfrom
ralph/feat-013-kyc-verification
Closed

feat-013: KYC Verification (Mock Provider)#3
leecampbell-codeagent wants to merge 6 commits into
ralph/feat-004-account-registration-onboardingfrom
ralph/feat-013-kyc-verification

Conversation

@leecampbell-codeagent
Copy link
Copy Markdown
Owner

Summary

  • KycVerification entity with 9-state lifecycle: not_verified → pending → verified | pending_resubmission | in_manual_review → rejected | locked | expired | reverification_required
  • ALLOWED_TRANSITIONS map enforced via assertTransition() — invalid transitions throw InvalidKycTransitionError; auto-lock after 5 failures
  • KycPort, StoragePort, KycRepository port interfaces; MockKycAdapter (auto-approve), PgKycRepository (parameterised SQL)
  • KycAppService: submit verification, status query, admin unlock (role-checked at two layers)
  • API: POST /kyc/submit (auth), GET /kyc/status (auth), POST /kyc/admin/unlock/:accountId (admin-only)
  • New migration: 20260305000002_add_kyc_document_refs.sql
  • Frontend: /settings/verification page with all 9 status states; KycStatusBadge; 3-second polling when pending; useKycStatus, useSubmitKyc hooks
  • 344 tests passing (192 backend + 152 frontend)

Stacked on: ralph/feat-004-account-registration-onboarding — merge feat-004 PR first.

Quality Gate

  • Tests: 344/344 passing
  • Security: PASS — 0 critical/high; double-layer admin role check; no PII in logs
  • Audit: PASS — first pass, no failures
  • Exploratory: PASS (code-review based — Docker unavailable)
  • CI/CD: PASS — no new CI changes required

Reports

  • Exploratory: .claude/reports/feat-013-exploratory.md
  • Security: .claude/reports/feat-013-security.md
  • Audit: .claude/reports/feat-013-audit.md
  • CI/CD: .claude/reports/feat-013-cicd.md

🤖 Generated with Claude Code

leecampbell-codeagent and others added 6 commits March 5, 2026 05:56
…at-004)

- Multi-step onboarding wizard (welcome, role selection, profile, preferences, completion)
- Account domain entity extended with onboarding_step, role, profile, and notification preference fields
- Domain event emission to event store on onboarding completion and profile updates
- API endpoints: GET /me, PATCH /me/onboarding, PATCH /me, PATCH /me/preferences
- PgAccountRepository updated with findById and update methods
- InMemoryEventStore and PgEventStoreAdapter implemented
- Frontend: OnboardingWizard with StepProgress, RoleCards, ToggleSwitch components
- Settings pages: /settings/profile and /settings/preferences
- Onboarding guard redirects users to /onboarding if not complete
- 260 tests passing (132 backend + 128 frontend)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 401 unauthenticated tests for all 4 account API endpoints
- Fix preferences_updated event payload to include categories_changed array
- Wrap account update + event append in shared database transaction (Edge Case LeeCampbell#17)
- Introduce TransactionPort and PgTransactionAdapter for transactional DB operations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Exploratory review: PASS (code-review based, all 8 US verified)
- Security review: PASS (0 critical/high findings)
- Audit: PASS (all 3 failures resolved in iteration 2)
- CI/CD: PASS — add GitHub Actions workflow (lint, typecheck, test, build, audit)
- Fix 34 lint/a11y errors: semantic HTML in onboarding components (label+input for
  radio group, section for region, output for status), biome format fixes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- KycVerification entity with 9-state lifecycle and ALLOWED_TRANSITIONS guard
- KycPort, StoragePort, KycRepository port interfaces
- MockKycAdapter (auto-approve), MockStorageAdapter, PgKycRepository (parameterised SQL)
- KycAppService: submit, status query, admin unlock; emits domain events
- API: POST /kyc/submit, GET /kyc/status, POST /kyc/admin/unlock/:accountId (admin-only)
- New migration: add front_document_ref, back_document_ref, submitted_at to kyc_verifications
- Frontend: /settings/verification page with all 9 status states, 3-second polling
- KycStatusBadge component, useKycStatus (with polling), useSubmitKyc hooks
- 344 tests passing (192 backend + 152 frontend)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… length

- All 4 quality checks PASS (security, audit, exploratory, CI/CD) — first pass
- Add .max(512) to front_document_ref and back_document_ref Zod schema (MED-001)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@leecampbell-codeagent leecampbell-codeagent force-pushed the ralph/feat-004-account-registration-onboarding branch from 9bc3091 to 774b35a Compare March 5, 2026 10:04
@leecampbell-codeagent leecampbell-codeagent deleted the ralph/feat-013-kyc-verification branch March 5, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant