Added Invite, Notification and Activity
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using static PostFundManagement.Domain.Extensions.Constants;
|
||||
|
||||
namespace PostFundManagement.Domain.Configuration;
|
||||
|
||||
public sealed class Notification : IEntityTypeConfiguration<Entities.Notification>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Entities.Notification> builder)
|
||||
{
|
||||
builder.ToTable(nameof(Entities.Notification).Pluralize());
|
||||
|
||||
builder.HasKey(pk => pk.Id);
|
||||
builder.Property(f => f.CreatedAt).IsRequired().HasDefaultValueSql("now()");
|
||||
builder.Property(f => f.UpdatedAt).IsRequired(false);
|
||||
builder.Property(f => f.SentAt).IsRequired(false);
|
||||
builder.Property(f => f.Recipient).IsRequired();
|
||||
builder.Property(f => f.OrganisationId).IsRequired();
|
||||
builder.Property(f => f.Platform).IsRequired().HasConversion<int>().HasDefaultValueSql("1");
|
||||
builder.Property(f => f.Status).IsRequired().HasConversion<int>().HasDefaultValueSql("1");
|
||||
builder.Property(f => f.Subject).IsRequired(false).HasMaxLength(LabelLength);
|
||||
builder.Property(f => f.Message).IsRequired().HasMaxLength(LargeTextLength);
|
||||
builder.Property(f => f.Destination).IsRequired().HasMaxLength(LabelLength);
|
||||
builder.Property(f => f.Error).IsRequired(false);
|
||||
|
||||
builder.HasOne(f => f.Organisation)
|
||||
.WithMany()
|
||||
.HasForeignKey(fk => fk.OrganisationId)
|
||||
.IsRequired()
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
builder.HasOne(f => f.RecipientUser)
|
||||
.WithMany()
|
||||
.HasForeignKey(fk => fk.Recipient)
|
||||
.IsRequired()
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user