From 9d8c263450333c2b4d56e94b4a071250e9e0065b Mon Sep 17 00:00:00 2001 From: Taylor Lafrinere Date: Sat, 5 Aug 2017 09:32:13 -0400 Subject: [PATCH] Adding the VotByDateBill data to a vote --- ProPublicaCongressAPI.Contracts/VoteByDate.cs | 16 ++++++++++++-- .../VoteByDateBill.cs | 17 ++++++++++++++ .../AutoMapperConfiguration.cs | 1 + .../InternalModels/VoteByDate.cs | 22 +++++++++++++++++-- .../InternalModels/VoteByDateBill.cs | 22 +++++++++++++++++++ 5 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 ProPublicaCongressAPI.Contracts/VoteByDateBill.cs create mode 100644 ProPublicaCongressAPI/InternalModels/VoteByDateBill.cs diff --git a/ProPublicaCongressAPI.Contracts/VoteByDate.cs b/ProPublicaCongressAPI.Contracts/VoteByDate.cs index 82c20b2..6db3cb5 100644 --- a/ProPublicaCongressAPI.Contracts/VoteByDate.cs +++ b/ProPublicaCongressAPI.Contracts/VoteByDate.cs @@ -11,9 +11,13 @@ public class VoteByDate public int RollCallNumber { get; set; } - public string VoteDetailUrl { get; set; } + public string Source { get; set; } + + public string Url { get; set; } - public string BillNumber { get; set; } + public string VoteDetailUrl { get; set; } + + public VoteByDateBill Bill { get; set; } public string Question { get; set; } @@ -23,6 +27,14 @@ public class VoteByDate public DateTime DateTimeVoted { get; set; } + public string TieBreaker { get; set; } + + public string TieBreakerVote { get; set; } + + public string DocumentNumber { get; set; } + + public string DocumentTitle { get; set; } + public string Result { get; set; } public RollCallVoteSummaryDemocratic DemocraticVoteSummary { get; set; } diff --git a/ProPublicaCongressAPI.Contracts/VoteByDateBill.cs b/ProPublicaCongressAPI.Contracts/VoteByDateBill.cs new file mode 100644 index 0000000..89d1833 --- /dev/null +++ b/ProPublicaCongressAPI.Contracts/VoteByDateBill.cs @@ -0,0 +1,17 @@ +using Newtonsoft.Json; + +namespace ProPublicaCongressAPI.Contracts +{ + public class VoteByDateBill + { + public string BillId { get; set; } + + public string BillNumber { get; set; } + + public string BillTitle { get; set; } + + public string ApiUrl { get; set; } + + public string LatestAction { get; set; } + } +} \ No newline at end of file diff --git a/ProPublicaCongressAPI/AutoMapperConfiguration.cs b/ProPublicaCongressAPI/AutoMapperConfiguration.cs index 219952a..e9da056 100644 --- a/ProPublicaCongressAPI/AutoMapperConfiguration.cs +++ b/ProPublicaCongressAPI/AutoMapperConfiguration.cs @@ -75,6 +75,7 @@ public static void Initialize() { return CreateDateTimeFromDateAndTime(source.DateVoted, source.TimeVoted); })); + x.CreateMap(); x.CreateMap(); x.CreateMap() diff --git a/ProPublicaCongressAPI/InternalModels/VoteByDate.cs b/ProPublicaCongressAPI/InternalModels/VoteByDate.cs index ff87694..7dc4d62 100644 --- a/ProPublicaCongressAPI/InternalModels/VoteByDate.cs +++ b/ProPublicaCongressAPI/InternalModels/VoteByDate.cs @@ -14,11 +14,17 @@ internal class VoteByDate [JsonProperty("roll_call")] public int RollCallNumber { get; set; } + [JsonProperty("source")] + public string Source { get; set; } + + [JsonProperty("url")] + public string Url { get; set; } + [JsonProperty("vote_uri")] public string VoteDetailUrl { get; set; } - [JsonProperty("bill_number")] - public string BillNumber { get; set; } + [JsonProperty("bill")] + public VoteByDateBill Bill { get; set; } [JsonProperty("question")] public string Question { get; set; } @@ -35,6 +41,18 @@ internal class VoteByDate [JsonProperty("time")] public string TimeVoted { get; set; } + [JsonProperty("tie_breaker")] + public string TieBreaker { get; set; } + + [JsonProperty("tie_breaker_vote")] + public string TieBreakerVote { get; set; } + + [JsonProperty("document_number")] + public string DocumentNumber { get; set; } + + [JsonProperty("document_title")] + public string DocumentTitle { get; set; } + [JsonProperty("result")] public string Result { get; set; } diff --git a/ProPublicaCongressAPI/InternalModels/VoteByDateBill.cs b/ProPublicaCongressAPI/InternalModels/VoteByDateBill.cs new file mode 100644 index 0000000..ad85cc7 --- /dev/null +++ b/ProPublicaCongressAPI/InternalModels/VoteByDateBill.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; + +namespace ProPublicaCongressAPI.InternalModels +{ + internal class VoteByDateBill + { + [JsonProperty("bill_id")] + public string BillId { get; set; } + + [JsonProperty("number")] + public string BillNumber { get; set; } + + [JsonProperty("title")] + public string BillTitle { get; set; } + + [JsonProperty("api_uri")] + public string ApiUrl { get; set; } + + [JsonProperty("latest_action")] + public string LatestAction { get; set; } + } +} \ No newline at end of file