Skip to content

Commit

Permalink
Document cancellation reason field
Browse files Browse the repository at this point in the history
The field is added automatically, but wasn't documented
  • Loading branch information
symroe authored and VirginiaDooley committed Oct 30, 2023
1 parent 0ec4ae3 commit f71e1ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ec_api/apps/api_docs/blueprints/data_structures.apibp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
+ geometry (Point)


## CancellationReason (enum)
+ `NO_CANDIDATES`
+ `EQUAL_CANDIDATES`
+ `UNDER_CONTESTED`
+ `CANDIDATE_DEATH`

## ValidFinderResponse (object)
+ `address_picker`: `false` (boolean) - True if we need to show this user an address picker
+ addresses (array[object]) - An array of address objects containing the addresses applicable to this request (if necessary)
Expand Down Expand Up @@ -79,6 +85,7 @@
+ `elected_role`: `Local Councillor` (string) - Name of the role the winner(s) of this election will assume
+ metadata: (object, nullable) - Object containing information about special conditions for the user to be aware about (e.g: cancelled elections, voter id pilot). (details TBC)
+ cancelled: `false` (boolean) - True if this ballot has been cancelled
+ cancellation_reason: `null` (CancellationReason, nullable) - If a ballot has been cancelled, this key may hold a codified reason for that ballot's cancellation
+ `replaced_by`: (string, nullable) - If a ballot has been cancelled (cancelled = true) and rescheduled for a later date, this key will hold the ballot_paper_id of the ballot that replaces it.
+ replaces: (string, nullable) - If this ballot replaces another cancelled ballot, this key will hold the ballot_paper_id of the ballot that it replaces.
+ `election_id`: `local.cardiff.2017-05-04` (string) - Identifier for this ballot's parent election group
Expand Down
14 changes: 12 additions & 2 deletions ec_api/apps/api_docs/blueprints/notes.apibp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,18 @@ information about the pilots.

Sometimes a scheduled poll may be cancelled. This is usuaully either because
the election is uncontested or due to death of a candidate.
API responses for a postcode or address in an authority where identification
is required will include this information in the `notifications` array. e.g:

When a single ballot is cancelled, a `cancellation_reason` will be added to the response. The values are:

* `NO_CANDIDATES`: No candidates
* `EQUAL_CANDIDATES`: Equal candidates to contested seats
* `UNDER_CONTESTED`: Fewer candidates than seats
* `CANDIDATE_DEATH`: Death of a candidate

The fact the election is cancelled _must_ be presented to the user, but it's up to consumers to define if or how the
reason for the cancellation is presented.

If all elections for a query are cancelled we will add a notification in the `notification` array (see above), e.g:

<pre><code>{
...
Expand Down

0 comments on commit f71e1ab

Please sign in to comment.