{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:coos:schema:Resolution",
  "title": "Resolution",
  "description": "A motion or resolution considered at a general or council meeting, with the vote threshold required and its outcome.",
  "type": "object",
  "x-domain": "governance",
  "x-status": "proposed",
  "x-since": "0.1.0-draft",
  "x-relationships": [
    {
      "field": "votingRecordId",
      "target": "VotingRecord",
      "cardinality": "one",
      "required": false
    }
  ],
  "x-validationRules": [
    "meetingId must reference a GeneralMeeting when meetingType is general, and a CouncilMeeting otherwise.",
    "outcome must be pending when the meeting status is scheduled."
  ],
  "x-legalReviewNotes": [
    "Confirm the set of vote thresholds and the precise basis each is calculated on (for example, votes cast by eligible voters present in person or by proxy).",
    "Council decisions are generally by majority; the thresholds above mostly apply to general meetings."
  ],
  "required": [
    "id",
    "meetingType",
    "meetingId",
    "title",
    "voteThreshold",
    "outcome"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Stable identifier of this Resolution record."
    },
    "meetingType": {
      "type": "string",
      "description": "Kind of meeting the resolution was considered at.",
      "enum": [
        "general",
        "council"
      ],
      "x-enumDescriptions": {
        "general": "A GeneralMeeting.",
        "council": "A CouncilMeeting."
      }
    },
    "meetingId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Identifier of the GeneralMeeting or CouncilMeeting, according to meetingType."
    },
    "title": {
      "type": "string",
      "description": "Short title of the resolution.",
      "minLength": 1,
      "maxLength": 200
    },
    "text": {
      "type": "string",
      "description": "Full text of the resolution as presented.",
      "maxLength": 20000
    },
    "voteThreshold": {
      "type": "string",
      "description": "Vote required for the resolution to pass.",
      "enum": [
        "majority",
        "threeQuarter",
        "eightyPercent",
        "unanimous"
      ],
      "x-enumDescriptions": {
        "majority": "Majority vote.",
        "threeQuarter": "3/4 vote.",
        "eightyPercent": "80% vote.",
        "unanimous": "Unanimous vote."
      }
    },
    "outcome": {
      "type": "string",
      "description": "Result of the resolution.",
      "enum": [
        "pending",
        "passed",
        "defeated",
        "withdrawn",
        "amended"
      ],
      "x-enumDescriptions": {
        "pending": "Not yet voted on.",
        "passed": "Passed.",
        "defeated": "Defeated.",
        "withdrawn": "Withdrawn before a vote.",
        "amended": "Amended; see the resolution that replaced it."
      }
    },
    "votingRecordId": {
      "$ref": "urn:coos:schema:common#/$defs/Identifier",
      "description": "Tally of the vote, if recorded.",
      "x-references": "VotingRecord"
    },
    "extensions": {
      "$ref": "urn:coos:schema:common#/$defs/Extensions",
      "description": "Implementation-specific data, namespaced by reverse domain."
    }
  }
}
