ca-grow-ops-manager/specs/messaging.md
fullsizemalt 558e0ac1e2
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
feat: Full Spec Kit compliance implementation
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
2025-12-11 09:53:32 -08:00

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: UUID
  • title: string
  • content: string (markdown supported)
  • priority: enum (LOW, NORMAL, HIGH, CRITICAL)
  • targetRoles: string[] (which roles see this)
  • requiresAck: boolean
  • expiresAt: datetime (optional)
  • createdById: FK to User
  • createdAt: datetime

AnnouncementAck

  • id: UUID
  • announcementId: FK
  • userId: FK
  • readAt: datetime
  • acknowledged: boolean
  • acknowledgedAt: datetime (optional)

ShiftNote

  • id: UUID
  • content: string
  • importance: enum (LOW, NORMAL, HIGH)
  • roomId: FK (optional)
  • batchId: FK (optional)
  • createdById: FK to User
  • createdAt: datetime

API Endpoints

Announcements

  • GET /api/messaging/announcements - List active announcements
  • POST /api/messaging/announcements - Create announcement (admin)
  • GET /api/messaging/announcements/:id - Get details
  • PUT /api/messaging/announcements/:id - Update
  • DELETE /api/messaging/announcements/:id - Delete
  • POST /api/messaging/announcements/:id/acknowledge - Ack
  • GET /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 notes
  • POST /api/messaging/shift-notes - Create note
  • GET /api/messaging/shift-notes/:id - Get note
  • DELETE /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