2025-07-10 16:43:29 +02:00

62 lines
2.0 KiB
C#

using Manager.DTOs;
using ManagerService.DTOs;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ManagerService.Data.SubSection
{
/// <summary>
/// Section article
/// </summary>
public class SectionArticle: Section
{
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationDTO> ArticleContent { get; set; } // Content of article
public bool ArticleIsContentTop { get; set; } // MyVisit - True if content is displayed at top, false otherwise
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationDTO> ArticleAudioIds { get; set; }
public bool ArticleIsReadAudioAuto { get; set; } // MyVisit - True for audio play when open the article / false otherwise
[Required]
[Column(TypeName = "jsonb")]
public List<ContentDTO> ArticleContents { get; set; } // List of picture etc
public ArticleDTO ToDTO()
{
return new ArticleDTO()
{
id = Id,
label = Label,
title = Title,
description = Description,
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,
content = ArticleContent,
isContentTop = ArticleIsContentTop,
audioIds = ArticleAudioIds,
isReadAudioAuto = ArticleIsReadAudioAuto,
contents = ArticleContents,
};
}
}
}