Adding Flags API

This commit is contained in:
2026-04-07 15:30:40 -07:00
parent 7b15086fe5
commit 0ba076b650
78 changed files with 3862 additions and 81 deletions

View File

@@ -0,0 +1,30 @@
using MicCheck.Api.Organizations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace MicCheck.Api.Data.Configurations;
public class OrganizationConfiguration : IEntityTypeConfiguration<Organization>
{
public void Configure(EntityTypeBuilder<Organization> builder)
{
builder.HasKey(o => o.Id);
builder.Property(o => o.Name).HasMaxLength(200).IsRequired();
builder.Property(o => o.CreatedAt).IsRequired();
builder.HasMany(o => o.Members)
.WithOne()
.HasForeignKey(ou => ou.OrganizationId)
.OnDelete(DeleteBehavior.Cascade);
builder.HasMany(o => o.ApiKeys)
.WithOne()
.HasForeignKey(k => k.OrganizationId)
.OnDelete(DeleteBehavior.Cascade);
builder.HasMany(o => o.Projects)
.WithOne()
.HasForeignKey(p => p.OrganizationId)
.OnDelete(DeleteBehavior.Cascade);
}
}