Add page to create an election

This commit is contained in:
2025-01-13 19:58:42 +01:00
parent c7cccf2ec1
commit ee847020f7
7 changed files with 239 additions and 125 deletions

View File

@ -133,107 +133,6 @@ paths:
components:
schemas:
Election:
type: object
required:
- id
- name
- tokens
- areVotersKnown
- maxVoters
- expiresAt
properties:
id:
type: integer
format: int64
readOnly: true
name:
type: string
minLength: 1
tokens:
type: integer
minimum: 1
areVotersKnown:
type: boolean
maxVoters:
type: integer
minimum: 0
description: Must be greater than 0 when voters are known
createdAt:
type: string
format: date-time
readOnly: true
expiresAt:
type: string
format: date-time
choices:
type: array
items:
$ref: '#/components/schemas/Choice'
voters:
type: array
items:
$ref: '#/components/schemas/Voter'
Choice:
type: object
required:
- text
- electionId
properties:
text:
type: string
minLength: 1
electionId:
type: integer
format: int64
Voter:
type: object
required:
- identity
- electionId
properties:
identity:
type: string
minLength: 1
description: When voters are known, passcodes will be pre-generated
electionId:
type: integer
format: int64
votes:
type: array
items:
$ref: '#/components/schemas/Vote'
Vote:
type: object
required:
- voterIdentity
- electionId
properties:
voterIdentity:
type: string
minLength: 1
electionId:
type: integer
format: int64
choiceText:
type: string
nullable: true
tokens:
type: integer
minimum: 1
nullable: true
calculatedVoteCount:
type: integer
readOnly: true
description: Calculated as floor(sqrt(tokens))
createdAt:
type: string
format: date-time
readOnly: true
CreateElectionRequest:
type: object
required: