{
  "说明": "全部为合成材料；Schema用于创建采购草稿，不是平台原生接口",
  "schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "external_order_id",
      "currency",
      "items"
    ],
    "additionalProperties": false,
    "properties": {
      "external_order_id": {
        "type": "string",
        "minLength": 1
      },
      "currency": {
        "type": "string",
        "enum": [
          "CNY",
          "USD"
        ]
      },
      "items": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "object",
          "required": [
            "sku",
            "quantity",
            "unit_price"
          ],
          "additionalProperties": false,
          "properties": {
            "sku": {
              "type": "string",
              "minLength": 1
            },
            "quantity": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "unit_price": {
              "type": "number",
              "minimum": 0
            }
          }
        }
      },
      "note": {
        "type": "string"
      }
    }
  },
  "cases": [
    {
      "id": "J01",
      "expected": "结构通过；仍需查业务数据",
      "value": {
        "external_order_id": "DEMO-001",
        "currency": "CNY",
        "items": [
          {
            "sku": "DEMO-A",
            "quantity": 2,
            "unit_price": 10
          },
          {
            "sku": "DEMO-B",
            "quantity": 1,
            "unit_price": 20
          },
          {
            "sku": "DEMO-C",
            "quantity": 3,
            "unit_price": 5
          }
        ]
      }
    },
    {
      "id": "J02",
      "expected": "结构失败：缺external_order_id",
      "value": {
        "currency": "CNY",
        "items": [
          {
            "sku": "DEMO-A",
            "quantity": 1,
            "unit_price": 10
          }
        ]
      }
    },
    {
      "id": "J03",
      "expected": "结构失败：quantity不得负数",
      "value": {
        "external_order_id": "DEMO-003",
        "currency": "CNY",
        "items": [
          {
            "sku": "DEMO-A",
            "quantity": -1,
            "unit_price": 10
          }
        ]
      }
    },
    {
      "id": "J04",
      "expected": "结构通过；业务失败：假设SKU不存在",
      "value": {
        "external_order_id": "DEMO-004",
        "currency": "USD",
        "items": [
          {
            "sku": "NOT-EXISTS",
            "quantity": 1,
            "unit_price": 10
          }
        ]
      }
    }
  ]
}