# รายงานผลทดสอบ — Premium เฟส 1 (Data Ingestion)

> ทดสอบโดยทีม AICE · รันจริงด้วย `SAMPLE_MODE=1 python extract_all.py`
> ผลรัน: **5/5 แพลตฟอร์ม ok · 5 orders · 5 inventory · 0 errors**

| # | กรณีทดสอบ | ผลที่คาดหวัง | ผล |
|---|---|---|---|
| 1 | รัน orchestrator (SAMPLE_MODE) | ดึง+normalize ครบ 5 แพลตฟอร์ม | ✅ ผ่าน |
| 2 | normalize Shopee (items → OrderRecord) | total = unit_price × qty (690×2=1,380) | ✅ ผ่าน |
| 3 | TikTok epoch → ISO-8601 | 1749196800 → ISO timestamp ถูกต้อง | ✅ ผ่าน |
| 4 | partial failure (1 connector throw) | ok=False เก็บ error · ตัวอื่นทำต่อ ไม่ abort | ✅ ผ่าน |
| 5 | API ตาย → Playwright fallback | LINE Shopping ใช้ fallback ตาม design | ✅ ผ่าน |
| 6 | retry error ชั่วคราว | tenacity exponential backoff (4 ครั้ง) บน RequestException | ✅ ผ่าน |
| 7 | natural key ตรง schema เฟส 2 | (platform, order_id, sku) — พร้อม UPSERT | ✅ ผ่าน |
| 8 | import โมดูลโดยไม่มี deps | lazy import → import ได้ด้วย stdlib ล้วน | ✅ ผ่าน |
| 9 | output เป็น JSON | sample_output.json พร้อมให้เฟส 2 อ่านไป load | ✅ ผ่าน |

**สรุป:** ผ่าน 9/9 — ชั้น ingestion พร้อมส่งต่อให้เฟส 2 (Warehouse & Load)
**ขอบเขตเฟสนี้:** ดึง + normalize เท่านั้น · *ยังไม่* เขียน Postgres และ *ยังไม่* deploy (ตาม roadmap)
