ข้ามไปที่เนื้อหา

TLX Other Documents (Vendor Estimation Pack)

เอกสารนี้รวมรายละเอียดที่ vendor ต้องใช้เพื่อประเมินราคาและกำหนดขอบเขตการส่งมอบได้แม่นยำขึ้น

1) API Contract Draft (Version 0.1)

1.1 API Principles

  • Base path: /api/v1
  • Authentication: Bearer token (OAuth2/OIDC compatible)
  • Idempotency: ใช้ header Idempotency-Key สำหรับ create/submit endpoints
  • Traceability: ใช้ X-Trace-Id และ message_id ใน payload
  • Response envelope มาตรฐาน:
{
  "success": true,
  "data": {},
  "error": null,
  "trace_id": "..."
}

1.2 Core Endpoint Groups (Draft)

  1. Identity / Participant / Partner
  2. POST /participants/register
  3. GET /participants/{participantId}
  4. POST /participants/{participantId}/endpoints
  5. POST /participants/{participantId}/public-keys
  6. POST /partner-matching/requests
  7. POST /partner-matching/requests/{id}/accept
  8. POST /partner-matching/requests/{id}/reject

  9. Product Catalog

  10. POST /products/import
  11. POST /products
  12. PUT /products/{id}
  13. GET /products
  14. GET /products/search?q=...

  15. Transaction Documents

  16. POST /documents/quotation
  17. POST /documents/purchase-order
  18. POST /documents/order-confirmation
  19. POST /documents/invoice
  20. POST /documents/delivery-note
  21. POST /documents/goods-receipt
  22. POST /documents/billing
  23. POST /documents/payment-confirmation
  24. GET /documents/{documentId}
  25. GET /transactions/{transactionId}/timeline

  26. Registry / Validation / Routing

  27. GET /registries/documents
  28. POST /messages/validate
  29. POST /messages/route
  30. GET /messages/{messageId}/status

  31. Back-office

  32. POST /admin/kyc/{organizationId}/approve
  33. POST /admin/kyc/{organizationId}/reject
  34. GET /admin/transactions
  35. GET /admin/audit-logs
  36. POST /admin/code-lists
  37. POST /admin/message-schemas

1.3 Example Payload (Submit Document)

{
  "message_id": "MSG-20260416-000001",
  "sender_id": "PART-SELLER-001",
  "receiver_id": "PART-BUYER-001",
  "doc_type": "PURCHASE_ORDER",
  "timestamp": "2026-04-16T09:45:00Z",
  "document": {
    "doc_no": "PO-2026-10001",
    "reference_doc_no": "QO-2026-9981",
    "currency": "THB",
    "lines": [
      {
        "line_no": 1,
        "gtin": "8850000000001",
        "sku": "SKU-ABC-01",
        "qty": 100,
        "unit_price": 250
      }
    ]
  }
}

1.4 Error Model (Draft)

{
  "success": false,
  "data": null,
  "error": {
    "code": "VALIDATION_SEMANTIC_FAILED",
    "message": "receiver_id is not authorized for doc_type INVOICE",
    "details": [
      "receiver_id not found in document registry"
    ]
  },
  "trace_id": "TRACE-01J..."
}

Error code categories: - AUTH_* - VALIDATION_STRUCTURAL_* - VALIDATION_SEMANTIC_* - ROUTING_* - BUSINESS_RULE_* - SYSTEM_*

2) Non-Functional Requirements (For Pricing Baseline)

2.1 Security

  • TLS 1.2+ for all APIs
  • JWE payload support for ERP message exchange
  • RBAC for Admin/Support/User
  • Audit log for both user and admin activities
  • Key rotation support (public key registry)

2.2 Performance

  • API p95 latency target (business APIs): <= 1.5s (excluding large file upload)
  • Search response target: <= 2s สำหรับ query ปกติ
  • รองรับ burst traffic ในช่วงเวลาวางบิล

