Skip to content

Commit ec63ffd

Browse files
AddressXceptionkeithrfung
authored andcommitted
Fix/update nuget (#36)
* update nuget package. add logging around data file load * update contest type contract serializer * fix election.json * Fix sample data * fix spelling error
1 parent 98af9c8 commit ec63ffd

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

ElectionGuard.WebAPI/Controllers/ElectionGuardController.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public ElectionGuardController(ILogger<ElectionGuardController> logger, IElectio
4949
_electionMapper = electionMapper;
5050

5151
_exportPath = Path.Combine(_config.GetDataDirectory(), "election_results");
52-
logger.LogInformation($"DATA: resolved at: {_exportPath}");
52+
logger.LogInformation($"DATA: resolved at: {_config.GetDataDirectory()}");
5353

5454
// try to load the election config files from the file system
5555
var election = _config.GetElection();
@@ -60,13 +60,21 @@ public ElectionGuardController(ILogger<ElectionGuardController> logger, IElectio
6060
_electionMap = _electionMapper.GetElectionMap(_election);
6161

6262
}
63+
else
64+
{
65+
logger.LogInformation("ElectionController: Could not find election.json");
66+
}
6367

6468
var electionguardConfig = _config.getElectionGuardConfig();
6569
if (electionguardConfig != null)
6670
{
6771
logger.LogInformation("ElectionController: Found ElectionGuard Config");
6872
_electionGuardConfig = electionguardConfig;
6973
}
74+
else
75+
{
76+
logger.LogInformation("ElectionController: Could not find election.config.json");
77+
}
7078

7179
var now = DateTime.Now;
7280

@@ -325,7 +333,7 @@ public ActionResult<LoadBallotsResponse[]> LoadBallots(LoadBallotsRequest reques
325333
electionGuardConfig.NumberOfSelections,
326334
Path.Combine(
327335
importPath,
328-
request.ImportFileName
336+
request.ImportFileName
329337
)
330338
);
331339

ElectionGuard.WebAPI/ElectionGuard.WebAPI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="ElectionGuard.SDK" Version="1.0.3-v56e110d" />
10+
<PackageReference Include="ElectionGuard.SDK" Version="1.0.4-v4c73ce2" />
1111
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
1212
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="3.0.0" />
1313
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.5" />

VotingWorks.Ballot/ContestType.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
namespace VotingWorks.Ballot
1+
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Converters;
3+
4+
namespace VotingWorks.Ballot
25
{
6+
[JsonConverter(typeof(StringEnumConverter))]
37
public enum ContestType
48
{
59
Unknown,

data/election.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"county": {
2525
"id": "1",
26-
"name": "Boulder County"
26+
"name": "Franklin County"
2727
},
2828
"parties": [
2929
{
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"id": "3",
62-
"name": "Milton School District"
62+
"name": "Franklin School District"
6363
}
6464
],
6565
"contests": [
@@ -87,15 +87,15 @@
8787
"districtId": "1",
8888
"section": "Judicial",
8989
"title": "Justice of the Supreme Court",
90-
"type": 1
90+
"type": "Candidate"
9191
},
9292
{
9393
"description": "Should the State of Hamilton purchase, from the State of Michigan, the Upper Peninsula, for the purchase price of $1 Billion?",
9494
"id": "referendum-michigan-up",
9595
"districtId": "2",
9696
"section": "Referenda",
9797
"title": "Proposition M: The Michigan Question",
98-
"type": 2
98+
"type": "YesNo"
9999
},
100100
{
101101
"seats": 2,
@@ -129,9 +129,9 @@
129129
"allowWriteIns": true,
130130
"id": "milton-school-board",
131131
"districtId": "3",
132-
"section": "Milton School District",
132+
"section": "Franklin School District",
133133
"title": "School Board Member",
134-
"type": 1
134+
"type": "Candidate"
135135
}
136136
],
137137
"date": "February 6th, 2020",

0 commit comments

Comments
 (0)