Complete implementation of the production line incident response system (生產線異常即時反應系統) including: Backend (FastAPI): - User authentication with AD integration and session management - Chat room management (create, list, update, members, roles) - Real-time messaging via WebSocket (typing indicators, reactions) - File storage with MinIO (upload, download, image preview) Frontend (React + Vite): - Authentication flow with token management - Room list with filtering, search, and pagination - Real-time chat interface with WebSocket - File upload with drag-and-drop and image preview - Member management and room settings - Breadcrumb navigation - 53 unit tests (Vitest) Specifications: - authentication: AD auth, sessions, JWT tokens - chat-room: rooms, members, templates - realtime-messaging: WebSocket, messages, reactions - file-storage: MinIO integration, file management - frontend-core: React SPA structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
2.2 KiB
Markdown
37 lines
2.2 KiB
Markdown
# Change: Add Chat Room Management for Incident Response
|
|
|
|
## Why
|
|
The system needs to support creation and management of dedicated chat rooms for each production incident. Each incident (equipment failure, material shortage, quality issue) requires an isolated communication space where team members can collaborate, share files, and track resolution progress. This is the core feature that transforms chaotic multi-channel communication into structured, traceable data with audit trails for compliance and post-mortem analysis.
|
|
|
|
## What Changes
|
|
- Implement chat room CRUD operations (Create, Read, Update, Delete/Close)
|
|
- Create database schema for incident_rooms and room_members tables
|
|
- Implement room membership management (add/remove members, role assignment)
|
|
- Add room status lifecycle (active, resolved, archived)
|
|
- Implement room metadata tracking (incident type, severity, location, timestamps)
|
|
- Add permission system for room operations (owner, editor, viewer roles)
|
|
- **Implement owner transfer functionality (current owner can assign new owner)**
|
|
- **Add system administrator role with super-user privileges (ymirliu@panjit.com.tw)**
|
|
- Create REST API endpoints for room management
|
|
- Enable filtering and searching of rooms by status, type, date range
|
|
- Implement room activity tracking for audit trails
|
|
- Add support for room templates based on incident types
|
|
- Implement admin override capabilities for all room operations
|
|
|
|
## Impact
|
|
- **Affected specs**: `chat-room` (new capability)
|
|
- **Affected code**:
|
|
- Backend: New `app/modules/chat_room/` module with:
|
|
- Routes: `/api/rooms/*` endpoints for CRUD operations
|
|
- Models: `IncidentRoom`, `RoomMember` (SQLAlchemy)
|
|
- Services: `RoomService`, `MembershipService`
|
|
- Schemas: Request/Response models for room operations
|
|
- Database: New tables:
|
|
- `incident_rooms`: Room metadata and configuration
|
|
- `room_members`: User-room associations with roles
|
|
- Integration points:
|
|
- Authentication: Requires `get_current_user` dependency from auth module
|
|
- Future: Will be used by messaging and file upload features
|
|
- **Dependencies**:
|
|
- Requires completed authentication module (for user identity and permissions)
|
|
- PostgreSQL for relational data storage |