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 agenda
///
public class SectionAgenda : Section
{
[Required]
[Column(TypeName = "jsonb")]
public List resourceIds { get; set; } // All json files for all languages
public MapProvider? mapProvider { get; set; } // Default = Google
public AgendaDTO ToDTO()
{
return new AgendaDTO()
{
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,
resourceIds = resourceIds.OrderBy(t => t.Language).Select(l => l.ToDTO()).ToList(),
mapProvider = mapProvider
};
}
}
}