The conversations table has no FK on user_id, but files had one, causing
500 errors on file upload when the anonymous user wasn't registered.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FileORM had tenant_id column but FileEntity domain class was missing it,
causing "column FileORM.tenant_id does not exist" errors on production.
- Add tenantId to FileEntity (constructor, create, fromPersistence)
- Pass tenantId in repository toEntity() mapping
- Add idempotent migration script for files.tenant_id + indexes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add tenant_id column to conversations, messages, token_usages tables
- Create standalone migration SQL script for production deployment
- Add agent_executions table to init-db.sql for new installations
- Fix MessageORM created_at nullable mismatch with database schema
- Backfill existing data with default tenant ID
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add UserProfile entity with immigration-specific fields:
- Basic info (name, birth date, nationality, current location)
- Immigration intent (target countries, types, timeline)
- Education records with WES evaluation flag
- Work records with NOC codes
- Language scores (IELTS, TOEFL, etc.)
- Family members info
- Financial info for investment immigration
- Profile completion percentage calculation
- Add UserContact entity for identity binding:
- Support multiple contact types (EMAIL, WECHAT, WHATSAPP, TELEGRAM, LINE)
- Verification code flow with expiration
- Notification settings (paid feature)
- Notification types: POLICY_UPDATE, DEADLINE_REMINDER, etc.
- Add API endpoints:
- GET/PUT /users/me/profile/* for profile sections
- GET/POST/PUT/DELETE /users/me/contacts for contact management
- POST /users/me/contacts/:type/verification for verification flow
- POST/PUT/DELETE /users/me/contacts/:type/notifications
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>