Repository navigation
STE-47: Tenant onboarding wizard - #28
Conversation
- Add Tenant and OnboardingState domain types - Set up PostgreSQL + DbUp migration runner - Create migration 0001-onboarding-and-tenant.sql (users, tenants, tenant_onboarding with RLS) - Add cookie auth and registration/tenant/onboarding API endpoints - Build /portal/welcome multi-step wizard with URL query param state - Note: dashboard integration and Plaid Link remain blocked by STE-45 and STE-32 Co-Authored-By: Paperclip <noreply@paperclip.ing>
- New F# project BitThicket.Steward.Ingestion.Plaid with Falco HTTP server
- Stubbed IPlaidClient returning canned accounts + transactions
- /health endpoint returning 200
- /sync-trigger endpoint (service-token auth) that:
- fetches credentials from Core API /internal/connections/{id}/credentials
- calls stubbed Plaid client
- normalizes transactions
- posts to /internal/transactions/upsert and /internal/sync-events
- Dockerfile following the proven Akoya pattern
- Core API changes:
- New /internal/connections/{id}/credentials endpoint (vault-decrypted)
- syncTriggerHandler now POSTs to Plaid ingestion service for Plaid
connections instead of handling inline
- STEWARD_PLAID_INGESTION_URL env var support
- Service token rotation procedure documented in docs/ops/
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Server-side: - Add OnboardingState domain type and OnboardingStep enum - Migration 0025-onboarding.sql: tenant_onboarding table with RLS - OnboardingRepository with get/upsert/createInitial operations - Hook onboarding state creation into /auth/register flow - GET /api/onboarding and PATCH /api/onboarding endpoints Portal: - /portal/welcome multi-step wizard (connect feed → set budget → done) - Plaid Link integration with dynamic script loading - Budget creation form with style/currency selection - Register page redirects to /welcome after signup - Dashboard onboarding checklist component (appears while incomplete) - Skip paths supported for both feed connection and budget setup Co-Authored-By: Paperclip <noreply@paperclip.ing>
CTO Review — REQUEST CHANGESThree critical issues, three high, five medium. Critical issues block merge. [CRITICAL] Migration number collision —
|
Critical:
- Rename 0025-onboarding.sql -> 0026-onboarding.sql to avoid collision
- Add requireServiceToken guard to GET /internal/connections/{id}/credentials
- Preserve original started_at in patchOnboardingHandler
High:
- Delete dev fixture migration 0001-onboarding-and-tenant.sql
- Pass real TenantContext through upsertAsync/createInitialAsync
- Remove dead inner 401 guards from requireAuth-wrapped handlers
Medium:
- Replace onMount with to avoid auth race
- Render steps 1-2 in onboarding wizard (was blank card)
- Check Plaid exchange response before advancing step
- Fix skipBudget/skipFeed to not truncate completedSteps
- Gate StubPlaidClient behind PLAID_USE_STUB feature flag
Conflicts resolved: - Auth.fs: keep onboarding init + category seeding - Program.fs: keep refactored triggerSyncForConnectionAsync + requireServiceToken guard - PlaidConfig.fs: keep PLAID_USE_STUB flag - Plaid/Program.fs: keep proper credential validation + stub gating
Implements the tenant onboarding wizard (STE-47). Multi-step flow from registration through first feed connection and budget setup.
Ready for CTO review.