vote.proto

syntax = "proto3";

package pub.odf.election.v1;


message Vote {
  // 32-bit GUID for a specific candidate in a specific race.
  // Should be randomly generated for every unique candidate in every race.
  // ie. If the same person runs multiple times in multiple unique elections, they will
  // have a unique GUID generated for them each time.
  uint32 candidate_id = 1;
}


// A complete ballot for a single person in a single election
message Ballot {
  // UNIX timestamp for when the ballot of votes was compiled.
  uint32 timestamp = 1;

  // A map of the candidate's GUID to the Vote cast for them.
  // The candidate GUID is used as the key in the map to prevent duplicate votes
  // being cast for the same candidate. In the case of duplicate key values, only
  // the last value read is counted.
  map<uint32, Vote> votes = 2;
}