{
  "_comment": "Output of scripts/adapters/revel/order_status_update.js. Two shapes: normal CATA-order path (status set) and skip path (runtime ACKs the webhook without state change).",

  "example_completed": {
    "status": "COMPLETED",
    "posOrderId": "32759",
    "timestamp": "2026-04-29T14:59:40+08:00"
  },

  "example_skip_non_cata_dining_option": {
    "skip": true,
    "reason": "non-CATA dining option 5"
  },

  "example_skip_not_closed": {
    "skip": true,
    "reason": "order 32761 not closed yet (closed=false)"
  },

  "_notes": [
    "Revel only emits COMPLETED — there are no PAID/ACCEPTED/IN_PROGRESS/READY/DRIVER_PICKED_UP signals from its webhook surface. Other POS providers (Atlas Kitchen, Lightspeed, …) emit the granular states; the Cata OrderStatusService accepts the full enum regardless of which provider produced it.",
    "posOrderId is treated as opaque string downstream (different POS providers use ints, UUIDs, or alphanumerics). Revel uses int IDs that we stringify here.",
    "timestamp falls back to orderInfo.created_date if updated_date is absent; empty string means 'use server time' downstream.",
    "Skip semantics: the Go runtime that invokes the adapter recognises { skip: true } and ACKs the webhook with HTTP 200, performing no state transition. Mirrors the legacy 'return nil' silent-skip in kds-management-service/service/RevelService/Webhook.go:processOrderFinalized.",
    "Throws (not represented here) surface as 5xx to the runtime so Revel retries the webhook. Reserved for genuinely malformed payloads (missing orderInfo, missing/empty id) and outlets with all three dining-option settings unset."
  ]
}