2.3 Availability & Reliability

  • Target uptime: 99.5% (MVP), 99.9% (phase ถัดไป)
  • มี retry + dead-letter strategy สำหรับ routing ล้มเหลว
  • graceful degradation เมื่อ service บางตัวช้าหรือไม่พร้อม

2.4 Observability

  • Structured logs + centralized log management
  • Technical metrics (RPS, error rate, queue lag)
  • Business metrics (document success/fail by type)
  • Alerting และ runbook สำหรับ support

2.5 Data & Compliance

  • เก็บ audit ตามนโยบาย retention ที่ตกลง
  • Backup รายวัน + restore test เป็นระยะ
  • Time synchronization สำหรับ timestamp integrity

3) Integration Scope

3.1 ERP Integration Patterns

  • Pattern A: Direct synchronous API call
  • Pattern B: Async submission + callback status
  • Pattern C: Portal upload/manual operation สำหรับผู้ใช้ไม่มี ERP

3.2 Key Exchange & Encryption

  • ผู้เข้าร่วมลงทะเบียน public key ใน Participant Registry
  • ผู้ส่งเข้ารหัส payload (JWE) ก่อนส่ง
  • ระบบใช้ metadata (message_id, sender_id, receiver_id, doc_type, timestamp) สำหรับ validation/routing

3.3 Notification Channels

  • Minimum: Email
  • Optional future: webhook/SMS/LINE integration
  • ผู้ใช้งานกำหนด preference ได้

3.4 External Dependencies ที่ต้องตกลงก่อนเริ่ม

  • SMTP/Email provider
  • Identity provider (ถ้ามี SSO)
  • Monitoring/Logging stack
  • API security policy (token format, lifetime)

4) Implementation Phases and Milestones

Phase 1: MVP Foundation (ประมาณ 3-4 เดือน)

Scope: - Participant onboarding + KYC/KYB approval - RBAC พื้นฐาน - Product catalog registry + search - Quotation, PO, Order Confirmation - Basic API Gateway + structural validation - Basic dashboard + audit log viewer

Deliverables: - ระบบใช้งานจริงใน UAT - เอกสาร API v1 draft - คู่มือ admin/support เบื้องต้น

Acceptance: - รองรับธุรกรรม core order flow end-to-end - มี trace/audit ที่ตรวจสอบย้อนหลังได้

Phase 2: Logistics and Billing Expansion (ประมาณ 2-3 เดือน)

Scope: - Invoice/Tax Invoice, Delivery Note, Goods Receipt - Billing + Payment Confirmation - Semantic validation rules เพิ่มเติม - Routing callback + failure handling - Support transaction viewer ที่ครบขึ้น

Deliverables: - E2E flow ครบจาก quote ถึง payment confirmation - รายงานสถานะธุรกรรมและ failure reasons

Acceptance: - ตรวจสอบ routing/validation failures ได้จาก back-office - รองรับ claim flow กรณีสินค้าไม่ครบ

Phase 3: Hardening and Scale (ประมาณ 1-2 เดือน)

Scope: - Performance tuning, security hardening, DR drill - Advanced observability and operational runbook - Integration optimization สำหรับหลายองค์กร

Deliverables: - Production readiness checklist - SLA/SLO baseline + operation guide

Acceptance: - ผ่าน non-functional test ตามเกณฑ์ที่ตกลง

5) Commercial Assumptions สำหรับเปรียบเทียบใบเสนอราคา

เพื่อให้เทียบหลาย vendor ได้แฟร์ ควรขอให้ทุกเจ้าระบุเหมือนกัน: - Team composition (PM/BA/SA/BE/FE/QA/DevOps) - Effort by phase (person-month) - รวม/ไม่รวม infrastructure cost - รวม/ไม่รวม support หลัง go-live - จำนวนรอบแก้ไข requirement ที่รวมในสัญญา

6) Suggested Appendices (ถ้าต้องขยายต่อ)

  • Glossary คำศัพท์ธุรกรรม/โลจิสติกส์
  • RACI ระหว่างหน่วยงานธุรกิจกับทีมไอที
  • Open Questions Log สำหรับประชุม vendor รอบถัดไป