refactor: contain backend feature mappings
Some checks failed
Backend CI/CD / build_and_deploy (push) Has been cancelled
Frontend CI/CD / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 01:14:01 -04:00
parent 121757546a
commit 20f8a14bfb
10 changed files with 308 additions and 190 deletions

View File

@@ -0,0 +1,26 @@
namespace Socialize.Modules.Clients.Data;
public static class ClientModelConfiguration
{
public static ModelBuilder ConfigureClientsModule(this ModelBuilder modelBuilder)
{
modelBuilder.Entity<Client>(client =>
{
client.ToTable("Clients");
client.HasKey(x => x.Id);
client.Property(x => x.Name).HasMaxLength(256).IsRequired();
client.Property(x => x.Status).HasMaxLength(64).IsRequired();
client.Property(x => x.PortraitUrl).HasMaxLength(2048);
client.Property(x => x.PrimaryContactName).HasMaxLength(256);
client.Property(x => x.PrimaryContactEmail).HasMaxLength(256);
client.Property(x => x.PrimaryContactPortraitUrl).HasMaxLength(2048);
client.Property(x => x.CreatedAt)
.ValueGeneratedOnAdd()
.HasDefaultValueSql("CURRENT_TIMESTAMP");
client.HasIndex(x => new { x.WorkspaceId, x.Name }).IsUnique();
client.HasIndex(x => x.WorkspaceId);
});
return modelBuilder;
}
}