using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

public class GatewaySyncStateConfiguration : IEntityTypeConfiguration<GatewaySyncState>
{
    public void Configure(EntityTypeBuilder<GatewaySyncState> builder)
    {
        builder.ToTable("gateway_sync_state");
        builder.HasKey(s => s.Id);
        builder.Property(s => s.Id).HasColumnName("id").HasDefaultValueSql("gen_random_uuid()");
        builder.Property(s => s.LastEncounterSyncAt).HasColumnName("last_encounter_sync_at");
        builder.Property(s => s.InitialSyncCompleted)
            .HasColumnName("initial_sync_completed")
            .HasDefaultValue(false);
    }
}
