Incomplete implementation of createVotes

This commit is contained in:
2025-01-02 19:24:32 +01:00
parent 9efe9a3537
commit 0229f78976
9 changed files with 136 additions and 13 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"code.dlmw.ch/dlmw/qv/internal/models"
"io"
"log/slog"
"net/http"
@ -48,6 +49,18 @@ func (e *mockElectionModel) Insert(name string, tokens int, areVotersKnown bool,
return 1, nil
}
func (e *mockElectionModel) GetById(id int) (*models.Election, error) {
return &models.Election{
ID: id,
Name: "Guy of the year",
Tokens: 100,
AreVotersKnown: false,
MaxVoters: 10,
CreatedAt: time.Now().String(),
ExpiresAt: time.Now().Add(100 * time.Hour).String(),
}, nil
}
type mockVoterModel struct {
}