Manage voter registration, approval workflows, and voter eligibility in your elections
Consensus provides a complete voter management system with registration workflows, status tracking, and eligibility controls to ensure secure and compliant elections.
Even approved voters must meet additional criteria to cast a vote:
Registration status must be APPROVED
// From src/services/VotingService.ts:51-53if (voter.registrationStatus !== RegistrationStatus.APPROVED) { throw new Error("Voter is not approved");}
Election must be ACTIVE
// From src/services/VotingService.ts:62-64if (election.status !== ElectionStatus.ACTIVE) { throw new Error("Election is not active");}
Current time within election dates
// From src/services/VotingService.ts:67-70const now = new Date();if (now < election.startDate || now > election.endDate) { throw new Error("Election is not currently open for voting");}
Voter has not already voted
// From src/services/VotingService.ts:73-75if (this.eligibilityRepository.hasVoted(dto.voterID, dto.electionID)) { throw new Error("Voter has already voted in this election");}
Consensus tracks that voters have voted while maintaining ballot anonymity.
The system records that a voter voted, but not how they voted. Ballots are stored separately without voter identification.
After casting a vote:
Anonymous ballot stored in ballot repository
Voter marked as having voted (prevents double voting)
Confirmation receipt issued to voter
No link between voter and ballot content
// From src/services/VotingService.ts:124-133// Store anonymous ballot (no link to voter)this.ballotRepository.save(anonymousBallot);// Store confirmation (for voter's records, no vote details)this.confirmationRepository.save(confirmation);// Mark voter as having votedthis.eligibilityRepository.markVoted(dto.voterID, dto.electionID);// Return confirmationreturn confirmation;
Voter accounts can be deleted to comply with data protection regulations.
// From src/services/VoterService.ts:136-142deleteVoter(voterID: string): void { const voter = this.voterRepository.findById(voterID); if (!voter) { throw new Error("Voter not found"); } this.voterRepository.delete(voterID);}
Deleting a voter removes their registration but does not affect previously cast ballots (which are anonymous). Vote confirmations linked to the voter will also be removed.