New Settings entity

This commit is contained in:
Artemy
2025-07-21 17:06:01 +07:00
parent c434ca447c
commit 4054e4046a
4 changed files with 89 additions and 15 deletions
@@ -0,0 +1,23 @@
using Govor.Core.Models.Users;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Govor.Data.Configurations;
public class PrivacyRuleEntityConfiguration : IEntityTypeConfiguration<PrivacyRuleEntity>
{
public void Configure(EntityTypeBuilder<PrivacyRuleEntity> builder)
{
builder.HasKey(r => r.Id);
builder.Property(r => r.OwnerId).IsRequired();
builder.Property(r => r.Area).IsRequired().HasConversion<string>();
builder.Property(r => r.AccessType).IsRequired().HasConversion<string>();
builder.Property(r => r.Whitelist).HasColumnType("jsonb");
builder.Property(r => r.Blacklist).HasColumnType("jsonb");
builder.HasIndex(r => r.OwnerId);
}
}