{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developer.reits.tech/schemas/contracts/v1/booking-order.v1.schema.json",
  "title": "BookingOrder",
  "type": "object",
  "additionalProperties": false,
  "required": ["orderId", "consumerId", "merchantId", "serviceId", "slotId", "quantity", "amount", "status", "revision", "idempotencyKey"],
  "properties": {
    "orderId": { "type": "string", "minLength": 1, "maxLength": 128 },
    "consumerId": { "type": "string", "minLength": 1, "maxLength": 128 },
    "merchantId": { "type": "string", "minLength": 1, "maxLength": 128 },
    "serviceId": { "type": "string", "minLength": 1, "maxLength": 128 },
    "slotId": { "type": "string", "minLength": 1, "maxLength": 128 },
    "quantity": { "type": "integer", "minimum": 1 },
    "amount": {
      "type": "object",
      "additionalProperties": false,
      "required": ["currency", "minor"],
      "properties": {
        "currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "minor": { "type": "integer", "minimum": 0 }
      }
    },
    "status": { "type": "string", "enum": ["held", "confirmed", "cancel_requested", "cancelled", "completed", "expired", "refunded"] },
    "revision": { "type": "integer", "minimum": 1 },
    "idempotencyKey": { "type": "string", "minLength": 1, "maxLength": 256 }
  }
}
