Validate และ submit
ใช้ endpoint เดียวกันสำหรับ dry-run และ persist โดยสิทธิ์ใน credential เป็นผู้กำหนดว่าเขียนจริงได้หรือไม่
POST ${CFO_BASE_URL}/integrations/facilities/${CFO_FACILITY_ID}/activity-imports
Authorization: Bearer ${CFO_ACCESS_TOKEN}
Idempotency-Key: ${DURABLE_IDEMPOTENCY_KEY}
Content-Type: application/json
payload ต้องมี schema_version, external_batch_id, source_system, retention_id, scope,
dry_run และ rows หาก dry_run=true ผลสำเร็จควรเป็น would_create และไม่มี business row
ลำดับบังคับ
- freeze canonical payload และ durable identity ก่อน network call
- dry-run ทุก granted tuple
- poll job และอ่านผลรายแถว
- แก้ validation error โดยไม่เปลี่ยนความหมายของ business identity
- เมื่อได้รับอนุญาตจึงสร้าง request ใหม่สำหรับ persist ด้วย
dry_run=false - เก็บ job ID และ correlation ID เพื่อ reconciliation
Persist สร้างข้อมูลจริงใน zone ที่เลือก
ตรวจ zone, facility, reporting period และจำนวน planned rows อีกครั้งก่อนเปลี่ยน dry_run เป็น false