{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Từ merchandise đến tiền thực nhận — thiết kế đề xuất",
    "locale": "vi",
    "output": "docs/ssa-miniapp/archify/commerce.html",
    "quality_profile": "showcase"
  },
  "lanes": [
    {
      "id": "main",
      "label": "Luồng nghiệp vụ"
    },
    {
      "id": "control",
      "label": "Điểm kiểm soát",
      "variant": "exception"
    }
  ],
  "mainPath": [
    "n0",
    "n1",
    "n2",
    "n3",
    "n4",
    "n5"
  ],
  "nodes": [
    {
      "id": "n0",
      "lane": "main",
      "col": 0,
      "type": "frontend",
      "label": "Chọn sản phẩm",
      "sublabel": "SKU / số lượng / nhận hàng"
    },
    {
      "id": "n1",
      "lane": "main",
      "col": 1,
      "type": "backend",
      "label": "Tạo đơn",
      "sublabel": "Giá chốt / giữ hàng"
    },
    {
      "id": "n2",
      "lane": "main",
      "col": 2,
      "type": "external",
      "label": "Checkout SDK",
      "sublabel": "Phương thức đã khai báo"
    },
    {
      "id": "n3",
      "lane": "main",
      "col": 3,
      "type": "security",
      "label": "Xác nhận tiền",
      "sublabel": "Backend kiểm provider"
    },
    {
      "id": "n4",
      "lane": "main",
      "col": 4,
      "type": "backend",
      "label": "Xử lý đơn",
      "sublabel": "Chuẩn bị / giao / nhận"
    },
    {
      "id": "n5",
      "lane": "main",
      "col": 5,
      "type": "database",
      "label": "Đối soát",
      "sublabel": "Phí / hoàn / net nhận"
    },
    {
      "id": "hold",
      "lane": "control",
      "col": 3,
      "type": "security",
      "label": "Chờ xác minh",
      "sublabel": "Pending không phải đã thu"
    }
  ],
  "edges": [
    {
      "id": "e0",
      "from": "n0",
      "to": "n1",
      "variant": "emphasis"
    },
    {
      "id": "e1",
      "from": "n1",
      "to": "n2",
      "variant": "emphasis"
    },
    {
      "id": "e2",
      "from": "n2",
      "to": "n3",
      "variant": "emphasis"
    },
    {
      "id": "e3",
      "from": "n3",
      "to": "n4",
      "variant": "emphasis"
    },
    {
      "id": "e4",
      "from": "n4",
      "to": "n5",
      "variant": "emphasis"
    },
    {
      "id": "stop",
      "from": "n3",
      "to": "hold",
      "label": "Chưa đạt",
      "variant": "security",
      "role": "branch"
    }
  ],
  "cards": [
    {
      "dot": "amber",
      "title": "Điểm phải nhớ",
      "items": [
        "Hướng được chọn: đơn + Checkout. G1 còn chốt merchant, provider và chính sách; tư vấn C2 chỉ là dự phòng khi đổi phạm vi.",
        "Trạng thái đơn, thanh toán và settlement độc lập. Callback client không xác nhận thu tiền."
      ]
    },
    {
      "dot": "slate",
      "title": "Cơ sở thiết kế",
      "items": [
        "FEATURES.md §7, yêu cầu ngày 12/11/2026; tài liệu làm việc, chưa triển khai backend.",
        "Không phải trace runtime. Nội dung tiếng Việt; một số điều khiển Archify dùng tiếng Anh."
      ]
    }
  ]
}
