Election-Tech-Initiative / electionguard-api-python

ElectionGuard Web API in python to demonstrate usage of electionguard-python in performing ballot encryption, casting, spoiling, and tallying.
https://www.electionguard.vote/
MIT License
36 stars 26 forks source link

🗳️ list elections with ballots #217

Closed lprichar closed 2 years ago

lprichar commented 2 years ago

Issue

Fixes #176 Fixes #202

Description

Adds a new endpoint for retrieving elections along with their name and the number of ballots they contain (both spoiled and cast). Results sorted reverse chronologically.

Testing

  1. Authenticate
  2. Hit {{mediator-url}}/api/{{version}}/election/list

Expected: a list of elections like:

{
    "status": "success",
    "message": null,
    "elections": [
        {
            "election_id": "hamilton-general-election-simple",
            "name": "Hamiltion County General Election",
            "state": "OPEN",
            "number_of_guardians": 5,
            "quorum": 3,
            "cast_ballots": 7,
            "spoiled_ballots": 2
        }
    ]
}