85 lines
2.8 KiB
C#

using ManagerService.DTOs;
using NetTopologySuite.Geometries;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ManagerService.Data.SubSection
{
/// <summary>
/// Section event
/// </summary>
public class SectionEvent : Section
{
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public List<ProgrammeBlock> Programme { get; set; } = new();
[Column(TypeName = "jsonb")]
public List<string> ParcoursIds { get; set; } = new(); // Liens vers GeoPoints spécifiques
public class ProgrammeBlock
{
[Key]
public string Id { get; set; }
[Column(TypeName = "jsonb")]
public List<TranslationDTO> Title { get; set; }
[Column(TypeName = "jsonb")]
public List<TranslationDTO> Description { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public List<MapAnnotation> MapAnnotations { get; set; }
}
public class MapAnnotation
{
[Key]
public string Id { get; set; }
[Column(TypeName = "jsonb")]
public List<TranslationDTO> Type { get; set; } // "first_aid", "parking", etc.
[Column(TypeName = "jsonb")]
public List<TranslationDTO> Label { get; set; }
public GeometryType GeometryType { get; set; }
public Geometry Geometry { get; set; } // Peut être Point, LineString, Polygon
public string PolyColor { get; set; }
public string Icon { get; set; } // icon material if point
public ResourceDTO IconResourceDTO { get; set; } // Icon if point
}
public enum GeometryType
{
Point,
Polyline,
Circle,
Polygon
}
/*public EventDTO ToDTO()
{
return new EventDTO()
{
id = Id,
label = Label,
title = Title.ToList(),
description = Description.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,
};
}*/
}
}