Safety & Compliance Module
Incident reporting, admin review workflow, and safety analytics.
Features
- Incident reporting (injury, near_miss, damage, hazard)
- Severity classification (low, medium, high)
- Zone-based incident tracking
- Admin review workflow with action tracking
- Safety analytics (incidents by type/zone, high-risk zones, recurrent hazards)
- Risk score calculation per zone
- Warehouse map integration with safety overlay
Permissions
- Worker: INSERT incidents, SELECT only own incidents
- Admin: Full read/write on all incidents + reviews
- Driver: No write, only read zone warnings (through view endpoints)
Database Schema
Tables
incidents: Incident recordsincident_reviews: Admin review records
Key Functions
reportIncident(): Report new incidentgetIncidentsForAdmin(tenant_id): Get all incidents for admingetIncidentsForUser(user_id): Get user's incidentsaddIncidentReview(): Add admin reviewgetIncidentAnalytics(tenant_id): Get safety analyticsgetZoneRiskScores(): Get risk scores for map integration
Integration
- Floor Plan: Shows safety overlay with risk zones
- Auto Assignment: Uses risk scores for zone scoring