INSERT INTO roles (name) VALUES ('Admin');

INSERT INTO device_types (name) VALUES ('Router'), ('OLT'), ('Switch'), ('Splitter');

INSERT INTO locations (name, address, latitude, longitude)
VALUES ('Mirpur Example', 'Dhaka, Bangladesh', 23.8223000, 90.3654000);

INSERT INTO devices (device_type_id, location_id, name, ip_address, vendor, model, status)
VALUES
(1, 1, 'MikroTik Core Router', '192.168.88.1', 'MikroTik', 'CCR', 'online'),
(2, 1, 'OLT-01', '192.168.88.2', 'Generic', 'OLT', 'online');

INSERT INTO fiber_nodes (location_id, node_type, name, latitude, longitude, description)
VALUES
(1, 'tj', 'TJ-01', 23.8223000, 90.3654000, 'Main TJ point'),
(1, 'splitter', 'Splitter-01', 23.8230000, 90.3660000, 'Splitter point');

INSERT INTO fiber_links (from_node_id, to_node_id, route_name, cable_code, fiber_count, status, length_meters)
VALUES (1, 2, 'Main Fiber Route', 'FBR-001', 12, 'up', 120.50);

INSERT INTO device_fiber_dependencies (device_id, fiber_link_id) VALUES (1, 1), (2, 1);

INSERT INTO message_templates (template_name, template_key, subject, body, channel, is_active)
VALUES
('Device Offline Alert', 'device_offline_alert', 'Device Offline', 'Alert: {{device_name}} is offline at {{checked_at}}.', 'telegram', 1),
('Fiber Down Alert', 'fiber_down_alert', 'Fiber Down', 'Fiber route {{route_name}} is down because parent device {{device_name}} is offline.', 'telegram', 1);
