Interactive simulator · pick 1 order, chạy qua 2 pipeline, so sánh output

Cùng input, 2 cách xử lý, output khác nhau.

Em build 1 simulator production-like với 10 mock order covering đủ edge case. Mỗi order chạy song song qua OLD pipeline (waterfall-lite) và NEW pipeline (vibe coding). Xem cách nào phát hiện vấn đề sớm hơn, throughput tốt hơn, refactor cost thấp hơn.

/01 — CHỌN ORDER

10 mock order, mỗi cái test 1 tình huống

/02 — PIPELINE OUTPUT

Cùng input, 2 cách xử lý khác nhau

OLD Pipeline Waterfall-lite
— ms
Chọn order và bấm Run để xem pipeline
NEW Pipeline Vibe Coding
— ms
Chọn order và bấm Run để xem pipeline
/03 — METRICS DASHBOARD

So sánh trực tiếp

Chạy ít nhất 1 simulation để xem metrics accumulate.
/04 — EDGE CASES COVERED

10 mock order · bao phủ 10 tình huống thực tế

Happy path
Standard + Giao ngay + 3 SKU, all in stock. 2 pipeline đều pass, NEW nhanh hơn 5–7×.
Mixed Order Procurement
B2B + 50 SKU mixed (20 in-stock, 30 short). OLD: phát hiện ở step 5. NEW: phát hiện ở step 2 (ATP check tại intake).
Preorder
CTV/Dealer + Preorder 7 ngày. NEW: delivery_date auto-derive UI label, OLD: hard-code "Preorder" trong Order Type.
Composition
Hub Internal + Scheduled. NEW: tách thành `inventory_transfers` entity riêng ngay intake. OLD: mix trong orders table, phải fix ở step 4.
Override
Standard VIP + Scheduled + customer override. NEW: override flag explicit + audit trail. OLD: rule conflict, manual intervention.
Incomplete
Standard + Giao ngay + thiếu customer phone. NEW: block intake với lý do rõ, OLD: cho vào pipeline rồi fail ở CS review.
Duplicate
Trùng customer + SKU trong 2h. NEW: detection rule chạy song song với intake, flag ngay. OLD: phát hiện khi CS review manual.
Return
Return linked to order #2. NEW: separate entity `return_orders`. OLD: type='return' trong orders → refund logic chạy nhầm pricing rule.
Split
Mixed Order 50 SKU → split 2 child. NEW: parent/child ID clear, cancel scope obvious. OLD: parent.order_type conflict với child.
Mid-flight change
Standard + Giao ngay → KH đổi delivery_date sang tuần sau. NEW: delivery_date là first-class → update tự động re-derive. OLD: phải xóa order, tạo lại.