-- Add RFQ Template Builder to Dev program for demo visibility
-- Dev program UUID used elsewhere: 0194a8b2-def0-7123-8123-123456789abc

-- Ensure the module exists (by fixed UUID)
INSERT INTO modules (module_id, name, description)
SELECT '0194a8b2-0021-7123-8123-123456789abc'::uuid, 'rfq_template_builder', 'RFQ Template Builder'
WHERE NOT EXISTS (
  SELECT 1 FROM modules WHERE module_id = '0194a8b2-0021-7123-8123-123456789abc'::uuid
);

-- Link module to Dev program
INSERT INTO program_modules (program_id, module_id, config_json)
SELECT '0194a8b2-def0-7123-8123-123456789abc'::uuid,
       '0194a8b2-0021-7123-8123-123456789abc'::uuid,
       NULL
WHERE NOT EXISTS (
  SELECT 1 FROM program_modules pm
  WHERE pm.program_id = '0194a8b2-def0-7123-8123-123456789abc'::uuid
    AND pm.module_id = '0194a8b2-0021-7123-8123-123456789abc'::uuid
);
