Skip to content

Commit

Permalink
Merge pull request #5 from lafritay/master
Browse files Browse the repository at this point in the history
Changing Enacted and Vetoed to be a DateTime? and adding Enacted and …
  • Loading branch information
babelshift authored Jun 29, 2017
2 parents 1ab41bb + cf29282 commit dcb09b3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 37 deletions.
74 changes: 39 additions & 35 deletions ProPublicaCongressAPI.Contracts/RecentBill.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
using System;

namespace ProPublicaCongressAPI.Contracts
{
public class RecentBill
{
public string BillId { get; set; }

public string BillType { get; set; }

public string BillNumber { get; set; }

public string BillDetailUrl { get; set; }

using System;

namespace ProPublicaCongressAPI.Contracts
{
public class RecentBill
{
public string BillId { get; set; }

public string BillType { get; set; }

public string BillNumber { get; set; }

public string BillDetailUrl { get; set; }

public string BillTitle { get; set; }

public string SponsorId { get; set; }
Expand All @@ -22,32 +22,36 @@ public class RecentBill

public string CongressDotGovUrl { get; set; }

public string GovTrackUrl { get; set; }

public DateTime DateIntroduced { get; set; }

public bool Active { get; set; }

public DateTime? DateHousePassage { get; set; }

public string GovTrackUrl { get; set; }

public DateTime DateIntroduced { get; set; }

public bool Active { get; set; }

public DateTime? DateHousePassage { get; set; }

public DateTime? DateSenatePassage { get; set; }

public DateTime? Enacted { get; set; }

public int CosponsorCount { get; set; }

public DateTime? Vetoed { get; set; }

public int CosponsorCount { get; set; }

public string Committees { get; set; }


public string[] CommitteeCodes { get; set; }

public string[] SubcommitteeCodes { get; set; }

public string PrimarySubject { get; set; }

public DateTime DateLatestMajorAction { get; set; }

public string LatestMajorAction { get; set; }

public string[] SubcommitteeCodes { get; set; }

public string PrimarySubject { get; set; }

public DateTime DateLatestMajorAction { get; set; }

public string LatestMajorAction { get; set; }

public string Summary { get; set; }

public string SummaryShort { get; set; }
}
public string SummaryShort { get; set; }
}
}
4 changes: 2 additions & 2 deletions ProPublicaCongressAPI.Contracts/SpecificBill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class SpecificBill
public bool Active { get; set; }
public DateTime? DateHousePassage { get; set; }
public DateTime? DateSenatePassage { get; set; }
public string Enacted { get; set; }
public string Vetoed { get; set; }
public DateTime? Enacted { get; set; }
public DateTime? Vetoed { get; set; }
public int CosponsorCount { get; set; }
public int WithdrawnCosponsorCount { get; set; }
public string PrimarySubject { get; set; }
Expand Down
8 changes: 8 additions & 0 deletions ProPublicaCongressAPI/AutoMapperConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ public static void Initialize()
x.CreateMap<InternalModels.RecentBill, Contracts.RecentBill>()
.ForMember(dest => dest.DateIntroduced,
opts => opts.ResolveUsing<DateTimeResolver, string>(s => s.DateIntroduced))
.ForMember(dest => dest.Enacted,
opts => opts.ResolveUsing<NullableDateTimeResolver, string>(s => s.Enacted))
.ForMember(dest => dest.Vetoed,
opts => opts.ResolveUsing<NullableDateTimeResolver, string>(s => s.Vetoed))
.ForMember(dest => dest.DateLatestMajorAction,
opts => opts.ResolveUsing<DateTimeResolver, string>(s => s.DateLatestMajorAction));
x.CreateMap<InternalModels.RecentBillsContainer, Contracts.RecentBillsContainer>();
Expand Down Expand Up @@ -116,6 +120,10 @@ public static void Initialize()
opts => opts.ResolveUsing<NullableDateTimeResolver, string>(s => s.DateHousePassageVote))
.ForMember(dest => dest.DateSenatePassageVote,
opts => opts.ResolveUsing<NullableDateTimeResolver, string>(s => s.DateSenatePassageVote))
.ForMember(dest => dest.Enacted,
opts => opts.ResolveUsing<NullableDateTimeResolver, string>(s => s.Enacted))
.ForMember(dest => dest.Vetoed,
opts => opts.ResolveUsing<NullableDateTimeResolver, string>(s => s.Vetoed))
.ForMember(dest => dest.DateLatestMajorAction,
opts => opts.ResolveUsing<DateTimeResolver, string>(s => s.DateLatestMajorAction));
Expand Down

0 comments on commit dcb09b3

Please sign in to comment.