{
  "schema_version": 1,
  "diagram_type": "dataflow",
  "meta": {
    "title": "Đối soát nguồn thu đến tiền thực nhận — thiết kế đề xuất",
    "locale": "vi",
    "translations": {
      "page.title": "Sơ đồ {title}",
      "legend.title": "Chú giải",
      "viewer.theme.dark": "Tối",
      "viewer.theme.light": "Sáng",
      "viewer.motion.live": "Chuyển động",
      "viewer.motion.still": "Tĩnh",
      "viewer.present.present": "Trình chiếu",
      "viewer.present.exit.label": "Thoát",
      "legend.sequence.emphasis": "Luồng chính",
      "legend.sequence.return": "Phản hồi",
      "legend.sequence.security": "Kiểm soát",
      "legend.sequence.dashed": "Bất đồng bộ",
      "legend.sequence.default": "Thông điệp",
      "legend.workflow.frontend": "Giao diện",
      "legend.workflow.backend": "Xử lý nghiệp vụ",
      "legend.workflow.security": "Kiểm soát",
      "legend.workflow.messagebus": "Tác vụ",
      "legend.workflow.database": "Dữ liệu",
      "legend.workflow.cloud": "Dịch vụ",
      "legend.workflow.external": "Bên ngoài",
      "legend.dataflow.emphasis": "Dữ liệu chính",
      "legend.dataflow.security": "Quyền / dữ liệu nhạy cảm",
      "legend.dataflow.dashed": "Nhập theo đợt",
      "legend.dataflow.database": "Lưu trữ",
      "legend.dataflow.default": "Luồng dữ liệu"
    },
    "output": "docs/ssa-miniapp/archify/reconciliation.html",
    "quality_profile": "showcase"
  },
  "stages": [
    {
      "label": "Nguồn bằng chứng"
    },
    {
      "label": "Nhận và chuẩn hóa"
    },
    {
      "label": "Khớp và phát hiện lệch"
    },
    {
      "label": "Giải trình và duyệt"
    },
    {
      "label": "Kết quả kỳ"
    }
  ],
  "nodes": [
    {
      "id": "orders",
      "stage": 0,
      "row": 0,
      "type": "database",
      "label": "Đơn + giao dịch",
      "sublabel": "Snapshot / refund"
    },
    {
      "id": "gateway",
      "stage": 0,
      "row": 1,
      "type": "external",
      "label": "Báo cáo cổng",
      "sublabel": "Gross / phí / settlement"
    },
    {
      "id": "bank",
      "stage": 0,
      "row": 2,
      "type": "external",
      "label": "Sao kê ngân hàng",
      "sublabel": "Khoản thực nhận"
    },
    {
      "id": "ingest",
      "stage": 1,
      "row": 1,
      "type": "backend",
      "label": "Nhận bằng chứng",
      "sublabel": "Preview / hash / dedupe"
    },
    {
      "id": "match",
      "stage": 2,
      "row": 1,
      "type": "backend",
      "label": "Khớp reference",
      "sublabel": "ID + tiền + merchant"
    },
    {
      "id": "case",
      "stage": 2,
      "row": 3,
      "type": "database",
      "label": "Hồ sơ sai lệch",
      "sublabel": "Thiếu / thừa / trùng"
    },
    {
      "id": "approve",
      "stage": 3,
      "row": 1,
      "type": "security",
      "label": "Duyệt kỳ",
      "sublabel": "Người duyệt khác người lập"
    },
    {
      "id": "explain",
      "stage": 3,
      "row": 3,
      "type": "backend",
      "label": "Giải trình lệch",
      "sublabel": "Owner / evidence / điều chỉnh"
    },
    {
      "id": "close",
      "stage": 4,
      "row": 1,
      "type": "database",
      "label": "Khóa kỳ + audit",
      "sublabel": "Net / chuyển kỳ / báo cáo"
    }
  ],
  "flows": [
    {
      "id": "f1",
      "from": "orders",
      "to": "ingest",
      "label": "Sổ nghiệp vụ",
      "variant": "default"
    },
    {
      "id": "f2",
      "from": "gateway",
      "to": "ingest",
      "label": "Báo cáo kỳ",
      "variant": "dashed"
    },
    {
      "id": "f3",
      "from": "bank",
      "to": "ingest",
      "label": "Sao kê",
      "variant": "dashed"
    },
    {
      "id": "f4",
      "from": "ingest",
      "to": "match",
      "label": "Dòng hợp lệ",
      "variant": "emphasis"
    },
    {
      "id": "f5",
      "from": "match",
      "to": "approve",
      "label": "Khớp đủ",
      "variant": "emphasis"
    },
    {
      "id": "f6",
      "from": "match",
      "to": "case",
      "label": "Chưa khớp",
      "variant": "default"
    },
    {
      "id": "f7",
      "from": "case",
      "to": "explain",
      "label": "Giao xử lý",
      "variant": "default"
    },
    {
      "id": "f8",
      "from": "explain",
      "to": "approve",
      "label": "Đủ bằng chứng",
      "variant": "default"
    },
    {
      "id": "f9",
      "from": "approve",
      "to": "close",
      "label": "Đã duyệt",
      "variant": "emphasis"
    }
  ],
  "cards": [
    {
      "dot": "slate",
      "title": "Nguồn và phạm vi",
      "items": [
        "FEATURES.md §7.3–7.6; OPERATIONS: Đối soát nguồn thu; PLAN FR-18/T21. Thiết kế đề xuất.",
        "Đối soát nguồn thu không phải kết luận pháp lý nguồn gốc tài sản/AML."
      ]
    },
    {
      "dot": "amber",
      "title": "Phương trình kiểm soát",
      "items": [
        "Gross − hoàn − phí ± điều chỉnh = net nhận theo kỳ; ghi rõ khoản chuyển kỳ.",
        "Provider báo paid chưa có nghĩa tiền đã về tài khoản ngân hàng."
      ]
    },
    {
      "dot": "rose",
      "title": "Một khoản thu phải truy được",
      "items": [
        "Order → attempt → transaction → merchant/phương thức → settlement/sao kê → net → người duyệt.",
        "Bằng chứng hạn chế truy cập; tài khoản được che; không ghi token hoặc PAN/CVV vào log."
      ]
    }
  ]
}
