{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "OrderDraft",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "order_id": {
      "type": "string",
      "description": "The approved customer order identifier."
    },
    "sku": {
      "type": "string",
      "description": "The approved item identifier."
    },
    "currency": {
      "type": "string",
      "description": "Currency identifier supplied by the customer."
    },
    "quantity": {
      "type": "integer",
      "description": "The final quantity after approved corrections."
    },
    "unit_price": {
      "type": "number",
      "description": "The approved price for one item."
    },
    "merchandise_subtotal": {
      "type": "number",
      "description": "Quantity times unit price, excluding shipping."
    },
    "shipping_budget": {
      "type": "number",
      "description": "The customer shipping budget, not the actual shipping charge."
    },
    "actual_shipping": {
      "type": [
        "number",
        "null"
      ],
      "description": "Actual shipping charge; null if not supplied by an approved source."
    },
    "dispatch_date": {
      "type": [
        "string",
        "null"
      ],
      "description": "Confirmed dispatch date; null if not supplied by an approved source."
    },
    "tracking_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "Confirmed tracking identifier; null if not supplied by an approved source."
    },
    "actions": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "order_placed": {
          "type": "boolean",
          "description": "Whether an order was actually placed in this task."
        },
        "email_sent": {
          "type": "boolean",
          "description": "Whether an email was actually sent in this task."
        }
      },
      "required": [
        "order_placed",
        "email_sent"
      ]
    },
    "source_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identifiers of approved customer sources used for the draft."
    }
  },
  "required": [
    "order_id",
    "sku",
    "currency",
    "quantity",
    "unit_price",
    "merchandise_subtotal",
    "shipping_budget",
    "actual_shipping",
    "dispatch_date",
    "tracking_number",
    "actions",
    "source_ids"
  ]
}
