{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:coos:schema:StrataPlan",
  "title": "StrataPlan",
  "description": "The plan deposited in the Land Title Office that divides land or a building into strata lots and common property.",
  "type": "object",
  "x-domain": "core",
  "x-status": "proposed",
  "x-since": "0.1.0-draft",
  "x-relationships": [],
  "x-validationRules": [
    "totalStrataLots should equal the number of StrataLot records for the plan in a complete data set.",
    "totalUnitEntitlement should equal the sum of StrataLot.unitEntitlement in a complete data set."
  ],
  "x-legalReviewNotes": [
    "Confirm whether additional plan types (for example, mixed building and bare land) need to be represented."
  ],
  "required": [
    "id",
    "planNumber",
    "planType"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Stable identifier of this StrataPlan record."
    },
    "planNumber": {
      "$ref": "urn:coos:schema:common#/$defs/StrataPlanNumber",
      "description": "Registered strata plan number."
    },
    "planType": {
      "type": "string",
      "description": "Kind of strata plan.",
      "enum": [
        "building",
        "bareLand"
      ],
      "x-enumDescriptions": {
        "building": "Strata lots are defined by reference to a building.",
        "bareLand": "Strata lots are defined by reference to land rather than a building."
      }
    },
    "depositDate": {
      "$ref": "urn:coos:schema:common#/$defs/Date",
      "description": "Date the plan was deposited in the Land Title Office."
    },
    "totalStrataLots": {
      "type": "integer",
      "description": "Number of strata lots on the plan.",
      "minimum": 1
    },
    "totalUnitEntitlement": {
      "type": "number",
      "description": "Sum of unit entitlement of all strata lots, from the Schedule of Unit Entitlement.",
      "exclusiveMinimum": 0
    },
    "phased": {
      "type": "boolean",
      "description": "Whether the plan was or is being deposited in phases."
    },
    "amendments": {
      "type": "array",
      "description": "Recorded amendments to the strata plan.",
      "items": {
        "type": "object",
        "required": [
          "description"
        ],
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string",
            "description": "Description of the amendment.",
            "maxLength": 1000
          },
          "registeredDate": {
            "$ref": "urn:coos:schema:common#/$defs/Date",
            "description": "Registration date of the amendment."
          }
        }
      }
    },
    "extensions": {
      "$ref": "urn:coos:schema:common#/$defs/Extensions",
      "description": "Implementation-specific data, namespaced by reverse domain."
    }
  }
}
