Skip to content

Commit

Permalink
Merge pull request #7 from lafritay/taylor/members
Browse files Browse the repository at this point in the history
Adding new properties to the Member and MemberSummary objects
  • Loading branch information
babelshift authored Jul 4, 2017
2 parents 565de07 + d24a435 commit f2b85ba
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 13 deletions.
14 changes: 10 additions & 4 deletions ProPublicaCongressAPI.Contracts/Member.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ namespace ProPublicaCongressAPI.Contracts
{
public class Member
{
public string MemberId { get; set; }

public string MemberId { get; set; }

[Obsolete("This property is no longer returned by the API and should not be used")]
public int ThomasId { get; set; }

public string CrpId { get; set; }

public string FirstName { get; set; }

public string MiddleName { get; set; }
Expand All @@ -34,8 +37,9 @@ public class Member

public string TwitterAccount { get; set; }

public string FacebookAccount { get; set; }

public string FacebookAccount { get; set; }

[Obsolete("This property is no longer returned by the API and should not be used")]
public long? FacebookId { get; set; }

public string YoutubeAccount { get; set; }
Expand All @@ -51,5 +55,7 @@ public class Member
public DateTime MostRecentVoteDate { get; set; }

public IReadOnlyCollection<MemberRole> Roles { get; set; }

public int VotesmartId { get; set; }
}
}
19 changes: 18 additions & 1 deletion ProPublicaCongressAPI.Contracts/MemberSummary.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
using Newtonsoft.Json;

using System;

namespace ProPublicaCongressAPI.Contracts
{
public class MemberSummary
{
public string Id { get; set; }
public string MemberDetailUrl { get; set; }
public string ContactForm { get; set; }
public string CrpId { get; set; }
public int CspanId { get; set; }
public DateTime DateOfBirth { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public string Party { get; set; }
public string TwitterAccount { get; set; }
public string FacebookAccount { get; set; }
[Obsolete("This property is no longer returned by the API and should not be used")]
public long? FacebookId { get; set; }
public string Fax { get; set; }
public string GeoId { get; set; }
public string GoogleEntityId { get; set; }
public string GovTrackId { get; set; }
public int IcpsrId { get; set; }
public string HomeUrl { get; set; }
public string RssUrl { get; set; }
public string HomeDomain { get; set; }
public string DwNominate { get; set; }
public string IdealPoint { get; set; }
public bool InOffice { get; set; }
public string LeadershipRole { get; set; }
public int Seniority { get; set; }
public int NextElection { get; set; }
public string OcdId { get; set; }
public string Office { get; set; }
public string Phone { get; set; }
public int? TotalVotes { get; set; }
public int? MissedVotes { get; set; }
public int? TotalPresent { get; set; }
public string State { get; set; }
public int District { get; set; }
public int VotesmartId { get; set; }
public double PercentageOfVotesMissed { get; set; }
public double PercentageOVotesWithParty { get; set; }
public string YoutubeAccount { get; set; }
}
}
10 changes: 5 additions & 5 deletions ProPublicaCongressAPI/InternalModels/Member.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ internal class Member
[JsonProperty("member_id")]
public string MemberId { get; set; }

[JsonProperty("thomas_id")]
public int ThomasId { get; set; }
[JsonProperty("crp_id")]
public string CrpId { get; set; }

[JsonProperty("first_name")]
public string FirstName { get; set; }
Expand Down Expand Up @@ -51,9 +51,6 @@ internal class Member
[JsonProperty("facebook_account")]
public string FacebookAccount { get; set; }

[JsonProperty("facebook_id")]
public long? FacebookId { get; set; }

[JsonProperty("youtube_account")]
public string YoutubeAccount { get; set; }

Expand All @@ -74,5 +71,8 @@ internal class Member

[JsonProperty("roles")]
public IReadOnlyCollection<MemberRole> Roles { get; set; }

[JsonProperty("votesmart_id")]
public int VotesmartId { get; set; }
}
}
49 changes: 46 additions & 3 deletions ProPublicaCongressAPI/InternalModels/MemberSummary.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Newtonsoft.Json;

using System;

namespace ProPublicaCongressAPI.InternalModels
{
internal class MemberSummary
Expand All @@ -10,6 +11,18 @@ internal class MemberSummary
[JsonProperty("api_uri")]
public string MemberDetailUrl { get; set; }

[JsonProperty("contact_form")]
public string ContactForm { get; set; }

[JsonProperty("crp_id")]
public string CrpId { get; set; }

[JsonProperty("cspan_id")]
public int CspanId { get; set; }

[JsonProperty("date_of_birth")]
public DateTime DateOfBirth { get; set; }

[JsonProperty("first_name")]
public string FirstName { get; set; }

Expand All @@ -28,12 +41,21 @@ internal class MemberSummary
[JsonProperty("facebook_account")]
public string FacebookAccount { get; set; }

[JsonProperty("facebook_id")]
public long? FacebookId { get; set; }
[JsonProperty("fax")]
public string Fax { get; set; }

[JsonProperty("geoid")]
public string GeoId { get; set; }

[JsonProperty("google_entity_id")]
public string GoogleEntityId { get; set; }

[JsonProperty("govtrack_id")]
public string GovTrackId { get; set; }

[JsonProperty("icpsr_id")]
public int IcpsrId { get; set; }

[JsonProperty("url")]
public string HomeUrl { get; set; }

Expand All @@ -49,12 +71,27 @@ internal class MemberSummary
[JsonProperty("ideal_point")]
public string IdealPoint { get; set; }

[JsonProperty("in_office")]
public bool InOffice { get; set; }

[JsonProperty("leadership_role")]
public string LeadershipRole { get; set; }

[JsonProperty("seniority")]
public int Seniority { get; set; }

[JsonProperty("next_election")]
public int NextElection { get; set; }

[JsonProperty("ocd_id")]
public string OcdId { get; set; }

[JsonProperty("office")]
public string Office { get; set; }

[JsonProperty("phone")]
public string Phone { get; set; }

[JsonProperty("total_votes")]
public int? TotalVotes { get; set; }

Expand All @@ -70,10 +107,16 @@ internal class MemberSummary
[JsonProperty("district")]
public int District { get; set; }

[JsonProperty("votesmart_id")]
public int VotesmartId { get; set; }

[JsonProperty("missed_votes_pct")]
public double PercentageOfVotesMissed { get; set; }

[JsonProperty("votes_with_party_pct")]
public double PercentageOVotesWithParty { get; set; }

[JsonProperty("youtube_account")]
public string YoutubeAccount { get; set; }
}
}

0 comments on commit f2b85ba

Please sign in to comment.