{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Yu Stay public website information v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "websiteIdentity",
    "contentUpdatedAt",
    "siteUrl",
    "languages",
    "property",
    "accommodations",
    "media",
    "bookingPlatforms",
    "content",
    "pages",
    "capabilities"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "websiteIdentity": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "officialUrl",
        "isSoleOfficialWebsite",
        "statement"
      ],
      "properties": {
        "officialUrl": {
          "type": "string",
          "pattern": "^https://"
        },
        "isSoleOfficialWebsite": {
          "const": true
        },
        "statement": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "zh-hans",
            "zh-hant",
            "en"
          ],
          "properties": {
            "zh-hans": {
              "type": "string",
              "minLength": 1
            },
            "zh-hant": {
              "type": "string",
              "minLength": 1
            },
            "en": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    },
    "contentUpdatedAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T"
    },
    "siteUrl": {
      "type": "string",
      "pattern": "^https?://"
    },
    "languages": {
      "const": [
        "zh-hans",
        "zh-hant",
        "en"
      ]
    },
    "property": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "address",
        "physicalRoomCount",
        "contact",
        "sharedFacilities",
        "mapLinks",
        "locationContext"
      ],
      "properties": {
        "name": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "zh-hans",
            "zh-hant",
            "en"
          ],
          "properties": {
            "zh-hans": {
              "type": "string",
              "minLength": 1
            },
            "zh-hant": {
              "type": "string",
              "minLength": 1
            },
            "en": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "address": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "zh-hans",
            "zh-hant",
            "en"
          ],
          "properties": {
            "zh-hans": {
              "type": "string",
              "minLength": 1
            },
            "zh-hant": {
              "type": "string",
              "minLength": 1
            },
            "en": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "locationContext": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "eastCoast",
            "transportNodes",
            "neighborhood"
          ],
          "properties": {
            "eastCoast": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "approximateDriveMinutes",
                "taxiConvenient",
                "venues"
              ],
              "properties": {
                "name": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "zh-hans",
                    "zh-hant",
                    "en"
                  ],
                  "properties": {
                    "zh-hans": {
                      "type": "string",
                      "minLength": 1
                    },
                    "zh-hant": {
                      "type": "string",
                      "minLength": 1
                    },
                    "en": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "approximateDriveMinutes": {
                  "type": "integer",
                  "minimum": 1
                },
                "taxiConvenient": {
                  "const": true
                },
                "venues": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "name",
                      "activities"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                      },
                      "name": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "zh-hans",
                          "zh-hant",
                          "en"
                        ],
                        "properties": {
                          "zh-hans": {
                            "type": "string",
                            "minLength": 1
                          },
                          "zh-hant": {
                            "type": "string",
                            "minLength": 1
                          },
                          "en": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "activities": {
                        "type": "array",
                        "minItems": 1,
                        "uniqueItems": true,
                        "items": {
                          "enum": [
                            "concerts",
                            "poker-competitions",
                            "exhibitions",
                            "academic-events",
                            "university-enrolment",
                            "graduation",
                            "academic-exchange"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "transportNodes": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "name",
                  "approximateDriveMinutes"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "name": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "zh-hans",
                      "zh-hant",
                      "en"
                    ],
                    "properties": {
                      "zh-hans": {
                        "type": "string",
                        "minLength": 1
                      },
                      "zh-hant": {
                        "type": "string",
                        "minLength": 1
                      },
                      "en": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  },
                  "approximateDriveMinutes": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            },
            "neighborhood": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "direction",
                "approximateWalkMinutes",
                "distanceM",
                "amenities",
                "foods"
              ],
              "properties": {
                "direction": {
                  "const": "east"
                },
                "approximateWalkMinutes": {
                  "type": "integer",
                  "minimum": 1
                },
                "distanceM": {
                  "type": "integer",
                  "minimum": 1
                },
                "amenities": {
                  "type": "array",
                  "minItems": 1,
                  "uniqueItems": true,
                  "items": {
                    "enum": [
                      "supermarket"
                    ]
                  }
                },
                "foods": {
                  "type": "array",
                  "minItems": 1,
                  "uniqueItems": true,
                  "items": {
                    "enum": [
                      "seafood",
                      "rice-rolls",
                      "beef-hotpot",
                      "kway-teow-noodles"
                    ]
                  }
                }
              }
            }
          }
        },
        "mapLinks": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "amap",
            "baidu",
            "google"
          ],
          "properties": {
            "amap": {
              "type": "string",
              "pattern": "^https://"
            },
            "baidu": {
              "type": "string",
              "pattern": "^https://"
            },
            "google": {
              "type": "string",
              "pattern": "^https://"
            }
          }
        },
        "physicalRoomCount": {
          "type": "integer",
          "minimum": 1
        },
        "sharedFacilities": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "contact": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "phone",
            "internationalPhone",
            "wechat",
            "email"
          ],
          "properties": {
            "phone": {
              "type": "string",
              "minLength": 1
            },
            "internationalPhone": {
              "type": "string",
              "minLength": 1
            },
            "wechat": {
              "type": "string",
              "minLength": 1
            },
            "email": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    },
    "accommodations": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "slug",
          "kind",
          "name",
          "areaM2",
          "bedrooms",
          "livingRooms",
          "bathrooms",
          "floors",
          "bedroomBeds",
          "livingRoomBeds",
          "standardGuests",
          "registeredMaximumGuests",
          "bathtub",
          "smartToilet",
          "imageIds",
          "pages",
          "overlapsOtherProducts",
          "privateBalcony"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "kind": {
            "enum": [
              "room",
              "floor",
              "duplex",
              "estate"
            ]
          },
          "name": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "zh-hans",
              "zh-hant",
              "en"
            ],
            "properties": {
              "zh-hans": {
                "type": "string",
                "minLength": 1
              },
              "zh-hant": {
                "type": "string",
                "minLength": 1
              },
              "en": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "bedrooms": {
            "type": "integer",
            "minimum": 1
          },
          "bathrooms": {
            "type": "integer",
            "minimum": 1
          },
          "standardGuests": {
            "type": "integer",
            "minimum": 1
          },
          "registeredMaximumGuests": {
            "type": "integer",
            "minimum": 1
          },
          "maximumAdults": {
            "type": "integer",
            "minimum": 1
          },
          "areaM2": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "livingRooms": {
            "type": "integer",
            "minimum": 0
          },
          "floors": {
            "type": "string"
          },
          "bedroomBeds": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "count",
                "widthM",
                "lengthM"
              ],
              "properties": {
                "count": {
                  "type": "integer",
                  "minimum": 1
                },
                "widthM": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "lengthM": {
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              }
            }
          },
          "livingRoomBeds": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "count",
                "widthM",
                "lengthM"
              ],
              "properties": {
                "count": {
                  "type": "integer",
                  "minimum": 1
                },
                "widthM": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "lengthM": {
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              }
            }
          },
          "bathtub": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "smartToilet": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "imageIds": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "pages": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "zh-hans",
              "zh-hant",
              "en"
            ],
            "properties": {
              "zh-hans": {
                "type": "string",
                "minLength": 1
              },
              "zh-hant": {
                "type": "string",
                "minLength": 1
              },
              "en": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "overlapsOtherProducts": {
            "type": "boolean"
          },
          "privateBalcony": {
            "type": "boolean"
          }
        }
      }
    },
    "media": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": [
          "id",
          "width",
          "height",
          "alt",
          "url",
          "variants"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "width": {
            "type": "integer",
            "minimum": 1
          },
          "height": {
            "type": "integer",
            "minimum": 1
          },
          "alt": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "zh-hans",
              "zh-hant",
              "en"
            ],
            "properties": {
              "zh-hans": {
                "type": "string",
                "minLength": 1
              },
              "zh-hant": {
                "type": "string",
                "minLength": 1
              },
              "en": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "url": {
            "type": "string"
          },
          "variants": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "avif",
              "webp",
              "jpg"
            ],
            "properties": {
              "avif": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "width",
                    "url"
                  ],
                  "properties": {
                    "width": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              },
              "webp": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "width",
                    "url"
                  ],
                  "properties": {
                    "width": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              },
              "jpg": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "width",
                    "url"
                  ],
                  "properties": {
                    "width": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "bookingPlatforms": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "zh-hans",
              "zh-hant",
              "en"
            ],
            "properties": {
              "zh-hans": {
                "type": "string",
                "minLength": 1
              },
              "zh-hant": {
                "type": "string",
                "minLength": 1
              },
              "en": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "url": {
            "type": "string",
            "pattern": "^https://"
          }
        }
      }
    },
    "content": {
      "type": "object",
      "required": [
        "zh-hans",
        "zh-hant",
        "en"
      ],
      "additionalProperties": {
        "type": "object"
      }
    },
    "pages": {
      "type": "object",
      "required": [
        "zh-hans",
        "zh-hant",
        "en"
      ],
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "key",
            "title",
            "url"
          ],
          "properties": {
            "key": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          }
        }
      }
    },
    "capabilities": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "liveRates",
        "liveAvailability",
        "onlineBooking",
        "publicReadAccess"
      ],
      "properties": {
        "liveRates": {
          "const": false
        },
        "liveAvailability": {
          "const": false
        },
        "onlineBooking": {
          "const": false
        },
        "publicReadAccess": {
          "const": true
        }
      }
    }
  }
}
