-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad97ad8
commit 74772ba
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace Fusion.Summary.Api.Database.Models; | ||
|
||
public class DbProject | ||
{ | ||
public required Guid Id { get; set; } | ||
|
||
public required string Name { get; set; } | ||
public required Guid OrgProjectExternalId { get; set; } | ||
|
||
|
||
internal static void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.Entity<DbProject>(project => | ||
{ | ||
project.ToTable("Projects"); | ||
project.HasKey(p => p.Id); | ||
project.HasIndex(p => p.OrgProjectExternalId).IsUnique(); | ||
}); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/Fusion.Summary.Api/Database/Models/DbWeeklyTaskOwnerReport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace Fusion.Summary.Api.Database.Models; | ||
|
||
public class DbWeeklyTaskOwnerReport | ||
{ | ||
public required Guid Id { get; set; } | ||
public required Guid ProjectId { get; set; } | ||
public DbProject? Project { get; set; } | ||
|
||
public required DateTime Period { get; set; } | ||
|
||
internal static void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.Entity<DbWeeklyTaskOwnerReport>(report => | ||
{ | ||
report.ToTable("WeeklyTaskOwnerReports"); | ||
report.HasKey(r => r.Id); | ||
|
||
report.HasOne(r => r.Project) | ||
.WithMany() | ||
.HasForeignKey(r => r.ProjectId) | ||
.OnDelete(DeleteBehavior.Restrict); | ||
}); | ||
} | ||
} | ||
|
||
public class DbAdminAccessExpiring | ||
{ | ||
public required Guid AzureUniqueId { get; set; } | ||
public required string FullName { get; set; } | ||
public required DateTime Expires { get; set; } | ||
} | ||
|
||
public class DbActionsAwaitingTaskOwner | ||
{ | ||
// TODO: Implement | ||
} | ||
|
||
public class DbPositionAllocationsEnding | ||
{ | ||
// TODO: Implement | ||
} | ||
|
||
public class DbTBNPositionsStartingSoon | ||
{ | ||
// TODO: Implement | ||
} |