Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
don't require ProductiveMeasure on server
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Linden committed Dec 1, 2016
1 parent bdb2828 commit ec4eaa0
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public EmployeeValidator()
RuleFor(e => e.AvgWeeklyHours).NotNull();
RuleFor(e => e.AvgHourlyEarnings).NotNull();
RuleFor(e => e.PrevailingWage).NotNull();
RuleFor(e => e.ProductivityMeasure).NotNull();
RuleFor(e => e.CommensurateWageRate).NotEmpty();
RuleFor(e => e.TotalHours).NotNull();
RuleFor(e => e.WorkAtOtherSite).NotNull();
Expand Down
1 change: 0 additions & 1 deletion DOL.WHD.Section14c.DataAccess/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
modelBuilder.Entity<Employee>().Property(a => a.AvgWeeklyHours).IsRequired();
modelBuilder.Entity<Employee>().Property(a => a.AvgHourlyEarnings).IsRequired();
modelBuilder.Entity<Employee>().Property(a => a.PrevailingWage).IsRequired();
modelBuilder.Entity<Employee>().Property(a => a.ProductivityMeasure).IsRequired();
modelBuilder.Entity<Employee>().Property(a => a.CommensurateWageRate).IsRequired();
modelBuilder.Entity<Employee>().Property(a => a.TotalHours).IsRequired();
modelBuilder.Entity<Employee>().Property(a => a.WorkAtOtherSite).IsRequired();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace DOL.WHD.Section14c.DataAccess.Migrations
{
using System;
using System.Data.Entity.Migrations;

public partial class ProductivityMeasureNotRequired : DbMigration
{
public override void Up()
{
DropForeignKey("dbo.EmployerInfoes", "MailingAddress_Id", "dbo.Addresses");
DropIndex("dbo.EmployerInfoes", new[] { "MailingAddress_Id" });
AddColumn("dbo.EmployerInfoes", "ProvidingFacilitiesDeductionTypeOther", c => c.String());
AlterColumn("dbo.Employees", "ProductivityMeasure", c => c.Double());
DropColumn("dbo.EmployerInfoes", "HasMailingAddress");
DropColumn("dbo.EmployerInfoes", "MailingAddress_Id");
}

public override void Down()
{
AddColumn("dbo.EmployerInfoes", "MailingAddress_Id", c => c.Guid());
AddColumn("dbo.EmployerInfoes", "HasMailingAddress", c => c.Boolean());
AlterColumn("dbo.Employees", "ProductivityMeasure", c => c.Double(nullable: false));
DropColumn("dbo.EmployerInfoes", "ProvidingFacilitiesDeductionTypeOther");
CreateIndex("dbo.EmployerInfoes", "MailingAddress_Id");
AddForeignKey("dbo.EmployerInfoes", "MailingAddress_Id", "dbo.Addresses", "Id");
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public void Should_Require_PrevailingWage()
}

[TestMethod]
public void Should_Require_ProductivityMeasure()
public void Should_Not_Require_ProductivityMeasure()
{
EmployeeValidator.ShouldHaveValidationErrorFor(e => e.ProductivityMeasure, null as double?);
EmployeeValidator.ShouldNotHaveValidationErrorFor(e => e.ProductivityMeasure, null as double?);
EmployeeValidator.ShouldNotHaveValidationErrorFor(e => e.ProductivityMeasure, 15.32);
}

Expand Down

0 comments on commit ec4eaa0

Please sign in to comment.