Files
sys-analysis-design/.claude/skills/sa-2-architecture/templates/diagrams/SAD_luong-chinh.sequence.json
2026-09-22 13:46:36 +07:00

46 lines
2.8 KiB
JSON

{
"schema_version": 1,
"diagram_type": "sequence",
"meta": {
"title": "Luồng chính — Lưu cửa hàng có kiểm tra POS (mẫu)",
"quality_profile": "showcase",
"viewBox": [1080, 600],
"column_fit": "spread",
"views": [
{ "id": "thanh-cong", "label": "Nhánh thành công", "focus": ["U", "FE", "BE", "POS"], "note": "POS phản hồi trong 3s, hệ thống lưu và báo đã lưu." },
{ "id": "timeout", "label": "Nhánh POS timeout", "focus": ["BE", "POS", "FE", "U"], "note": "Hết 3s không có phản hồi: trả 503 E-STR-0503, giữ nguyên dữ liệu đã nhập." }
]
},
"participants": [
{ "id": "U", "type": "external", "label": "Nhân viên", "sublabel": "ROLE-01" },
{ "id": "FE", "type": "frontend", "label": "Giao diện", "sublabel": "SCR-02 Chi tiết" },
{ "id": "BE", "type": "backend", "label": "Settlement API", "sublabel": "POST /stores" },
{ "id": "POS", "type": "external", "label": "Hệ thống POS", "sublabel": "IF-005 · timeout 3s" }
],
"segments": [
{ "from": 160, "to": 300, "label": "Gửi và kiểm tra" },
{ "from": 310, "to": 400, "label": "Nhánh thành công" },
{ "from": 410, "to": 520, "label": "Nhánh POS timeout" }
],
"messages": [
{ "id": "m1", "from": "U", "to": "FE", "y": 175, "label": "Bấm Lưu", "variant": "default" },
{ "id": "m2", "from": "FE", "to": "BE", "y": 210, "label": "POST /stores", "variant": "emphasis" },
{ "id": "m3", "from": "BE", "to": "POS", "y": 250, "label": "GET /verify (timeout 3s)", "variant": "emphasis" },
{ "id": "m4", "from": "POS", "to": "BE", "y": 320, "label": "200 OK", "variant": "return" },
{ "id": "m5", "from": "BE", "to": "FE", "y": 350, "label": "200 + id", "variant": "return" },
{ "id": "m6", "from": "FE", "to": "U", "y": 380, "label": "Toast \"Đã lưu\"", "variant": "return" },
{ "id": "m7", "from": "POS", "to": "BE", "y": 430, "label": "timeout sau 3s", "variant": "dashed", "note": "FAIL FM-05" },
{ "id": "m8", "from": "BE", "to": "FE", "y": 465, "label": "503 · E-STR-0503", "variant": "return" },
{ "id": "m9", "from": "FE", "to": "U", "y": 500, "label": "Báo lỗi, GIỮ dữ liệu đã nhập", "variant": "return" }
],
"activations": [
{ "participant": "FE", "from": 170, "to": 505, "type": "frontend" },
{ "participant": "BE", "from": 205, "to": 470, "type": "backend" },
{ "participant": "POS", "from": 245, "to": 435, "type": "external" }
],
"cards": [
{ "dot": "emerald", "title": "Thành công", "items": ["POS trả 200 trong 3s, API lưu và trả id", "Giao diện hiện toast theo UICONV §7"] },
{ "dot": "rose", "title": "Lỗi", "items": ["Timeout 3s là ngân sách theo FAIL §2, không tự đặt", "503 E-STR-0503 cho thử lại, dữ liệu đã nhập không mất (W4)"] }
]
}