Photo Management (per specs/photo-management.md): - Sharp integration for 3-size compression (thumb/medium/full) - WebP output with 80-90% quality - Client-side compression with browser-image-compression - PhotoUpload component with camera/drag-drop support - Upload API with bulk support and stats endpoint Testing: - Backend: Jest tests for all major API endpoints - Frontend: Vitest tests for utilities and API clients - CI: Updated Forgejo workflow for test execution Specs (100% coverage): - visitor-management.md (Phase 8) - messaging.md (Phase 9) - audit-and-documents.md (Phase 10) - accessibility-i18n.md (Phase 11) - hardware-integration.md (Phase 12) - advanced-features.md (Phase 13) Documentation: - OpenAPI 3.0 spec (docs/openapi.yaml) - All endpoints documented with schemas
2.1 KiB
2.1 KiB
Feature Spec: Announcements & Mass Communication
Priority: 🟡 Medium
Phase: 9
Status: ✅ Implemented
Overview
Enable facility-wide announcements, team messaging, shift handoffs, and emergency alerts. Ensure message acknowledgement for compliance.
Models
Announcement
id: UUIDtitle: stringcontent: string (markdown supported)priority: enum (LOW, NORMAL, HIGH, CRITICAL)targetRoles: string[] (which roles see this)requiresAck: booleanexpiresAt: datetime (optional)createdById: FK to UsercreatedAt: datetime
AnnouncementAck
id: UUIDannouncementId: FKuserId: FKreadAt: datetimeacknowledged: booleanacknowledgedAt: datetime (optional)
ShiftNote
id: UUIDcontent: stringimportance: enum (LOW, NORMAL, HIGH)roomId: FK (optional)batchId: FK (optional)createdById: FK to UsercreatedAt: datetime
API Endpoints
Announcements
GET /api/messaging/announcements- List active announcementsPOST /api/messaging/announcements- Create announcement (admin)GET /api/messaging/announcements/:id- Get detailsPUT /api/messaging/announcements/:id- UpdateDELETE /api/messaging/announcements/:id- DeletePOST /api/messaging/announcements/:id/acknowledge- AckGET /api/messaging/announcements/:id/status- Ack status (admin)GET /api/messaging/pending- Pending acks for current user
Shift Notes
GET /api/messaging/shift-notes- List shift notesPOST /api/messaging/shift-notes- Create noteGET /api/messaging/shift-notes/:id- Get noteDELETE /api/messaging/shift-notes/:id- Delete
Frontend Components
AnnouncementBanner
- Displays at top of layout
- Critical priority = red, High = amber, Normal = blue
- Expandable to show all active
- Acknowledge button for required messages
ShiftNotesWidget
- Shows on dashboard
- Filter by room/batch
- Quick add functionality
Compliance Notes
- Required acknowledgements tracked per user
- Admin can view acknowledgement status
- All announcements immutably logged
- Audit trail for compliance reporting