# FFOA 流程图 schema（v0.1 MVP）
# AI 修改时只改这份 YAML，generator 自动出 v0.2 风格 inline SVG

title: 出差申请审批流程

# 左侧"动作"标签列（row 0..N 对应每个动作名；可选）
actions:
  - 提交 / 审批
  - 行程安排
  - 预算审核
  - 金额判断
  - 终审 / 预批
  - 登记 / 归档

# 右侧备注 sidebar — 按 row 网格化（每个 row 对应一格，可空可填）
sidebar:
  title: 备注
  rows:
    - 申请人填基础信息 + 附件                # row 0
    - HR 协助订票 / 酒店                     # row 1
    - 财务核对预算余额                        # row 2
    - 金额 > ¥10,000 触发终审                # row 3
    - ""                                     # row 4（无备注）
    - 归档到 knowledge-base 出差记录库       # row 5

# 泳道定义（顺序 = 从左到右的列顺序）
lanes:
  - {id: applicant, name: 申请人,   color: "#FFF8E1", stroke: "#FBC02D", text: "#5D4037"}
  - {id: manager,   name: 部门主管, color: "#E1F5FE", stroke: "#0288D1", text: "#01579B"}
  - {id: hr,        name: HR 部门,  color: "#F3E5F5", stroke: "#8E24AA", text: "#4A148C"}
  - {id: finance,   name: 财务部门, color: "#E8F5E9", stroke: "#388E3C", text: "#1B5E20"}
  - {id: ceo,       name: 总经理,   color: "#FCE4EC", stroke: "#C2185B", text: "#880E4F"}
  - {id: system,    name: 系统,     color: "#ECEFF1", stroke: "#546E7A", text: "#263238"}

# 节点（row 按流程时间递增，形成对角下降布局）
# shape 支持：oval (start) / end-oval (end) / rect (task) / subprocess
#           diamond (decision) / xor (排他网关) / parallel (并行网关)
#           intermediate (中间事件) / data (数据对象)
nodes:
  - {id: submit,     lane: applicant, row: 0, shape: oval,       label: ① 提交申请}
  - {id: review,     lane: manager,   row: 0, shape: rect,       label: ② 审批申请}
  - {id: booking,    lane: hr,        row: 1, shape: rect,       label: ③ 行程安排}
  - {id: budget,     lane: finance,   row: 2, shape: rect,       label: ④ 预算审核}
  - {id: amount,     lane: finance,   row: 3, shape: xor,        label: ⑤ 金额>阈值?}
  - {id: ceo_review, lane: ceo,       row: 4, shape: rect,       label: ⑥ 终审}
  - {id: prepay,     lane: finance,   row: 4, shape: rect,       label: ⑦ 费用预批}
  - {id: register,   lane: hr,        row: 5, shape: subprocess, label: ⑧ 出差登记}
  - {id: notify,     lane: system,    row: 5, shape: end-oval,   label: ⑨ 通知+归档}

# 流转线（style: approve=绿 / reject=红虚 / async=蓝虚 / normal=灰）
edges:
  - {from: submit,     to: review,                          style: normal}
  - {from: review,     to: booking,    label: 通过,         style: approve}
  - {from: booking,    to: budget,                          style: normal}
  - {from: budget,     to: amount,     label: 通过,         style: approve}
  - {from: amount,     to: ceo_review, label: 是,           style: normal}
  - {from: amount,     to: prepay,     label: 否,           style: normal}
  - {from: ceo_review, to: prepay,     label: 通过,         style: approve}
  - {from: prepay,     to: register,                        style: normal}
  - {from: register,   to: notify,                          style: async}
  - {from: review,     to: submit,     label: 驳回,         style: reject}
  - {from: ceo_review, to: submit,     label: 终审驳回,     style: reject}

# 注释（附着到节点；position: right/left/top/bottom）
notes:
  - {attach: review,     position: bottom, text: "SLA 24h\nAI 辅助"}
  - {attach: ceo_review, position: bottom, text: "SLA 48h"}
