{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://shenzhen-family-spa.example/data/venue.schema.json",
  "title": "Bilingual Shenzhen Family Spa venue record",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "slug", "status", "name", "short_description", "public_notice", "media", "official_identity", "location", "policies", "visitor_practicalities", "commerce", "sources", "verification", "volatile_fields", "editorial_assessment"],
  "properties": {
    "id": { "type": "string", "minLength": 1 },
    "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
    "status": { "enum": ["verified", "unverified", "changed"] },
    "name": { "$ref": "#/$defs/localizedText" },
    "short_description": { "$ref": "#/$defs/localizedText" },
    "public_notice": { "$ref": "#/$defs/localizedText" },
    "media": {
      "type": "object",
      "additionalProperties": false,
      "required": ["hero", "gallery"],
      "properties": {
        "hero": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/mediaItem" }] },
        "gallery": { "type": "array", "items": { "$ref": "#/$defs/mediaItem" } }
      }
    },
    "official_identity": { "$ref": "#/$defs/officialIdentity" },
    "location": { "$ref": "#/$defs/location" },
    "policies": {
      "type": "object",
      "additionalProperties": false,
      "required": ["children_admitted", "minimum_age_years", "height_restrictions", "adult_supervision", "gender_separation", "shared_family_areas", "children_facilities"],
      "properties": {
        "children_admitted": { "$ref": "#/$defs/booleanFact" },
        "minimum_age_years": { "$ref": "#/$defs/numberFact" },
        "height_restrictions": { "$ref": "#/$defs/stringFact" },
        "adult_supervision": { "$ref": "#/$defs/stringFact" },
        "gender_separation": { "$ref": "#/$defs/stringFact" },
        "shared_family_areas": { "$ref": "#/$defs/booleanFact" },
        "children_facilities": { "$ref": "#/$defs/stringArrayFact" }
      }
    },
    "visitor_practicalities": {
      "type": "object",
      "additionalProperties": false,
      "required": ["opening_hours", "english_support", "foreign_passport_accepted", "payment_methods", "foreign_cards_supported", "overnight_available"],
      "properties": {
        "opening_hours": { "$ref": "#/$defs/stringFact" },
        "english_support": { "$ref": "#/$defs/englishFact" },
        "foreign_passport_accepted": { "$ref": "#/$defs/booleanFact" },
        "payment_methods": { "$ref": "#/$defs/stringArrayFact" },
        "foreign_cards_supported": { "$ref": "#/$defs/booleanFact" },
        "overnight_available": { "$ref": "#/$defs/booleanFact" }
      }
    },
    "commerce": { "$ref": "#/$defs/commerce" },
    "sources": { "type": "array", "items": { "$ref": "#/$defs/source" } },
    "verification": { "$ref": "#/$defs/verification" },
    "volatile_fields": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
    "editorial_assessment": { "$ref": "#/$defs/editorialAssessment" }
  },
  "$defs": {
    "localizedText": {
      "type": "object",
      "additionalProperties": false,
      "required": ["en", "zh_hk"],
      "properties": { "en": { "type": "string", "minLength": 1 }, "zh_hk": { "type": "string", "minLength": 1 } }
    },
    "mediaItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["url", "visual_type", "alt", "source_url", "rights_status", "credit"],
      "properties": {
        "url": { "type": "string", "minLength": 1 },
        "visual_type": { "enum": ["official_photo", "venue_photo", "editorial_illustration"] },
        "alt": { "$ref": "#/$defs/localizedText" },
        "source_url": { "type": ["string", "null"], "format": "uri" },
        "rights_status": { "enum": ["owned", "permission_confirmed", "external_reference", "not_cleared"] },
        "credit": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/localizedText" }] }
      }
    },
    "factBase": {
      "type": "object",
      "required": ["value", "display", "source_ids", "verified_at"],
      "properties": {
        "value": {}, "display": { "$ref": "#/$defs/localizedText" },
        "source_ids": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
        "verified_at": { "type": ["string", "null"], "format": "date-time" }
      }
    },
    "stringFact": { "type": "object", "unevaluatedProperties": false, "allOf": [{ "$ref": "#/$defs/factBase" }, { "properties": { "value": { "type": ["string", "null"] } } }] },
    "booleanFact": { "type": "object", "unevaluatedProperties": false, "allOf": [{ "$ref": "#/$defs/factBase" }, { "properties": { "value": { "type": ["boolean", "null"] } } }] },
    "numberFact": { "type": "object", "unevaluatedProperties": false, "allOf": [{ "$ref": "#/$defs/factBase" }, { "properties": { "value": { "type": ["number", "null"], "minimum": 0 } } }] },
    "stringArrayFact": { "type": "object", "unevaluatedProperties": false, "allOf": [{ "$ref": "#/$defs/factBase" }, { "properties": { "value": { "oneOf": [{ "type": "null" }, { "type": "array", "items": { "type": "string" }, "uniqueItems": true }] } } }] },
    "englishFact": { "type": "object", "unevaluatedProperties": false, "allOf": [{ "$ref": "#/$defs/factBase" }, { "properties": { "value": { "enum": ["none", "limited", "available", null] } } }] },
    "packagesFact": {
      "type": "object", "unevaluatedProperties": false,
      "allOf": [{ "$ref": "#/$defs/factBase" }, { "properties": { "value": { "oneOf": [{ "type": "null" }, { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "name", "price_cny", "includes", "highlights", "offers"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "name": { "$ref": "#/$defs/localizedText" }, "price_cny": { "type": ["number", "null"], "minimum": 0 }, "includes": { "type": "array", "items": { "$ref": "#/$defs/localizedText" } }, "highlights": { "type": "array", "items": { "$ref": "#/$defs/localizedText" } }, "offers": { "type": "array", "items": { "$ref": "#/$defs/packageOffer" } } } } }] } } }]
    },
    "packageOffer": {
      "type": "object", "additionalProperties": false,
      "required": ["id", "provider_id", "provider_product_id", "destination_url", "link_kind", "affiliate_tracking", "last_checked_at", "link_scope", "price_cny"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "provider_id": { "type": "string", "minLength": 1 },
        "provider_product_id": { "type": ["string", "null"] },
        "destination_url": { "type": ["string", "null"], "format": "uri" },
        "link_kind": { "enum": ["official", "platform", "affiliate", "not_set"] },
        "affiliate_tracking": { "enum": ["configured", "not_configured"] },
        "last_checked_at": { "type": ["string", "null"], "format": "date-time" },
        "link_scope": { "enum": ["product_page", "package"] },
        "price_cny": { "type": ["number", "null"], "minimum": 0 }
      }
    },
    "officialIdentity": {
      "type": "object", "additionalProperties": false, "required": ["official_name", "website_url", "map_url", "phone"],
      "properties": { "official_name": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/localizedText" }] }, "website_url": { "type": ["string", "null"], "format": "uri" }, "map_url": { "type": ["string", "null"], "format": "uri" }, "phone": { "type": ["string", "null"] } }
    },
    "location": {
      "type": "object", "additionalProperties": false, "required": ["address", "metro", "coordinates"],
      "properties": {
        "address": { "type": "object", "additionalProperties": false, "required": ["street", "district", "city", "province", "postal_code", "country_code"], "properties": { "street": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/localizedText" }] }, "district": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/localizedText" }] }, "city": { "$ref": "#/$defs/localizedText" }, "province": { "$ref": "#/$defs/localizedText" }, "postal_code": { "type": ["string", "null"] }, "country_code": { "const": "CN" } } },
        "metro": { "type": "object", "additionalProperties": false, "required": ["station", "line", "exit", "walking_minutes", "source_ids", "verified_at"], "properties": { "station": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/localizedText" }] }, "line": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/localizedText" }] }, "exit": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/localizedText" }] }, "walking_minutes": { "type": ["number", "null"], "minimum": 0 }, "source_ids": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, "verified_at": { "type": ["string", "null"], "format": "date-time" } } },
        "coordinates": { "oneOf": [{ "type": "null" }, { "type": "object", "additionalProperties": false, "required": ["lat", "lng"], "properties": { "lat": { "type": "number", "minimum": -90, "maximum": 90 }, "lng": { "type": "number", "minimum": -180, "maximum": 180 } } }] }
      }
    },
    "commerce": {
      "type": "object", "additionalProperties": false, "required": ["currency", "price_summary", "packages", "validity_terms", "booking"],
      "properties": {
        "currency": { "const": "CNY" }, "price_summary": { "$ref": "#/$defs/stringFact" }, "packages": { "$ref": "#/$defs/packagesFact" }, "validity_terms": { "$ref": "#/$defs/stringFact" },
        "booking": { "type": "object", "additionalProperties": false, "required": ["provider_id", "provider_product_id", "destination_url", "link_kind", "affiliate_tracking", "last_checked_at"], "properties": { "provider_id": { "enum": ["klook", "other", null] }, "provider_product_id": { "type": ["string", "null"] }, "destination_url": { "type": ["string", "null"], "format": "uri" }, "link_kind": { "enum": ["official", "platform", "affiliate", "not_set"] }, "affiliate_tracking": { "enum": ["configured", "not_configured"] }, "last_checked_at": { "type": ["string", "null"], "format": "date-time" } } }
      }
    },
    "source": {
      "type": "object", "additionalProperties": false, "required": ["id", "label", "url", "publisher", "source_type", "accessed_at", "supports_fields"],
      "properties": { "id": { "type": "string", "minLength": 1 }, "label": { "$ref": "#/$defs/localizedText" }, "url": { "type": "string", "format": "uri" }, "publisher": { "$ref": "#/$defs/localizedText" }, "source_type": { "enum": ["official", "booking_platform", "phone_confirmation", "on_site_confirmation", "government", "map_service", "transport_operator"] }, "accessed_at": { "type": "string", "format": "date-time" }, "supports_fields": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "uniqueItems": true } }
    },
    "verification": {
      "type": "object", "additionalProperties": false, "required": ["verified_at", "updated_at", "next_review_due", "reviewer", "change_notes"],
      "properties": { "verified_at": { "type": ["string", "null"], "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "next_review_due": { "type": ["string", "null"], "format": "date-time" }, "reviewer": { "type": ["string", "null"] }, "change_notes": { "$ref": "#/$defs/localizedText" } }
    },
    "editorialAssessment": {
      "type": "object", "additionalProperties": false, "required": ["labeled_as_editorial", "family_fit", "summary", "based_on_source_ids"],
      "properties": { "labeled_as_editorial": { "const": true }, "family_fit": { "enum": ["recommended", "conditional", "not_recommended", "unknown"] }, "summary": { "$ref": "#/$defs/localizedText" }, "based_on_source_ids": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }
    }
  }
}
