Skip to content

Commit

Permalink
Merge branch 'master' into chore/summary/add-azure-sql-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathanio123 authored Aug 19, 2024
2 parents ba1db16 + 41ee148 commit 5f45b0c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.

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
Expand Up @@ -40,8 +40,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
AverageTimeToHandleRequests = table.Column<string>(type: "nvarchar(max)", nullable: false),
AllocationChangesAwaitingTaskOwnerAction = table.Column<string>(type: "nvarchar(max)", nullable: false),
ProjectChangesAffectingNextThreeMonths = table.Column<string>(type: "nvarchar(max)", nullable: false),
EndingPositions = table.Column<string>(type: "nvarchar(max)", nullable: true),
PersonnelMoreThan100PercentFTEs = table.Column<string>(type: "nvarchar(max)", nullable: true)
PersonnelMoreThan100PercentFTE = table.Column<string>(type: "nvarchar(max)", nullable: true),
PositionsEnding = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b1.ToTable("WeeklySummaryReports");

b1.ToJson("PersonnelMoreThan100PercentFTEs");
b1.ToJson("PositionsEnding");

b1.WithOwner()
.HasForeignKey("DbWeeklySummaryReportId");
Expand All @@ -150,7 +150,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b1.ToTable("WeeklySummaryReports");

b1.ToJson("EndingPositions");
b1.ToJson("PersonnelMoreThan100PercentFTE");

b1.WithOwner()
.HasForeignKey("DbWeeklySummaryReportId");
Expand Down
11 changes: 5 additions & 6 deletions src/Fusion.Summary.Api/Database/Models/DbWeeklySummaryReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,17 @@ internal static void OnModelCreating(ModelBuilder modelBuilder)

report.Property(r => r.Period)
// Strip time from date and retrieve as UTC
.HasConversion(d => d.Date,
d => DateTime.SpecifyKind(d, DateTimeKind.Utc));
.HasConversion(d => d.Date, d => DateTime.SpecifyKind(d, DateTimeKind.Utc));


report.HasIndex(r => new { r.DepartmentSapId, r.Period })
.IsUnique();

report.OwnsMany(r => r.PositionsEnding, pe
=> pe.ToJson("PersonnelMoreThan100PercentFTEs"));
report.OwnsMany(r => r.PositionsEnding,
pe => pe.ToJson());

report.OwnsMany(r => r.PersonnelMoreThan100PercentFTE, pm
=> pm.ToJson("EndingPositions"));
report.OwnsMany(r => r.PersonnelMoreThan100PercentFTE,
pm => pm.ToJson());


report.HasOne(r => r.Department)
Expand Down

0 comments on commit 5f45b0c

Please sign in to comment.