{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hsimc.tech/market/traditional-artisans/data/sku.schema.json",
  "title": "HSIMC artisan item identity",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "sku",
    "artisan_id",
    "public_url",
    "stage",
    "photo_sha256",
    "rights",
    "evidence"
  ],
  "properties": {
    "sku": {
      "type": "string",
      "pattern": "^ART-[A-Z0-9-]+-[0-9]{4}$"
    },
    "artisan_id": {
      "type": "string"
    },
    "public_url": {
      "type": "string",
      "format": "uri"
    },
    "stage": {
      "enum": [
        "draft",
        "photographed_unverified",
        "rights_approved",
        "verified",
        "withdrawn"
      ]
    },
    "photo_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "material": {
      "type": [
        "string",
        "null"
      ]
    },
    "technique": {
      "type": [
        "string",
        "null"
      ]
    },
    "dimensions": {
      "type": [
        "string",
        "null"
      ]
    },
    "price": {
      "type": [
        "object",
        "null"
      ]
    },
    "gi_claim": {
      "enum": [
        "none",
        "pending",
        "supported"
      ]
    },
    "rights": {
      "type": "object",
      "properties": {
        "public_release_authorized": {
          "type": "boolean"
        },
        "artwork_creator": {
          "type": [
            "string",
            "null"
          ]
        },
        "scope": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "public_release_authorized"
      ]
    },
    "tag_refs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "claim": {
            "type": "string"
          },
          "source_ref": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "verified",
              "disputed"
            ]
          }
        }
      }
    }
  }
}
