Skip to main content

Domain: onboarding

Curated entry point for the onboarding bounded context.

Owner

Founder + agents (Phase 1).

Mission

Owns the new-user onboarding flow from KYC document collection through OFAC / sanctions screening to first-account-eligible state. Boundary: onboarding produces a KYC-cleared user; the accounts domain takes over from there to provision the actual evaluation or instant-funded account.

Code paths

  • Application code: apps/api/src/modules/onboarding/
  • Domain logic (pure): packages/domain/onboarding/
  • Contracts: packages/contracts/api/onboarding.ts
  • External clients: packages/clients/persona/
  • Database schemas owned: onboarding (KycSubmission, KycDocument, SanctionsScreening, OnboardingFlow)

PRD chapters that touch this domain

TDD chapters

(Empty - will populate as TDDs arrive.)

ADRs that affected this domain

Service interfaces this domain exposes

export interface OnboardingService {
// initiateKyc(userId: string): Promise<KycInquiryId>
// handlePersonaWebhook(payload: PersonaWebhookPayload): Promise<void>
// getKycStatus(userId: string): Promise<KycStatus>
// runSanctionsScreening(userId: string): Promise<ScreeningResult>
// (full surface defined during onboarding TDD)
}

Events this domain produces / consumes

DirectionTopicTriggered by
producesonboarding.kyc.submittedUser submits KYC docs to Persona
producesonboarding.kyc.clearedPersona returns approved + sanctions-clean
producesonboarding.kyc.flaggedPersona returns suspect or sanctions hit
producesonboarding.kyc.rejectedPersona returns rejected after manual review
consumesidentity.user.signed_upTriggers KYC initiation eligibility

External integrations

  • Persona - identity verification + sanctions screening (per Q-I1)
  • OFAC SDN list - via Persona's screening, fall-through to direct API if needed

Runbooks for this domain

(Empty - will populate when alerts are defined in Section 17.6.)

On-call

To be filled in Section 17.6.

Cross-domain dependencies

  • This domain calls: identity (to read user state).
  • This domain emits events consumed by: accounts (user becomes eligible for accounts), audit (every KYC outcome is logged), notifications (KYC-status emails to the user), admin (manual review queue surfaces in the admin app).