using Manager.DTOs; using ManagerService.DTOs; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; namespace ManagerService.Data.SubSection { /// /// Section map /// public class SectionMap : Section { public int MapZoom { get; set; } // Default = 18 public MapTypeApp? MapMapType { get; set; } // Default = Hybrid for Google public MapTypeMapBox? MapTypeMapbox { get; set; } // Default = standard for MapBox public MapProvider? MapMapProvider { get; set; } // Default = Google public List MapPoints { get; set; } public string MapResourceId { get; set; } public Resource MapResource { get; set; } // Icon public List MapCategories { get; set; } public string MapCenterLatitude { get; set; } // Center on public string MapCenterLongitude { get; set; } // Center on public MapDTO ToDTO() { return new MapDTO() { id = Id, label = Label, title = Title.OrderBy(t => t.Language).Select(l => l.ToDTO()).ToList(), description = Description.OrderBy(d => d.Language).Select(l => l.ToDTO()).ToList(), order = Order, type = Type, imageId = ImageId, imageSource = ImageSource, configurationId = ConfigurationId, isSubSection = IsSubSection, parentId = ParentId, dateCreation = DateCreation, instanceId = InstanceId, isBeacon = IsBeacon, beaconId = BeaconId, latitude = Latitude, longitude = Longitude, meterZoneGPS = MeterZoneGPS, zoom = MapZoom, mapType = MapMapType, mapTypeMapbox = MapTypeMapbox, mapProvider = MapMapProvider, //points = Points.Select(p => p.ToDTO()).ToList(), // TODO iconResourceId = MapResourceId, categories = MapCategories.Select(c => c.ToDTO()).ToList(), centerLatitude = MapCenterLatitude, centerLongitude = MapCenterLongitude }; } } public class GeoPoint { [Required] public int? Id { get; set; } [Required] [Column(TypeName = "jsonb")] public List Title { get; set; } [Required] [Column(TypeName = "jsonb")] public List Description { get; set; } //TODO [Required] [Column(TypeName = "jsonb")] public List Contents { get; set; } // Contentsgeopoint public int? CategorieId { get; set; } public string Latitude { get; set; } public string Longitude { get; set; } public string ImageResourceId { get; set; } public string ImageUrl { get; set; } [Required] [Column(TypeName = "jsonb")] public List Schedules { get; set; } [Required] [Column(TypeName = "jsonb")] public List Prices { get; set; } [Required] [Column(TypeName = "jsonb")] public List Phone { get; set; } [Required] [Column(TypeName = "jsonb")] public List Email { get; set; } [Required] [Column(TypeName = "jsonb")] public List Site { get; set; } } }