mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 05:30:41 +01:00
Implements user-centric data model where users are the constant and professionals are lenses into their data. Follows DRY, SSOT, and SoC principles. Database changes (migration 009): - Add user_profiles table with RLS policies - Add domains column to documents table (TEXT[]) - Add professional_slug column to conversations table - Add triggers for auto-updating user stats - Add ensure_user_profile() helper function New files: - lib/domains.ts: SSOT for all domain definitions - lib/validations/domain.ts: Zod schemas for domain validation - lib/validations/user-profile.ts: User profile validation schemas - app/api/user/profile/route.ts: GET/PATCH user profile API - app/api/documents/[id]/route.ts: GET/PATCH document API Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>