using Lada.Framework.Data.Domains.GoogleMap.PlaceAutocomplete;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Lada.Framework.Data.Mappings.EntityMappings.GoogleMap.PlaceAutocomplete
{
    internal class PlacePredictionMap : IEntityMappingConfiguration<PlacePrediction>
    {
        public void Map(EntityTypeBuilder<PlacePrediction> builder)
        {
            builder.HasKey(o => o.Id);
            builder.Property(o => o.Id).HasDefaultValueSql("NEWID()");
            builder.HasIndex(p => p.PlaceId).IsUnique();
            builder.ToTable("PlacePrediction");
        }
    }
}
