{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:coos:schema:StrataCorporation",
  "title": "StrataCorporation",
  "description": "The legal entity, made up of the owners of the strata lots, that is responsible for managing and maintaining the common property and common assets of a strata plan.",
  "type": "object",
  "x-domain": "core",
  "x-status": "proposed",
  "x-since": "0.1.0-draft",
  "x-relationships": [
    {
      "field": "strataPlanId",
      "target": "StrataPlan",
      "cardinality": "one",
      "required": false
    },
    {
      "field": "managementOrganizationId",
      "target": "Organization",
      "cardinality": "one",
      "required": false
    }
  ],
  "x-validationRules": [
    "name should match the legal name on title, including the strata plan number.",
    "strataPlanNumber must equal the planNumber of the referenced StrataPlan when strataPlanId is present.",
    "A corporation with status \"dissolved\" should not be the target of new governance or financial records."
  ],
  "x-legalReviewNotes": [
    "Confirm wording of the definition against the Strata Property Act before marking stable.",
    "Confirm whether \"windingUp\" is a useful distinct status for data exchange."
  ],
  "required": [
    "id",
    "name",
    "strataPlanNumber",
    "jurisdiction",
    "status"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Stable identifier of this StrataCorporation record."
    },
    "name": {
      "type": "string",
      "description": "Legal name, typically in the form \"The Owners, Strata Plan EPS1234\".",
      "minLength": 1,
      "maxLength": 200
    },
    "commonName": {
      "type": "string",
      "description": "Informal or marketing name of the development, if any.",
      "maxLength": 200
    },
    "strataPlanNumber": {
      "$ref": "urn:coos:schema:common#/$defs/StrataPlanNumber",
      "description": "Number of the strata plan that created this corporation."
    },
    "strataPlanId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "The strata plan record for this corporation.",
      "x-references": "StrataPlan"
    },
    "jurisdiction": {
      "type": "string",
      "description": "Jurisdiction whose legislation governs the corporation.",
      "enum": [
        "BC"
      ],
      "x-enumDescriptions": {
        "BC": "British Columbia"
      }
    },
    "status": {
      "type": "string",
      "description": "Lifecycle status of the corporation.",
      "enum": [
        "active",
        "windingUp",
        "dissolved"
      ],
      "x-enumDescriptions": {
        "active": "The corporation exists and is operating.",
        "windingUp": "A winding-up process has been started.",
        "dissolved": "The corporation has been dissolved."
      }
    },
    "establishedDate": {
      "$ref": "urn:coos:schema:common#/$defs/Date",
      "description": "Date the corporation came into existence (normally the date the strata plan was deposited)."
    },
    "fiscalYearEnd": {
      "type": "string",
      "description": "Last day of the fiscal year as MM-DD.",
      "pattern": "^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"
    },
    "mailingAddress": {
      "$ref": "urn:coos:schema:common#/$defs/Address",
      "description": "Address for service or correspondence."
    },
    "managementOrganizationId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Strata management company currently engaged, if any.",
      "x-references": "Organization"
    },
    "extensions": {
      "$ref": "urn:coos:schema:common#/$defs/Extensions",
      "description": "Implementation-specific data, namespaced by reverse domain."
    }
  }
}
