using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using NetTopologySuite.Geometries; namespace labdb.Models; public record LabId : EntityIdBase; public class Lab : EntityBase { public string Name { get; set; } = ""; public string? Website { get; set; } public string? Phone { get; set; } public string? Email { get; set; } public string? AddressLine1 { get; set; } public string? AddressLine2 { get; set; } public string? AddressPostcode { get; set; } public string? AddressCity { get; set; } public CountryId CountryId { get; set; } = null!; public Country Country { get; set; } = null!; public Point? Location { get; set; } public bool RequiresAppointment { get; set; } public bool SelfDraw { get; set; } public decimal BasicFee { get; set; } public decimal DrawFee { get; set; } public string? Notes { get; set; } public List TestOffers { get; set; } = new(); } public class LabConfiguration : EntityBaseConfiguration { public override void Configure(EntityTypeBuilder builder) { base.Configure(builder); builder.HasIndex(x => x.Name, "name"); builder.HasIndex(x => x.Name, "name_trgm").HasMethod("gin").HasOperators("gin_trgm_ops"); builder.HasIndex(x => x.AddressPostcode); builder.HasIndex(x => x.RequiresAppointment); builder.HasIndex(x => x.SelfDraw); builder.HasIndex(x => x.BasicFee); builder.HasIndex(x => x.DrawFee); } }