{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:coos:schema:Unit",
  "title": "Unit",
  "description": "The civic unit designation and address by which a strata lot is commonly known. Separated from StrataLot because the unit number people use often differs from the strata lot number.",
  "type": "object",
  "x-domain": "core",
  "x-status": "experimental",
  "x-since": "0.1.0-draft",
  "x-relationships": [
    {
      "field": "strataLotId",
      "target": "StrataLot",
      "cardinality": "one",
      "required": true
    }
  ],
  "x-validationRules": [
    "address.unitDesignator should equal unitNumber when both are present."
  ],
  "required": [
    "id",
    "strataLotId",
    "address"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Stable identifier of this Unit record."
    },
    "strataLotId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "The strata lot this unit corresponds to.",
      "x-references": "StrataLot"
    },
    "unitNumber": {
      "type": "string",
      "description": "Unit number in common use (for example \"305\").",
      "maxLength": 32
    },
    "address": {
      "$ref": "urn:coos:schema:common#/$defs/Address",
      "description": "Civic address of the unit."
    },
    "extensions": {
      "$ref": "urn:coos:schema:common#/$defs/Extensions",
      "description": "Implementation-specific data, namespaced by reverse domain."
    }
  }
}
