{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://touristtaxtools.com/schemas/location-proof.v1.schema.json",
  "type": "object",
  "properties": {
    "addressId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
    },
    "addressFingerprint": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "officialCode": {
      "type": "object",
      "properties": {
        "scheme": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
        },
        "value": {
          "type": "string",
          "minLength": 1,
          "maxLength": 10000
        }
      },
      "required": ["scheme", "value"],
      "additionalProperties": false
    },
    "sourceEdition": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "scope": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
        },
        "status": {
          "enum": ["complete", "partial"]
        },
        "levyType": {
          "const": "tourist_accommodation"
        },
        "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 10000
        },
        "expectedAssessments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "layerSetEvidenceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
          },
          "minItems": 1,
          "maxItems": 100
        },
        "assessments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "jurisdictionId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
              },
              "membership": {
                "enum": ["included", "excluded"]
              },
              "ownLevy": {
                "enum": ["policies", "verified_none", "unknown"]
              },
              "policyIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
                },
                "minItems": 0,
                "maxItems": 100
              },
              "evidenceIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
                },
                "minItems": 1,
                "maxItems": 100
              }
            },
            "required": [
              "jurisdictionId",
              "membership",
              "ownLevy",
              "policyIds",
              "evidenceIds"
            ],
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 100
        }
      },
      "required": [
        "id",
        "status",
        "levyType",
        "summary",
        "expectedAssessments",
        "layerSetEvidenceIds",
        "assessments"
      ],
      "additionalProperties": false
    },
    "evidenceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$"
      },
      "minItems": 1,
      "maxItems": 100
    }
  },
  "required": [
    "addressId",
    "addressFingerprint",
    "officialCode",
    "sourceEdition",
    "scope",
    "evidenceIds"
  ],
  "additionalProperties": false
}
