-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.http
86 lines (64 loc) · 1.68 KB
/
app.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@electionId=af555808-063a-4eeb-9eb2-77090a2bff42
// *** Migrations ***
POST {{migrationurl}}/sql/migrate
###
POST {{migrationurl}}/sql/regenerate/{{voters}}
###
POST {{migrationurl}}/sql/reset-votes
###
// *** API ***
// Get elections
GET {{apiurl}}/election
###
// Get parties for election
GET {{apiurl}}/election/{{electionId}}/party
###
// Vote for Party 01 and candidate 01
POST {{apiurl}}/election/{{electionId}}/vote
Content-Type: application/json
x-voter-id: 4712
x-election-district-id: 4713
{
"partyId": "77948df2-a387-5efd-936a-9324a753c6e1",
"candidateId": "2996fe75-3a54-5bc8-b00b-3701cb494331"
}
###
// Vote with invalid voter id
POST {{apiurl}}/election/{{electionId}}/vote
Content-Type: application/json
x-voter-id: 20000000
x-election-district-id: 4713
{
"partyId": "77948df2-a387-5efd-936a-9324a753c6e1",
"candidateId": "2996fe75-3a54-5bc8-b00b-3701cb494331"
}
###
// Vote with invalid election district id
POST {{apiurl}}/election/{{electionId}}/vote
Content-Type: application/json
x-voter-id: 4711
x-election-district-id: 4711
{
"partyId": "77948df2-a387-5efd-936a-9324a753c6e1",
"candidateId": "2996fe75-3a54-5bc8-b00b-3701cb494331"
}
###
// Vote for invalid party
POST {{apiurl}}/election/{{electionId}}/vote
Content-Type: application/json
x-voter-id: 4713
x-election-district-id: 4714
{
"partyId": "77948df2-a387-5efd-936a-9324a753c6e2",
"candidateId": "2996fe75-3a54-5bc8-b00b-3701cb494331"
}
###
// Vote for invalid candidate
POST {{apiurl}}/election/{{electionId}}/vote
Content-Type: application/json
x-voter-id: 4713
x-election-district-id: 4714
{
"partyId": "77948df2-a387-5efd-936a-9324a753c6e1",
"candidateId": "2996fe75-3a54-5bc8-b00b-3701cb494332"
}