{"$schema":"http://json-schema.org/draft-07/schema#","schemaId":"660e8400-e29b-41d4-a716-446655440101","title":"Vote","type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The unique identifier for the vote"},"pollId":{"type":"string","format":"uuid","description":"ID of the poll being voted on"},"poll":{"type":"string","format":"uuid","description":"Global ID of the poll (reference)"},"userId":{"type":"string","format":"uuid","description":"ID of the user who cast the vote"},"voterId":{"type":"string","format":"uuid","description":"ID of the voter (user or delegate)"},"data":{"description":"Vote payload. Shape depends on the poll voting mode; must match the poll's mode.","oneOf":[{"type":"object","description":"Normal vote: single or multiple option indices as strings.","properties":{"mode":{"const":"normal","description":"Must match poll voting mode"},"options":{"type":"array","items":{"type":"string"},"description":"Option indices selected (e.g. [\"0\", \"1\"])"}},"required":["mode","options"],"additionalProperties":false},{"type":"object","description":"Point vote: option index → points.","properties":{"mode":{"const":"point","description":"Must match poll voting mode"},"points":{"type":"object","additionalProperties":{"type":"number"},"description":"Option index to points (e.g. { \"0\": 5, \"1\": 3 })"}},"required":["mode","points"],"additionalProperties":false},{"type":"object","description":"Rank vote: ordered choices; rank 1 = first choice.","properties":{"mode":{"const":"rank","description":"Must match poll voting mode"},"rankings":{"type":"array","items":{"type":"object","properties":{"option":{"type":"string","description":"Option index"},"rank":{"type":"integer","minimum":1,"description":"1 = first choice"}},"required":["option","rank"]},"description":"Ordered choices by rank"}},"required":["mode","rankings"],"additionalProperties":false},{"type":"object","description":"Blind vote: commitment and proof.","properties":{"mode":{"const":"blind","description":"Must match poll voting mode"},"commitment":{"type":"string","description":"Commitment to the vote"},"proof":{"type":"string","description":"Proof binding commitment"}},"required":["mode","commitment","proof"],"additionalProperties":false}]},"createdAt":{"type":"string","format":"date-time","description":"When the vote was cast"},"updatedAt":{"type":"string","format":"date-time","description":"When the vote was last updated"}},"required":["id","pollId","voterId","createdAt"],"additionalProperties":false}