-- StarRupture Factory Hub Seed Data
-- Sample data for testing and demonstration

-- Sample Items
INSERT INTO `items` (`name`, `slug`, `category`, `stack_size`, `description`) VALUES
('Titanium Ore', 'titanium-ore', 'raw', 200, 'Raw titanium ore extracted from mineral deposits. Base material for titanium processing.'),
('Iron Ore', 'iron-ore', 'raw', 200, 'Raw iron ore used in basic metal production.'),
('Copper Ore', 'copper-ore', 'raw', 200, 'Raw copper ore essential for electrical components.'),
('Titanium Ingot', 'titanium-ingot', 'intermediate', 100, 'Refined titanium ingot smelted from ore. Used in advanced manufacturing.'),
('Iron Plate', 'iron-plate', 'intermediate', 100, 'Processed iron plate for construction and machinery.'),
('Copper Wire', 'copper-wire', 'intermediate', 200, 'Copper wire for electrical circuits and connections.'),
('Titanium Rod', 'titanium-rod', 'component', 50, 'Precision-machined titanium rod for structural components.'),
('Circuit Board', 'circuit-board', 'component', 50, 'Advanced circuit board for electronic systems.'),
('Steel Beam', 'steel-beam', 'component', 50, 'Heavy-duty steel structural beam.'),
('Power Cell', 'power-cell', 'consumable', 20, 'Rechargeable power cell for energy storage.');

-- Sample Buildings
INSERT INTO `buildings` (`name`, `category`, `footprint`, `power_w`, `description`) VALUES
('Mining Drill', 'Extraction', '2x2', -50, 'Automated mining drill for resource extraction. Extracts ore from resource nodes.'),
('Smelter', 'Processing', '3x3', -100, 'High-temperature smelter for ore processing. Converts raw ore into refined ingots.'),
('Constructor', 'Crafting', '2x3', -80, 'Basic manufacturing unit for simple component assembly.'),
('Assembler', 'Crafting', '3x4', -150, 'Advanced assembler for complex component manufacturing.'),
('Rail System Mk1', 'Transport', '1x1', -5, 'Basic rail transport system for moving materials between facilities.'),
('Coal Generator', 'Power', '4x4', 75, 'Coal-burning power generator. Produces electricity from coal fuel.'),
('Storage Container', 'Storage', '2x2', 0, 'Large storage container for bulk material storage.');

-- Sample Recipes

-- Titanium Ingot (Smelter: Titanium Ore -> Titanium Ingot)
INSERT INTO `recipes` (`name`, `building_id`, `duration_sec`, `power_w`, `notes`)
VALUES ('Smelt Titanium Ingot', 2, 3.00, 0, 'Basic titanium smelting process');
SET @recipe_id = LAST_INSERT_ID();
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 1, 2);
INSERT INTO `recipe_outputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 4, 1);

-- Iron Plate (Smelter: Iron Ore -> Iron Plate)
INSERT INTO `recipes` (`name`, `building_id`, `duration_sec`, `power_w`, `notes`)
VALUES ('Smelt Iron Plate', 2, 2.00, 0, 'Basic iron smelting process');
SET @recipe_id = LAST_INSERT_ID();
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 2, 1);
INSERT INTO `recipe_outputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 5, 1);

-- Copper Wire (Constructor: Copper Ore -> Copper Wire)
INSERT INTO `recipes` (`name`, `building_id`, `duration_sec`, `power_w`, `notes`)
VALUES ('Process Copper Wire', 3, 1.50, 0, 'Wire drawing process from copper ore');
SET @recipe_id = LAST_INSERT_ID();
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 3, 1);
INSERT INTO `recipe_outputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 6, 4);

-- Titanium Rod (Constructor: Titanium Ingot -> Titanium Rod)
INSERT INTO `recipes` (`name`, `building_id`, `duration_sec`, `power_w`, `notes`)
VALUES ('Machine Titanium Rod', 3, 4.00, 0, 'Precision machining of titanium rods');
SET @recipe_id = LAST_INSERT_ID();
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 4, 1);
INSERT INTO `recipe_outputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 7, 2);

-- Circuit Board (Assembler: Copper Wire + Iron Plate -> Circuit Board)
INSERT INTO `recipes` (`name`, `building_id`, `duration_sec`, `power_w`, `notes`)
VALUES ('Assemble Circuit Board', 4, 6.00, 0, 'Advanced circuit board fabrication');
SET @recipe_id = LAST_INSERT_ID();
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 6, 8);
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 5, 2);
INSERT INTO `recipe_outputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 8, 1);

-- Steel Beam (Assembler: Iron Plate -> Steel Beam)
INSERT INTO `recipes` (`name`, `building_id`, `duration_sec`, `power_w`, `notes`)
VALUES ('Forge Steel Beam', 4, 5.00, 0, 'High-temperature steel forging');
SET @recipe_id = LAST_INSERT_ID();
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 5, 3);
INSERT INTO `recipe_outputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 9, 1);

-- Power Cell (Assembler: Copper Wire + Titanium Ingot -> Power Cell)
INSERT INTO `recipes` (`name`, `building_id`, `duration_sec`, `power_w`, `notes`)
VALUES ('Manufacture Power Cell', 4, 8.00, 0, 'Advanced energy cell production');
SET @recipe_id = LAST_INSERT_ID();
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 6, 4);
INSERT INTO `recipe_inputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 4, 2);
INSERT INTO `recipe_outputs` (`recipe_id`, `item_id`, `amount`) VALUES (@recipe_id, 10, 1);

-- Sample Resource Nodes
INSERT INTO `resource_nodes` (`item_id`, `quality`, `base_yield_ipm`, `location_text`, `notes`) VALUES
(1, 'normal', 60, 'Northern Mountains Sector A', 'Standard titanium deposit'),
(1, 'rich', 120, 'Northern Mountains Sector B', 'High-yield titanium deposit'),
(2, 'normal', 60, 'Eastern Plains Grid 4-7', 'Standard iron deposit'),
(2, 'poor', 30, 'Eastern Plains Grid 2-3', 'Low-yield iron deposit'),
(3, 'normal', 60, 'Southern Desert Zone C', 'Standard copper deposit'),
(3, 'rich', 120, 'Southern Desert Zone D', 'High-yield copper deposit');

-- Sample Transport Systems
INSERT INTO `transport` (`name`, `type`, `throughput_ipm`, `lanes`, `power_w`, `notes`) VALUES
('Belt Conveyor Mk1', 'belt', 60, 1, 2, 'Basic belt transport system'),
('Belt Conveyor Mk2', 'belt', 120, 1, 3, 'Upgraded belt with double throughput'),
('Rail Transport Mk1', 'rail', 240, 1, 5, 'Efficient rail system for bulk transport'),
('Rail Transport Mk2', 'rail', 480, 1, 8, 'High-speed rail for maximum throughput'),
('Fluid Pipe Mk1', 'pipe', 300, 1, 1, 'Basic pipeline for liquid transport'),
('Drone Carrier', 'drone', 100, 2, 15, 'Aerial drone transport for flexible routing');
