{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zentriaflow-com/json-schema/zentriaflow-com-watch-change-schema.json",
  "title": "WatchChange",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zentriaflow-com-openapi.json#/components/schemas/WatchChange",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique and stable per change; use it to deduplicate."
    },
    "event": {
      "type": "string"
    },
    "watch_id": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "hs_code": {
      "type": "string"
    },
    "origin_country": {
      "type": [
        "string",
        "null"
      ]
    },
    "destination_country": {
      "type": [
        "string",
        "null"
      ]
    },
    "product_value": {
      "type": [
        "number",
        "null"
      ]
    },
    "currency": {
      "type": "string"
    },
    "detected_at": {
      "type": "string"
    },
    "customs_cost_before": {
      "type": [
        "number",
        "null"
      ]
    },
    "customs_cost_after": {
      "type": [
        "number",
        "null"
      ]
    },
    "customs_cost_change": {
      "type": "number"
    },
    "direction": {
      "type": "string",
      "enum": [
        "up",
        "down",
        "unchanged"
      ]
    },
    "total_landed_cost_before": {
      "type": [
        "number",
        "null"
      ]
    },
    "total_landed_cost_after": {
      "type": [
        "number",
        "null"
      ]
    },
    "changed_layers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "layer": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "before_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "after_pct": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "layer",
          "label",
          "before_pct",
          "after_pct"
        ]
      }
    },
    "changed_layers_text": {
      "type": "string"
    },
    "import_restriction": {
      "type": [
        "string",
        "null"
      ]
    },
    "upcoming_tariff": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "event",
    "watch_id",
    "label",
    "hs_code",
    "origin_country",
    "destination_country",
    "product_value",
    "currency",
    "detected_at",
    "customs_cost_before",
    "customs_cost_after",
    "customs_cost_change",
    "direction",
    "total_landed_cost_before",
    "total_landed_cost_after",
    "changed_layers",
    "changed_layers_text",
    "import_restriction",
    "upcoming_tariff",
    "url"
  ]
}