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,27 @@
namespace Socialize.Modules.Notifications.Data;
public static class NotificationModelConfiguration
{
public static ModelBuilder ConfigureNotificationsModule(this ModelBuilder modelBuilder)
{
modelBuilder.Entity<NotificationEvent>(notificationEvent =>
{
notificationEvent.ToTable("NotificationEvents");
notificationEvent.HasKey(x => x.Id);
notificationEvent.Property(x => x.EventType).HasMaxLength(128).IsRequired();
notificationEvent.Property(x => x.EntityType).HasMaxLength(128).IsRequired();
notificationEvent.Property(x => x.Message).HasMaxLength(1024).IsRequired();
notificationEvent.Property(x => x.RecipientEmail).HasMaxLength(256);
notificationEvent.Property(x => x.MetadataJson).HasMaxLength(4000);
notificationEvent.Property(x => x.CreatedAt)
.ValueGeneratedOnAdd()
.HasDefaultValueSql("CURRENT_TIMESTAMP");
notificationEvent.HasIndex(x => x.WorkspaceId);
notificationEvent.HasIndex(x => x.ContentItemId);
notificationEvent.HasIndex(x => x.RecipientUserId);
notificationEvent.HasIndex(x => x.CreatedAt);
});
return modelBuilder;
}
}