Skip to content

Commit

Permalink
Update swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendPeter committed Jan 14, 2025
1 parent dcdef55 commit a780eea
Showing 1 changed file with 131 additions and 0 deletions.
131 changes: 131 additions & 0 deletions packages/backend/src/OpenApi/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,25 @@
],
"type": "object"
},
"BallotSubmitStatus": {
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"voter_id": {
"type": "string"
}
},
"required": [
"message",
"success",
"voter_id"
],
"type": "object"
},
"Candidate": {
"properties": {
"bio": {
Expand Down Expand Up @@ -729,6 +748,21 @@
],
"type": "object"
},
"NewBallotWithVoterID": {
"properties": {
"ballot": {
"$ref": "#/components/schemas/NewBallot"
},
"voter_id": {
"type": "string"
}
},
"required": [
"ballot",
"voter_id"
],
"type": "object"
},
"NewElection": {
"properties": {
"admin_ids": {
Expand Down Expand Up @@ -1151,6 +1185,8 @@
"canInvalidateElectionRoll",
"canSendEmails",
"canUnflagElectionRoll",
"canUpdatePublicArchive",
"canUploadBallots",
"canViewBallot",
"canViewBallots",
"canViewElection",
Expand Down Expand Up @@ -1201,6 +1237,12 @@
},
"type": "array"
},
"logs": {
"items": {
"$ref": "#/components/schemas/tabulatorLog"
},
"type": "array"
},
"other": {
"items": {
"$ref": "#/components/schemas/candidate"
Expand Down Expand Up @@ -1235,6 +1277,7 @@
},
"required": [
"elected",
"logs",
"other",
"roundResults",
"summaryData",
Expand Down Expand Up @@ -2564,6 +2607,94 @@
}
}
},
"/Election/{id}/uploadBallots": {
"post": {
"summary": "Upload ballots for an election",
"tags": [
"Ballots"
],
"security": [
{
"ApiKeyAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true,
"description": "The election ID"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ballots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ballot": {
"type": "object",
"$ref": "#/components/schemas/NewBallot"
},
"voter_id": {
"type": "string"
}
}
}
}
}
}
}
}
},
"respon ses": {
"200": {
"description": "All Ballots Processed",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"responses": {
"type": "array",
"items": {
"type": "object",
"properties": {
"voter_id": {
"type": "string",
"description": "id of voter"
},
"success": {
"type": "boolean",
"description": "If ballot was uploaded"
},
"message": {
"type": "string",
"description": "Corresponding message"
}
}
}
}
}
}
}
}
},
"404": {
"description": "Election not found"
}
}
}
},
"/Election/{id}": {
"get": {
"summary": "Get election by ID",
Expand Down

0 comments on commit a780eea

Please sign in to comment.