Rename is_anonymous to are_voters_known

This commit is contained in:
2024-12-30 15:37:23 +01:00
parent c8413eaff8
commit 9e96be5ff2
6 changed files with 23 additions and 23 deletions

View File

@ -13,11 +13,11 @@ import (
// CreateElectionRequest defines model for CreateElectionRequest.
type CreateElectionRequest struct {
Choices []string `json:"choices"`
ExpiresAt time.Time `json:"expires_at"`
IsAnonymous bool `json:"is_anonymous"`
AreVotersKnown bool `json:"are_voters_known"`
Choices []string `json:"choices"`
ExpiresAt time.Time `json:"expires_at"`
// MaxVoters Required when election is anonymous
// MaxVoters Required when voters are known
MaxVoters *int `json:"max_voters"`
Name string `json:"name"`
Tokens int `json:"tokens"`

View File

@ -6,14 +6,14 @@ import (
)
type ElectionModelInterface interface {
Insert(name string, tokens int, isAnonymous bool, maxVoters int, Choices []string, ExpiresAt time.Time) (int, error)
Insert(name string, tokens int, areVotersKnown bool, maxVoters int, Choices []string, ExpiresAt time.Time) (int, error)
}
type ElectionModel struct {
DB *sql.DB
}
func (e *ElectionModel) Insert(name string, tokens int, isAnonymous bool, maxVoters int, Choices []string, ExpiresAt time.Time) (int, error) {
func (e *ElectionModel) Insert(name string, tokens int, areVotersKnown bool, maxVoters int, Choices []string, ExpiresAt time.Time) (int, error) {
//TODO implement me
panic("implement me")
}