{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:coos:schema:CouncilMember",
  "title": "CouncilMember",
  "description": "A person serving on a strata council, with any officer role they hold.",
  "type": "object",
  "x-domain": "governance",
  "x-status": "proposed",
  "x-since": "0.1.0-draft",
  "x-relationships": [
    {
      "field": "councilId",
      "target": "StrataCouncil",
      "cardinality": "one",
      "required": true
    },
    {
      "field": "personId",
      "target": "Person",
      "cardinality": "one",
      "required": true
    }
  ],
  "x-validationRules": [
    "endDate must be on or after startDate.",
    "A council should have at most one active president at any time."
  ],
  "x-legalReviewNotes": [
    "Officer roles come from the Standard Bylaws; corporations can amend them. Consider allowing custom roles."
  ],
  "required": [
    "id",
    "councilId",
    "personId",
    "role",
    "startDate"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Stable identifier of this CouncilMember record."
    },
    "councilId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "The council the person serves on.",
      "x-references": "StrataCouncil"
    },
    "personId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "The person serving.",
      "x-references": "Person"
    },
    "role": {
      "type": "string",
      "description": "Officer role held on council.",
      "enum": [
        "president",
        "vicePresident",
        "secretary",
        "treasurer",
        "member"
      ],
      "x-enumDescriptions": {
        "president": "President.",
        "vicePresident": "Vice president.",
        "secretary": "Secretary.",
        "treasurer": "Treasurer.",
        "member": "Council member without an officer role."
      }
    },
    "startDate": {
      "$ref": "urn:coos:schema:common#/$defs/Date",
      "description": "Date the person started in this role."
    },
    "endDate": {
      "$ref": "urn:coos:schema:common#/$defs/Date",
      "description": "Date the person stopped serving in this role, if they have."
    },
    "extensions": {
      "$ref": "urn:coos:schema:common#/$defs/Extensions",
      "description": "Implementation-specific data, namespaced by reverse domain."
    }
  }
}
