{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.ectropy.ai/flow/tag-binding.schema.json",
  "title": "Tag Binding",
  "version": "0.2.0",
  "description": "Agnostic tagging: whatever a site can read binds to one unit identifier. A binding is itself an event (commissioning), so rebinding is recorded, never overwritten.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "tag",
    "technology",
    "unit",
    "boundByEventId"
  ],
  "properties": {
    "tag": {
      "type": "string",
      "minLength": 1
    },
    "technology": {
      "enum": [
        "gs1-digital-link-qr",
        "gs1-sscc",
        "gs1-sgtin",
        "gs1-grai",
        "gs1-giai",
        "rfid-epc",
        "ble-beacon",
        "printed-qr",
        "manual"
      ]
    },
    "unit": {
      "$ref": "https://schemas.ectropy.ai/flow/flow-common.schema.json#/definitions/unitId"
    },
    "boundByEventId": {
      "$ref": "https://schemas.ectropy.ai/flow/flow-common.schema.json#/definitions/eventId"
    }
  }
}
