-- Workflow Engine v1.0 - reusable master definitions
-- Run after 01_workflow_schema.sql. The script is safe to re-run.


INSERT INTO workflow_component_type
    (code, name, renderer_file, description, properties_json, status, sort_order, created_at)
VALUES
    ('FORM', 'Form', 'form.php', 'Standard field container.', NULL, 1, 10, NOW()),
    ('MATRIX', 'Matrix', 'matrix.php', 'Tabular field matrix.', NULL, 1, 20, NOW()),
    ('REPEATER', 'Repeater', 'repeater.php', 'Repeatable field row container.', NULL, 1, 30, NOW()),
    ('CARD', 'Card', 'card.php', 'Information card.', NULL, 1, 40, NOW()),
    ('UPLOAD', 'Upload', 'upload.php', 'File upload container.', NULL, 1, 50, NOW()),
    ('SUMMARY', 'Summary', 'summary.php', 'Read-only value summary.', NULL, 1, 60, NOW()),
    ('TABLE', 'Table', 'table.php', 'Read-only dataset table.', NULL, 1, 70, NOW()),
    ('HTML', 'HTML', 'html.php', 'Sanitized static HTML content.', NULL, 1, 80, NOW()),
    ('DIVIDER', 'Divider', 'divider.php', 'Visual section divider.', NULL, 1, 90, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name), renderer_file = VALUES(renderer_file), description = VALUES(description),
    status = VALUES(status), sort_order = VALUES(sort_order), updated_at = NOW();


