using Govor.Domain.Models.Users; using Govor.Domain.Models.Users.Crypto; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Govor.Domain.Configurations; public class E2eeRecoveryVaultConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(v => v.UserId); var b = builder; b.Property(v => v.Revision).IsConcurrencyToken(); b.Property(v => v.IdentityKey).HasMaxLength(200); b.Property(v => v.Signature).HasMaxLength(100); b.Property(v => v.Ciphertext).HasMaxLength(4_000_000); b.HasOne().WithOne().HasForeignKey(v => v.UserId).OnDelete(DeleteBehavior.Cascade); } }