Add missing V2 fields to init-db.sql to match conversation.entity.ts:
- consulting_stage
- consulting_state
- collected_info
- recommended_programs
- conversion_path
- device_info
Also add indexes for the new fields.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TokenUsageEntity to store per-request token consumption
- Add TokenUsageService with cost calculation and statistics APIs
- Record input/output/cache tokens per API call
- Calculate estimated cost based on Claude pricing
- Provide user/conversation/global stats aggregation
- Support daily stats and top users ranking
- Integrate token tracking in ClaudeAgentService
- Track latency, tool calls, response length
- Accumulate tokens across tool loop iterations
- Add token_usages table to init-db.sql with proper indexes
This enables:
- Per-user token consumption tracking
- Cost analysis and optimization
- Future billing/quota features
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove foreign key constraint from conversations.user_id
- Remove foreign key constraint from user_memories.user_id
- Add FACT and INTENT to user_memories.memory_type enum
- Both tables now support anonymous users (UUID without registration)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add missing 'type' column to MessageORM entity
- Add 'TEXT_WITH_ATTACHMENTS' to messages.type CHECK constraint
(matches MessageType enum in conversation-service)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous hash was not working correctly with bcrypt.compare().
Updated to a verified working hash for password 'admin123'.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add MinIO object storage to docker-compose infrastructure
- Create file-service microservice for upload management with presigned URLs
- Add files table to database schema
- Update nginx and Kong for MinIO proxy routes
- Implement file upload UI in chat InputArea with drag-and-drop
- Add attachment preview in MessageBubble component
- Update conversation-service to handle multimodal messages
- Add Claude Vision API integration for image analysis
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sync scripts/init-db.sql with infrastructure/docker/services/postgres/init.sql
to include all required database columns:
- users: fingerprint, nickname columns for anonymous auth support
- conversations: ended_at column for tracking conversation end time
- messages: type enum column (USER, ASSISTANT, SYSTEM)
This ensures the schema files are consistent and include all columns
needed by the application entities.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>