using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace NostrStreamer.Database.Configuration; public class PaymentsConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(a => a.PaymentHash); builder.Property(a => a.Invoice); builder.Property(a => a.IsPaid) .IsRequired(); builder.Property(a => a.Amount) .IsRequired(); builder.Property(a => a.Created) .IsRequired(); builder.Property(a => a.Nostr); builder.Property(a => a.Type) .IsRequired(); builder.Property(a => a.Fee) .IsRequired(); builder.HasOne(a => a.User) .WithMany(a => a.Payments) .HasForeignKey(a => a.PubKey); } }