feat(notification-outbox): add Type field to NotificationList
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using ScadaLink.Commons.Types.Enums;
|
||||
|
||||
namespace ScadaLink.Commons.Entities.Notifications;
|
||||
|
||||
public class NotificationList
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public NotificationType Type { get; set; } = NotificationType.Email;
|
||||
public ICollection<NotificationRecipient> Recipients { get; set; } = new List<NotificationRecipient>();
|
||||
|
||||
public NotificationList(string name)
|
||||
|
||||
@@ -14,6 +14,11 @@ public class NotificationListConfiguration : IEntityTypeConfiguration<Notificati
|
||||
.IsRequired()
|
||||
.HasMaxLength(200);
|
||||
|
||||
builder.Property(n => n.Type)
|
||||
.HasConversion<string>()
|
||||
.HasMaxLength(32)
|
||||
.IsRequired();
|
||||
|
||||
builder.HasMany(n => n.Recipients)
|
||||
.WithOne()
|
||||
.HasForeignKey(r => r.NotificationListId)
|
||||
|
||||
Reference in New Issue
Block a user