Skip to content

Commit

Permalink
Merge pull request #11 from lafritay/taylor/bills
Browse files Browse the repository at this point in the history
Adding the VotByDateBill data to a vote
  • Loading branch information
babelshift authored Aug 5, 2017
2 parents b30340f + 9d8c263 commit 5f218a0
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 4 deletions.
16 changes: 14 additions & 2 deletions ProPublicaCongressAPI.Contracts/VoteByDate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -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; }
Expand Down
17 changes: 17 additions & 0 deletions ProPublicaCongressAPI.Contracts/VoteByDateBill.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
1 change: 1 addition & 0 deletions ProPublicaCongressAPI/AutoMapperConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static void Initialize()
{
return CreateDateTimeFromDateAndTime(source.DateVoted, source.TimeVoted);
}));
x.CreateMap<InternalModels.VoteByDateBill, Contracts.VoteByDateBill>();
x.CreateMap<InternalModels.VoteByDateContainer, Contracts.VoteByDateContainer>();

x.CreateMap<InternalModels.SenateNominationVote, Contracts.SenateNominationVote>()
Expand Down
22 changes: 20 additions & 2 deletions ProPublicaCongressAPI/InternalModels/VoteByDate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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; }

Expand Down
22 changes: 22 additions & 0 deletions ProPublicaCongressAPI/InternalModels/VoteByDateBill.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}

0 comments on commit 5f218a0

Please sign in to comment.