diff --git a/src/Fusion.Summary.Api/Database/Models/DbProject.cs b/src/Fusion.Summary.Api/Database/Models/DbProject.cs new file mode 100644 index 000000000..88fa368ee --- /dev/null +++ b/src/Fusion.Summary.Api/Database/Models/DbProject.cs @@ -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(project => + { + project.ToTable("Projects"); + project.HasKey(p => p.Id); + project.HasIndex(p => p.OrgProjectExternalId).IsUnique(); + }); + } +} \ No newline at end of file diff --git a/src/Fusion.Summary.Api/Database/Models/DbWeeklyTaskOwnerReport.cs b/src/Fusion.Summary.Api/Database/Models/DbWeeklyTaskOwnerReport.cs new file mode 100644 index 000000000..47c743a0c --- /dev/null +++ b/src/Fusion.Summary.Api/Database/Models/DbWeeklyTaskOwnerReport.cs @@ -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(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 +} \ No newline at end of file