import type { RuleEditorState } from "@/lib/mail-automation/types" /** Règle pré-remplie pour la démo produit Ultimail (éditeur no-code). */ export function createUltimailProductDemoRuleState(): RuleEditorState { const startId = "product-demo-start" const condId = "product-demo-cond" const actionsId = "product-demo-actions" const endId = "product-demo-end" return { name: "Tri factures → Comptabilité", priority: 10, is_active: true, rule_kind: "rule", workflow: { version: 1, kind: "rule", triggers: { operator: "or", groups: [ { operator: "and", items: [{ type: "message_received" }], }, ], }, variables: [], nodes: [ { id: startId, type: "start", position: { x: 40, y: 160 }, data: {} }, { id: condId, type: "condition", position: { x: 240, y: 140 }, data: { field: "subject", operator: "contains", value: "facture" }, }, { id: actionsId, type: "actions", position: { x: 480, y: 120 }, data: { actions: [ { type: "label", value: "Comptabilité" }, { type: "archive", value: "" }, ], }, }, { id: endId, type: "end", position: { x: 720, y: 160 }, data: {} }, ], edges: [ { id: "product-demo-e1", source: startId, target: condId }, { id: "product-demo-e2", source: condId, target: actionsId, sourceHandle: "true" }, { id: "product-demo-e3", source: actionsId, target: endId }, { id: "product-demo-e4", source: condId, target: endId, sourceHandle: "false" }, ], }, } }