Election data structureΒΆ
Below is an overview of the election data structure. Detailed information about the usage and relation to the data can be found here. For you zoomed out version of this diagram, click on the image below.
classDiagram
%% Vote declarations
RejectedVotes --|> BaseVotes : Extends
CountedVotes --|> BaseVotes : Extends
namespace VoteClasses {
class BaseVotes {
+String reason
+int count
}
class RejectedVotes
class CountedVotes
}
%% meta-data declarations
namespace MetadataClasses {
class Contest {
+int id
+String name
}
class ManagingAuthority {
+int id
+String name
}
}
%% Base declarations
BaseWithVotesCount --|> BaseWithVotes : Extends
BaseWithVotes "1" --> "0..*" RejectedVotes : Contains many
BaseWithVotes "1" --> "0..*" CountedVotes : Contains many
namespace BaseClasses {
class BaseWithVotes {
-List~RejectedVotes~ _rejectedVotes
-List~CountedVotes~ _countedVotes
+setRejectedVotes(List~RejectedVotes~ votes)
+addRejectedVotes(RejectedVotes vote)
+removeRejectedVotes(RejectedVotes vote)
+getRejectedVotes() List~RejectedVotes~
+setCountedVotes(List~CountedVotes~ votes)
+addCountedVotes(CountedVotes vote)
+removeCountedVotes(CountedVotes vote)
+getCountedVotes() List~CountedVotes~
}
class BaseWithVotesCount {
+int cast
+int valid
+getCounted(): int
}
class BaseElectionResults {
+int id
+int votes
}
}
%% Gemeente declerations
BaseGemeente ..|> BaseWithVotesCount : Extends
StembureauGemeente --|> BaseGemeente : Extends
KiesKringGemeente ..|> BaseGemeente : Extends
StembureauGemeente "0..*" --> "0..*" Stembureau : Contains many
BaseGemeente "0..*" --> "0..*" ElectionPartyWithVotes : Contains many
namespace GemeenteClasses {
class BaseGemeente {
+int cast
+int counted
+String id
+String name
-List~ElectionPartyWithVotes~ _parties
+setElectionParties(List~ElectionPartyWithVotes~ parties)
+addElectionParty(ElectionPartyWithVotes party)
+removeElectionParty(ElectionPartyWithVotes party)
+getElectionParties() List~ElectionPartyWithVotes~
}
class KiesKringGemeente {
}
class StembureauGemeente {
-List~Stembureau~ _stembureaus
+setStembureaus(List~Stembureau~ bureaus)
+addStembureau(Stembureau bureau)
+removeStembureau(Stembureau bureau)
+getStembureaus() List~Stembureau~
}
}
%% Kieskring declarations
KiesKring ..|> BaseWithVotesCount : Extends
KiesKring "1" --> "1" Contest : Contains single
KiesKring "1" --> "1" ManagingAuthority : Contains single
KiesKring "1" --> "1" Election : Contains single
KiesKring "1" --> "0..*" KiesKringGemeente : Contains many
class KiesKring {
+int transactionId
+Contest contest
+ManagingAuthority authority
+Election election
-List~KiesKringGemeente~ _gemeentes
-List~ElectionPartyWithVotes~ _parties
+setGemeentes(List~KiesKringGemeente~ gemeentes)
+addGemeente(KiesKringGemeente gemeente)
+removeGemeente(KiesKringGemeente gemeente)
+getGemeente() List~KiesKringGemeente~
+setElectionParties(List~ElectionPartyWithVotes~ parties)
+addElectionParty(ElectionPartyWithVotes party)
+removeElectionParty(ElectionPartyWithVotes party)
+getElectionParties() List~ElectionPartyWithVotes~
}
%% Election declarations
Election "1" --> "1" ElectionCategory : Contains single
CandidateListElection --|> Election : Extends
ElectionPartyWithVotes --|> BaseElectionResults : Extends
ElectionPartyWithVotes "0..*" --> "0..*" CandidateWithVotes : Contains many
ElectionParty "0..*" --> "0..*" Candidate : Contains many
CandidateListElection "1" --> "0..*" ElectionParty : Contains many
namespace ElectionClasses {
class ElectionParty {
+int id
+String name
+String publicationLanguage
-boolean genderPublished
-List~Candidate~ _candidates
+setCandidates(List~Candidate~ candidates)
+addCandidate(Candidate candidate)
+removeCandidate(Candidate candidate)
+getCandidates() List~Candidate~
}
class ElectionPartyWithVotes {
+String name
-List~CandidateWithVotes~ _candidates
+setCandidates(List~CandidateWithVotes~ candidates)
+addCandidate(CandidateWithVotes candidate)
+removeCandidate(CandidateWithVotes candidate)
+getCandidates() List~CandidateWithVotes~
}
class CandidateListElection {
-List~ElectionParty~ _parties
+setElectionParties(List~ElectionParty~ parties)
+addElectionParty(ElectionParty party)
+removeElectionParty(ElectionParty party)
+getElectionParties() List~ElectionParty~
}
class Election {
+int id
+String name
+ElectionCategory category
+Date electionDate
}
class ElectionCategory {
<<Enumeration>>
TK
}
}
%% Candidate declarations
CandidateWithVotes --|> BaseElectionResults : Extends
Candidate "1" --> "1" CandidateGender : Contains single
CandidateList "1" --> "1" CandidateListElection : Contains single
namespace CandidateClasses {
class CandidateWithVotes {
+String shortCodeId
}
class CandidateList {
+int transactionId
+Date issueDate
+Contest contest
+ManagingAuthority authority
+Election election
}
class Candidate {
+int id
+String shortCodeId
+CandidateGender gender
+String location
+String firstName
+String lastName
+String prefix
+String initials
+getFullName() String
+getFullInitialsName() String
}
class CandidateGender {
<<Enumeration>>
male
female
unknown
}
}
%% Stembureau declarations
namespace StembureauClasses {
class Stembureau {
+String id
+String name
+int valid
+int cast
}
}