-- Seed data for the Inspections schema, from section 14 of the blueprint. Load after inspections.sql. -- Configuration only: settings, people, sites, template versions and schedules. The inspection history is left out (see the page's seed note). INSERT INTO settings (id, company_name, time_zone, action_due_days_high, action_due_days_normal) VALUES (1, 'Northline Retail', 'America/New_York', 1, 7); INSERT INTO people (id, name, email, role, active) VALUES ('person_dana', 'Dana Ruiz', 'dana@northline.example', 'admin', TRUE), ('person_luis', 'Luis Ortega', 'luis@northline.example', 'manager', TRUE), ('person_amy', 'Amy Chen', 'amy@northline.example', 'manager', TRUE), ('person_sam', 'Sam Patel', 'sam@northline.example', 'inspector', TRUE); INSERT INTO sites (id, name, address, manager_id) VALUES ('site_riverside', 'Riverside', '120 River Road', 'person_luis'), ('site_harbor', 'Harbor', '8 Harbor Street', 'person_amy'), ('site_hilltop', 'Hilltop', '455 Hilltop Avenue', 'person_amy'); -- Dana is an admin and sees every site; the spec assigns her none. INSERT INTO person_sites (person_id, site_id) VALUES ('person_luis', 'site_riverside'), ('person_amy', 'site_harbor'), ('person_amy', 'site_hilltop'), ('person_sam', 'site_riverside'), ('person_sam', 'site_harbor'); -- Versions 1 and 2 of the audit are archived history: version 2 added the signature, version 3 made Fire exit clear high priority with a photo required on fail. INSERT INTO templates (id, version, name, status) VALUES ('template_store_audit', 1, 'Monthly store audit', 'archived'), ('template_store_audit', 2, 'Monthly store audit', 'archived'), ('template_store_audit', 3, 'Monthly store audit', 'published'), ('template_opening_checklist', 1, 'Daily opening checklist', 'published'); -- The daily checklist's questions are listed without a section in the spec, so its one section has no title. INSERT INTO template_sections (template_id, version, position, title) VALUES ('template_store_audit', 1, 1, 'Front of store'), ('template_store_audit', 1, 2, 'Stockroom'), ('template_store_audit', 1, 3, 'Safety'), ('template_store_audit', 2, 1, 'Front of store'), ('template_store_audit', 2, 2, 'Stockroom'), ('template_store_audit', 2, 3, 'Safety'), ('template_store_audit', 2, 4, 'Sign-off'), ('template_store_audit', 3, 1, 'Front of store'), ('template_store_audit', 3, 2, 'Stockroom'), ('template_store_audit', 3, 3, 'Safety'), ('template_store_audit', 3, 4, 'Sign-off'), ('template_opening_checklist', 1, 1, NULL); -- Weights are 1 except the signature, which is worth no points. Fridge temperature is in degrees Celsius, 0 to 5. INSERT INTO template_questions (template_id, version, id, section_position, position, text, kind, weight, min, max, photo_required_on_fail, high_priority) VALUES ('template_store_audit', 1, 'entrance_clean_and_unobstructed', 1, 1, 'Entrance clean and unobstructed', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'window_displays_up_to_date', 1, 2, 'Window displays up to date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'price_labels_correct', 1, 3, 'Price labels correct', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'shelves_fully_stocked', 1, 4, 'Shelves fully stocked', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'promotional_signage_current', 1, 5, 'Promotional signage current', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'floors_clean', 1, 6, 'Floors clean', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'checkout_area_tidy', 1, 7, 'Checkout area tidy', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'staff_in_uniform', 1, 8, 'Staff in uniform', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'stock_rotated_first_in_first_out', 2, 1, 'Stock rotated (first in, first out)', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'deliveries_checked_in', 2, 2, 'Deliveries checked in', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'no_stock_stored_on_the_floor', 2, 3, 'No stock stored on the floor', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'damaged_goods_labelled', 2, 4, 'Damaged goods labelled', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'pallet_truck_parked_safely', 2, 5, 'Pallet truck parked safely', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'stockroom_tidy', 2, 6, 'Stockroom tidy', 'rating', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'fire_exit_clear', 3, 1, 'Fire exit clear', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'fire_extinguishers_in_date', 3, 2, 'Fire extinguishers in date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'first_aid_kit_stocked', 3, 3, 'First aid kit stocked', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'emergency_lighting_working', 3, 4, 'Emergency lighting working', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'wet_floor_signs_available', 3, 5, 'Wet floor signs available', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 1, 'accident_book_up_to_date', 3, 6, 'Accident book up to date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'entrance_clean_and_unobstructed', 1, 1, 'Entrance clean and unobstructed', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'window_displays_up_to_date', 1, 2, 'Window displays up to date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'price_labels_correct', 1, 3, 'Price labels correct', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'shelves_fully_stocked', 1, 4, 'Shelves fully stocked', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'promotional_signage_current', 1, 5, 'Promotional signage current', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'floors_clean', 1, 6, 'Floors clean', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'checkout_area_tidy', 1, 7, 'Checkout area tidy', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'staff_in_uniform', 1, 8, 'Staff in uniform', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'stock_rotated_first_in_first_out', 2, 1, 'Stock rotated (first in, first out)', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'deliveries_checked_in', 2, 2, 'Deliveries checked in', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'no_stock_stored_on_the_floor', 2, 3, 'No stock stored on the floor', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'damaged_goods_labelled', 2, 4, 'Damaged goods labelled', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'pallet_truck_parked_safely', 2, 5, 'Pallet truck parked safely', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'stockroom_tidy', 2, 6, 'Stockroom tidy', 'rating', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'fire_exit_clear', 3, 1, 'Fire exit clear', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'fire_extinguishers_in_date', 3, 2, 'Fire extinguishers in date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'first_aid_kit_stocked', 3, 3, 'First aid kit stocked', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'emergency_lighting_working', 3, 4, 'Emergency lighting working', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'wet_floor_signs_available', 3, 5, 'Wet floor signs available', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'accident_book_up_to_date', 3, 6, 'Accident book up to date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 2, 'signature', 4, 1, 'Signature', 'signature', 0, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'entrance_clean_and_unobstructed', 1, 1, 'Entrance clean and unobstructed', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'window_displays_up_to_date', 1, 2, 'Window displays up to date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'price_labels_correct', 1, 3, 'Price labels correct', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'shelves_fully_stocked', 1, 4, 'Shelves fully stocked', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'promotional_signage_current', 1, 5, 'Promotional signage current', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'floors_clean', 1, 6, 'Floors clean', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'checkout_area_tidy', 1, 7, 'Checkout area tidy', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'staff_in_uniform', 1, 8, 'Staff in uniform', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'stock_rotated_first_in_first_out', 2, 1, 'Stock rotated (first in, first out)', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'deliveries_checked_in', 2, 2, 'Deliveries checked in', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'no_stock_stored_on_the_floor', 2, 3, 'No stock stored on the floor', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'damaged_goods_labelled', 2, 4, 'Damaged goods labelled', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'pallet_truck_parked_safely', 2, 5, 'Pallet truck parked safely', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'stockroom_tidy', 2, 6, 'Stockroom tidy', 'rating', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'fire_exit_clear', 3, 1, 'Fire exit clear', 'yes_no', 1, NULL, NULL, TRUE, TRUE), ('template_store_audit', 3, 'fire_extinguishers_in_date', 3, 2, 'Fire extinguishers in date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'first_aid_kit_stocked', 3, 3, 'First aid kit stocked', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'emergency_lighting_working', 3, 4, 'Emergency lighting working', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'wet_floor_signs_available', 3, 5, 'Wet floor signs available', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'accident_book_up_to_date', 3, 6, 'Accident book up to date', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_store_audit', 3, 'signature', 4, 1, 'Signature', 'signature', 0, NULL, NULL, FALSE, FALSE), ('template_opening_checklist', 1, 'lights_and_signage_on', 1, 1, 'Lights and signage on', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_opening_checklist', 1, 'fridge_temperature', 1, 2, 'Fridge temperature', 'number', 1, 0, 5, FALSE, TRUE), ('template_opening_checklist', 1, 'floor_clear_and_dry', 1, 3, 'Floor clear and dry', 'yes_no', 1, NULL, NULL, FALSE, FALSE), ('template_opening_checklist', 1, 'cash_float_counted', 1, 4, 'Cash float counted', 'yes_no', 1, NULL, NULL, FALSE, FALSE); INSERT INTO schedules (id, template_id, site_id, every, weekday, day_of_month, due_time, assignee_id, active) VALUES ('schedule_opening_riverside', 'template_opening_checklist', 'site_riverside', 'daily', NULL, NULL, '09:00', 'person_sam', TRUE), ('schedule_opening_harbor', 'template_opening_checklist', 'site_harbor', 'daily', NULL, NULL, '09:00', 'person_sam', TRUE), ('schedule_opening_hilltop', 'template_opening_checklist', 'site_hilltop', 'daily', NULL, NULL, '09:00', 'person_amy', TRUE), ('schedule_audit_riverside', 'template_store_audit', 'site_riverside', 'monthly', NULL, 6, '17:00', 'person_luis', TRUE), ('schedule_audit_harbor', 'template_store_audit', 'site_harbor', 'monthly', NULL, 6, '17:00', 'person_amy', TRUE), ('schedule_audit_hilltop', 'template_store_audit', 'site_hilltop', 'monthly', NULL, 6, '17:00', 'person_amy', TRUE); -- No inspections, answers, actions, events or notifications are loaded.