{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:coos:schema:StrataLot",
  "title": "StrataLot",
  "description": "A lot shown on a strata plan. Each strata lot is owned separately and carries a share of common expenses according to its unit entitlement.",
  "type": "object",
  "x-domain": "core",
  "x-status": "proposed",
  "x-since": "0.1.0-draft",
  "x-relationships": [
    {
      "field": "strataCorporationId",
      "target": "StrataCorporation",
      "cardinality": "one",
      "required": true
    },
    {
      "field": "buildingId",
      "target": "Building",
      "cardinality": "one",
      "required": false
    }
  ],
  "x-validationRules": [
    "lotNumber must be unique within a strata corporation.",
    "parcelIdentifier must be unique across all strata lots."
  ],
  "x-legalReviewNotes": [
    "Confirm how voting entitlement differs from unit entitlement and whether it needs its own field."
  ],
  "required": [
    "id",
    "strataCorporationId",
    "lotNumber",
    "unitEntitlement"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Stable identifier of this StrataLot record."
    },
    "strataCorporationId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "The strata corporation this record belongs to.",
      "x-references": "StrataCorporation"
    },
    "lotNumber": {
      "type": "integer",
      "description": "Strata lot number as shown on the strata plan.",
      "minimum": 1
    },
    "parcelIdentifier": {
      "$ref": "urn:coos:schema:common#/$defs/ParcelIdentifier",
      "description": "Parcel Identifier (PID) of the strata lot."
    },
    "unitEntitlement": {
      "type": "number",
      "description": "Unit entitlement from the Schedule of Unit Entitlement, used to apportion common expenses.",
      "exclusiveMinimum": 0
    },
    "usage": {
      "type": "string",
      "description": "Intended use of the strata lot.",
      "enum": [
        "residential",
        "nonResidential"
      ],
      "x-enumDescriptions": {
        "residential": "Residential strata lot.",
        "nonResidential": "Non-residential (for example commercial) strata lot."
      }
    },
    "areaSquareMetres": {
      "type": "number",
      "description": "Area of the strata lot in square metres, if known.",
      "exclusiveMinimum": 0
    },
    "buildingId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Building the strata lot is located in, if applicable.",
      "x-references": "Building"
    },
    "extensions": {
      "$ref": "urn:coos:schema:common#/$defs/Extensions",
      "description": "Implementation-specific data, namespaced by reverse domain."
    }
  }
}
