Safety Pro Edition
Universal safety management system for any industry (manufacturing, offices, construction, logistics, etc.).
Overview
The Safety Pro Edition is a standalone safety management system that works independently of logistics and warehouse features. It provides comprehensive incident reporting, checklist management, training tracking, and compliance monitoring.
Features
1. Incident Center
Universal incident reporting and management system.
Key Features:
- Report incidents with multiple categories (injury, near_miss, hazard, property_damage, chemical, haccp, hygiene, machine_failure)
- Severity levels: low, medium, high, critical
- Free-text location support (not tied to zones)
- Optional zone integration for warehouse tenants
- Attachment support (images, documents)
- Action item tracking with due dates
- Status management (open, in_progress, done)
Access:
- Workers/Drivers: Can report incidents
- Safety Officers/Admins: Full access to all incidents and actions
2. Checklist Designer
Create and manage safety checklists for various categories.
Categories:
- Hygiene
- PPE (Personal Protective Equipment)
- Machine Check
- Vehicle Check
- Construction Site
- Office Safety
Features:
- Create custom checklists with multiple questions
- Mark questions as required/optional
- Reorder questions
- Category-based organization
Access:
- Safety Officers/Admins: Can create and manage checklists
- All users: Can view available checklists
3. Checklist Execution
Mobile-friendly checklist execution for workers.
Features:
- Simple Yes/No/N/A answer options
- Automatic score calculation
- Mobile-optimized interface
- Real-time submission
- Completion tracking
Access:
- All users: Can execute checklists
4. Safety Trainings
Training management and completion tracking.
Training Types:
- Unterweisung: Safety briefings
- Schulung: Training sessions
- E-Learning: Online training modules
Features:
- Training content management
- Digital signature support
- Completion tracking
- User progress monitoring
Access:
- Safety Officers/Admins: Can create and manage trainings
- All users: Can view and complete trainings
5. Safety Intelligence (Enterprise)
Predictive and proactive safety engine with explainable heuristics.
Key Features:
- Leading Indicators: Near-miss reporting rate, action completion rate, checklist compliance, incident severity trends
- Risk Trend Detection: Category-based risk analysis over 30/60/90 day periods
- High-Risk Zone Identification: Automated zone risk scoring based on incidents, near-misses, and overdue actions
- Incident Probability Prediction: Predictive probability calculation for zones and categories
- Explainable Scores: All risk scores include detailed explanations of contributing factors
- Deterministic Heuristics: No machine learning - transparent, auditable formulas
Data Sources:
- Safety incidents
- Near-miss reports
- Safety actions
- Checklist submissions
- Risk assessments
Access:
- Admin/Safety Officers: Full access to Safety Intelligence Dashboard
- Workers/Drivers: Read access to zone risk information
6. Safety Workflows (Enterprise)
Configurable workflow engine for safety processes with visual drag-and-drop editor.
Key Features:
- Visual drag-and-drop workflow builder
- Role-based approval steps (Admin, Safety Officer, Worker)
- Support for multiple entity types:
- Incidents
- Risk Assessments
- Permit to Work (PTW)
- Audits
- Draft and Published workflow versions
- Step-based approvals with SLA/timeout
- Escalation on timeout
- Full audit trail
- Workflow instances tracking
Workflow States:
- Draft: Work in progress, not yet active
- Published: Active workflow used for new entities
- Active: Workflow is enabled and can be assigned
Node Types:
- Start: Entry point
- Approval: Requires role-based approval
- Task: Action item assignment
- Condition: Branching logic based on entity properties
- End: Completion point
Access:
- Admin/Safety Officers: Can create, edit, and manage workflows
- Workers: Execute workflow steps assigned to them
- Workflows are optional - existing processes work without workflows
Visual Editor:
- Drag-and-drop canvas interface
- Node configuration panel (role, SLA, notifications)
- Validation warnings (missing start/end, unreachable nodes, cycles)
- Grid background with zoom/pan controls
- Dark theme compatible
7. Safety Culture & Engagement (Enterprise)
Safety scoring, points, badges, and recognition system.
Key Features:
- Safety Scores: Per-user, per-team, and per-zone safety scores (0-100)
- Points System: Points awarded for near-miss reports, checklist completion, training completion
- Achievement Badges: Automatic badge awards (Near-Miss Champion, Checklist Master, Training Complete, Safety Leader, Zero Incidents)
- Leaderboards: Optional team/zone leaderboards (edition-gated)
- Recognition Automation: Automatic recognition for safety achievements
- Opt-out Support: Anonymous tenants can disable culture features
Database Tables:
safety_scores: User/team/zone scoressafety_points_log: Points awarded for actionssafety_badges: Achievement badges earned
Access:
- All users: View own scores, points, badges
- Admins: Full access, can award points/badges manually
- Culture features: Optional per tenant (can be disabled)
8. Industry Profiles (Enterprise)
Configurable safety profiles for different industries.
Supported Profiles:
- Warehouse
- Manufacturing
- Construction
- Workshop
Profile Configuration:
- Default incident categories
- Default checklist categories
- Default workflow templates
- Risk assessment matrices
Features:
- Fully configurable per tenant
- Switchable profiles (non-destructive)
- Existing data remains valid when switching profiles
9. Compliance Dashboard
KPI dashboard for safety compliance metrics.
Metrics:
- Open incidents count
- Critical incidents count
- Overdue actions count
- Checklist compliance percentage
- Training completion percentage
Features:
- Visual charts and graphs
- Incident category distribution
- Export to PDF (coming soon)
Access:
- Safety Officers/Admins: Full access
Roles & Permissions
Safety Officer (Sicherheitsbeauftragter)
Permissions:
- Full control over Safety module
- Create and manage checklists
- Manage incidents and actions
- Create and manage trainings
- Create and manage workflows (visual editor)
- View compliance dashboard
Admin
Permissions:
- Full access to all safety features
- Same as Safety Officer
Worker
Permissions:
- Report incidents
- Complete checklists
- Complete trainings (Unterweisungen)
- View own incident reports
Driver
Permissions:
- Report incidents
- View safety information
- Access Driver Safety Dashboard
- Complete assigned checklists (vehicle, PPE)
- View safety training videos
- View safety alerts
- View own incident history
Worker & Driver Safety Dashboards
Driver Safety Dashboard
Location: /driver/safety
Features:
- Report Incident: Quick incident reporting interface
- My Checklists: View and complete assigned safety checklists
- Vehicle checks (daily inspections)
- PPE (Personal Protective Equipment) checks
- Forklift safety checks
- Safety Trainings: Access training videos and materials
- Safety Alerts: View alerts for dangerous zones or situations
- Incident History: View own reported incidents and their status
Access:
- Available to users with
driverrole - Minimal, focused interface optimized for mobile use
- No admin-only features or analytics
Worker Safety Dashboard
Location: /worker/safety
Features:
- All Driver Features (see above) plus:
- Report Hazards: Report potential hazards or unsafe conditions
- Safety Walks: Execute assigned safety walk tasks and inspections
- Corrective Actions: View and follow corrective actions assigned by admin
- Zone Documentation: Access zone-specific safety documentation
- Training Quizzes: Take training quizzes and assessments
Access:
- Available to users with
workerrole - Extended interface with additional worker-specific features
- No admin-only features or analytics
Role Matrix
| Feature | Driver | Worker | Admin |
|---|---|---|---|
| Report Incident | ✅ | ✅ | ✅ |
| View Checklists | ✅ (assigned only) | ✅ (all) | ✅ (all) |
| Complete Checklists | ✅ | ✅ | ✅ |
| View Trainings | ✅ | ✅ | ✅ |
| View Alerts | ✅ | ✅ | ✅ |
| View Own Incidents | ✅ | ✅ | ✅ |
| Report Hazards | ❌ | ✅ | ✅ |
| Execute Safety Walks | ❌ | ✅ | ✅ |
| View Corrective Actions | ❌ | ✅ | ✅ |
| Zone Documentation | ❌ | ✅ | ✅ |
| Training Quizzes | ❌ | ✅ | ✅ |
| Full Admin Access | ❌ | ❌ | ✅ |
Language Management
User Language Preferences
Each user can select their preferred language independently. The language preference is stored in the profiles.language column.
Supported Languages:
de(Deutsch / German) - Defaulten(English)bg(Български / Bulgarian)
Language Detection Priority:
- URL prefix (e.g.,
/de/,/en/,/bg/) - User preference (
profiles.language) - Tenant default (
tenants.default_language) - Browser language
- Fallback to
de(German)
Language Switcher:
- Available in user header area (compact icon + dropdown)
- Options:
Deutsch,English,Български - Saves choice instantly (optimistic update)
- Re-renders dashboard without page reload
- Preference persists across sessions
Storage:
- User language:
profiles.language(text, CHECK constraint: 'de'|'en'|'bg') - Tenant default:
tenants.default_language(optional) - Migration:
20250125000000_add_user_language_preference.sql
API:
getUserLanguage(): Get user's language preferenceupdateUserLanguage(language): Update user's language preferencegetTenantLanguage(): Get tenant's default languagedetectLanguage(): Detect language using priority chain
Edition Mapping
Safety Pro Edition
Available Modules:
- Safety module
- System Settings (basic)
Use Case:
- Standalone safety management for any industry
- No logistics/warehouse features required
Enterprise Edition
Available Modules:
- All modules including Safety Pro features
Use Case:
- Full-featured system with safety management
Pro Edition
Available Modules:
- Safety module (basic features)
- Other logistics modules
Use Case:
- Safety features alongside logistics operations
Database Schema
Tables
safety_incidents
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)reported_by: UUID (Foreign Key to profiles)category: text (injury, near_miss, hazard, property_damage, chemical, haccp, hygiene, machine_failure)severity: text (low, medium, high, critical)description: textlocation: text (free text, universal)zone_id: UUID (optional, nullable for non-warehouse tenants)attachments: text[] (array of URLs)created_at: timestampupdated_at: timestamp
safety_actions
id: UUID (Primary Key)incident_id: UUID (Foreign Key to safety_incidents)assigned_to: UUID (Foreign Key to profiles, nullable)action: textdue_date: date (nullable)status: text (open, in_progress, done)completed_at: timestamp (nullable)created_at: timestampupdated_at: timestamp
safety_checklists
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)name: textcategory: text (hygiene, ppe, machine_check, vehicle_check, construction_site, office_safety)created_by: UUID (Foreign Key to profiles)created_at: timestampupdated_at: timestamp
safety_checklist_items
id: UUID (Primary Key)checklist_id: UUID (Foreign Key to safety_checklists)question: textrequired: boolean (default: true)sort_order: intcreated_at: timestamp
safety_checklist_submissions
id: UUID (Primary Key)checklist_id: UUID (Foreign Key to safety_checklists)submitted_by: UUID (Foreign Key to profiles)result: jsonb (answers: { "item_id": "yes|no|na" })score: int (percentage)created_at: timestamp
safety_trainings
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)title: textdescription: text (nullable)type: text (unterweisung, schulung, e-learning)content_url: text (nullable)created_at: timestampupdated_at: timestamp
safety_training_completion
id: UUID (Primary Key)training_id: UUID (Foreign Key to safety_trainings)user_id: UUID (Foreign Key to profiles)completed_at: timestampsignature_url: text (nullable)- Unique constraint on (training_id, user_id)
safety_insights
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)insight_type: text (leading_indicator, risk_trend, high_risk_zone, incident_probability)zone_id: UUID (nullable)category: text (nullable)score: double precisiontrend: text (increasing, stable, decreasing)explanation: textmetadata: jsonbcalculated_at: timestampexpires_at: timestamp (nullable)
safety_workflows
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)name: textdescription: text (nullable)entity_type: text (incident, risk, permit, audit)steps: jsonb (published workflow steps)draft_steps: jsonb (draft workflow steps, nullable)version: integer (workflow version)published_at: timestamp (nullable)active: booleanis_default: booleancreated_at: timestampupdated_at: timestamp
workflow_templates
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)name: textdescription: text (nullable)entity_type: text (incident, risk, permit, audit)steps: jsonb (workflow steps schema)is_public: boolean (can be used by other tenants)created_by: UUID (nullable)created_at: timestampupdated_at: timestamp
workflow_rules
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)workflow_id: UUID (nullable)rule_type: text (kpi_trigger, time_based, condition_based)trigger_condition: jsonbaction: jsonbactive: booleancreated_at: timestampupdated_at: timestamp
workflow_metrics
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)workflow_id: UUID (nullable)instance_id: UUID (nullable)step_index: integerstep_name: text (nullable)started_at: timestampcompleted_at: timestamp (nullable)sla_hours: integer (nullable)actual_hours: double precision (nullable)breached: booleanescalated: booleancreated_at: timestamp
safety_scores
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)user_id: UUID (nullable)zone_id: UUID (nullable)score_type: text (user, team, zone)score: double precision (0-100)period_start: timestampperiod_end: timestampcalculated_at: timestampmetadata: jsonb
safety_points_log
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)user_id: UUIDpoints: integerreason: textsource_type: text (near_miss, checklist, training, recognition, other)source_id: UUID (nullable)awarded_at: timestampawarded_by: UUID (nullable)
safety_badges
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)user_id: UUIDbadge_type: text (near_miss_champion, checklist_master, training_complete, safety_leader, zero_incidents, custom)badge_name: textbadge_description: text (nullable)earned_at: timestampmetadata: jsonb
safety_profiles
id: UUID (Primary Key)tenant_id: UUID (Foreign Key to tenants)name: textdescription: text (nullable)is_default: booleanincident_categories: text[]checklist_categories: text[]default_workflows: jsonbrisk_matrix: jsonbcreated_at: timestampupdated_at: timestamp
workflow_instances
id: UUID (Primary Key)workflow_id: UUID (Foreign Key to safety_workflows)entity_id: UUID (references entity by entity_type)entity_type: text (incident, risk, permit, audit)current_step: integerstatus: text (pending, in_progress, completed, cancelled)started_at: timestampcompleted_at: timestamp (nullable)started_by: UUID (Foreign Key to profiles)completed_by: UUID (Foreign Key to profiles, nullable)timeout_at: timestamp (nullable)metadata: jsonb (nullable)created_at: timestampupdated_at: timestamp
workflow_audit_log
id: UUID (Primary Key)instance_id: UUID (Foreign Key to workflow_instances)action: text (started, step_completed, step_approved, escalated, cancelled, completed)step_index: integerperformed_by: UUID (Foreign Key to profiles)notes: text (nullable)metadata: jsonb (nullable)created_at: timestamp
Row-Level Security (RLS)
All safety tables have RLS enabled with the following policies:
Tenant Isolation
- Users can only see data from their own tenant
- Super-admins can see all tenant data
Role-Based Access
- Safety Officers/Admins: Full CRUD access
- Workers: Can create incidents, submit checklists, complete trainings
- Drivers: Can create incidents (read-only for other data)
API Services
Incident Service
reportSafetyIncident(): Report new incidentgetSafetyIncidents(): Get all incidents (with filters)getSafetyIncidentById(): Get incident detailscreateSafetyAction(): Create action itemupdateSafetyAction(): Update action status
Checklist Service
createSafetyChecklist(): Create new checklistgetSafetyChecklists(): Get all checklistsgetSafetyChecklistById(): Get checklist detailssubmitSafetyChecklist(): Submit completed checklistgetSafetyChecklistSubmissions(): Get submission history
Training Service
createSafetyTraining(): Create new traininggetSafetyTrainings(): Get all trainingsgetSafetyTrainingById(): Get training detailscompleteSafetyTraining(): Mark training as completedgetSafetyTrainingCompletions(): Get completion recordshasCompletedTraining(): Check if user completed training
Safety Intelligence Service
computeLeadingIndicators(): Calculate leading safety indicatorsdetectRiskTrends(): Detect risk trends over period (30d/60d/90d)identifyHighRiskZones(): Identify and score high-risk zonespredictIncidentProbability(): Predict incident probability for zone/category
Workflow Service
getSafetyWorkflows(): Get all workflows (with optional entity_type filter)getDefaultWorkflow(): Get default workflow for entity typecreateSafetyWorkflow(): Create new workflowupdateSafetyWorkflow(): Update workflow metadatadeleteSafetyWorkflow(): Deactivate workflowsaveWorkflowDraft(): Save workflow as draftpublishWorkflowDraft(): Publish draft workflowrollbackWorkflowDraft(): Rollback to published versionstartEntityWorkflowIfConfigured(): Start workflow instance for entity (if workflow exists)getEntityWorkflowIfExists(): Get active workflow instance for entitycanPerformWorkflowAction(): Check if user can perform workflow actiongetWorkflowTemplates(): Get workflow templates (including public)createWorkflowTemplate(): Create template from workflowcreateWorkflowFromTemplate(): Create workflow from templategetWorkflowRules(): Get workflow escalation rulescreateWorkflowRule(): Create workflow rulegetWorkflowMetrics(): Get SLA and performance metricssimulateWorkflow(): Simulate workflow execution (dry-run)
Mobile Usage
Checklist Execution
- Fully mobile-optimized interface
- Touch-friendly buttons
- Offline capability (coming soon)
Incident Reporting
- Camera integration for attachments
- Quick reporting workflow
- Location capture
Training Completion
- Digital signature support
- Mobile-friendly content viewing
Integration
Optional Zone Integration
- If warehouse modules exist, incidents can optionally reference zones
zone_idfield is nullable for universal support- Non-warehouse tenants use free-text
locationfield
Edition Gating
All safety features are protected by FeatureGate component:
<FeatureGate module="safety">
<SafetyComponent />
</FeatureGate>Best Practices
- Regular Checklist Execution: Encourage daily/weekly checklist completion
- Timely Incident Reporting: Report incidents immediately
- Action Follow-up: Monitor and complete action items before due dates
- Training Compliance: Ensure all users complete required trainings
- Compliance Monitoring: Regularly review compliance dashboard
Troubleshooting
Module Not Available
- Check tenant edition assignment
- Verify
safety_proorenterpriseedition is assigned - Contact super-admin for edition upgrade
Permission Denied
- Verify user role (safety_officer, admin, worker, driver)
- Check RLS policies
- Ensure user is assigned to correct tenant
Checklist Submission Fails
- Verify all required questions are answered
- Check network connection
- Ensure checklist is still active
Support
For issues or questions:
- Check this documentation
- Review RLS policies
- Contact system administrator
- Check edition assignment
Future Enhancements
- PDF export for compliance reports
- Email notifications for overdue actions
- Mobile app (PWA)
- Offline checklist execution
- Advanced analytics and reporting
- Integration with external safety systems