-- Demo OHS incidents for dashboard metrics
INSERT INTO ohs_incidents (
  id, injury_date, injury_time, classification, nature, location,
  activity, how_sustained, days_lost, outcome, status, tenant_id, branch_id
) VALUES
  (2, '2025-06-01', '10:00', 'first_aid', 'minor', 'Workshop',
   'Using box cutter', 'Hand slipped while opening package', 0,
   'Treated onsite', 'closed', 1, 1),
  (3, '2025-06-05', '14:20', 'near_miss', 'none', 'Warehouse',
   'Forklift operating', 'Pallet nearly struck employee', 0,
   'No injury', 'reported', 1, 1),
  (4, '2025-06-08', '11:15', 'medical_treatment', 'moderate', 'Construction Site',
   'Carrying tools', 'Tripped on uneven surface', 0,
   'Clinic visit', 'investigating', 1, 1),
  (5, '2025-06-12', '08:40', 'lti', 'major', 'Maintenance Yard',
   'Working on ladder', 'Fall from height', 14,
   'Workers comp', 'reported', 1, 1),
  (6, '2025-06-20', '09:10', 'fatality', 'critical', 'Highway Project',
   'Traffic control', 'Hit by reversing truck', NULL,
   'Under investigation', 'investigating', 1, 1);

-- Sample workflows illustrating action status automation
INSERT INTO workflows (id, name, trigger_event, definition, is_active) VALUES
  (200, 'OHS Action Overdue Notification', 'ohs.actionOverdue', '{"conditions":[]}', TRUE),
  (201, 'OHS Action Completed', 'ohs.actionCompleted', '{"conditions":[]}', TRUE);

INSERT INTO workflow_steps (workflow_id, step_order, step_type, config) VALUES
  (200, 1, 'update_status', '{"table":"ohs_actions","field":"status","value":"overdue"}'),
  (200, 2, 'notify_manager', '{"message":"Corrective action overdue"}'),
  (201, 1, 'update_status', '{"table":"ohs_actions","field":"status","value":"completed"}');
