using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Pf2eModel.Model.Base.Keywords;
using Pf2eModel.Model.Base.Legacy;
using Pf2eModel.Model.Base.Source;
using Pf2eModel.Model.Base.Targets;
using Pf2eModel.Model.Common.I18n;
using Pf2eModel.Model.Enum;
using Pf2eModel.Model.Structure;
namespace Pf2eModel.Model.Base;
///
/// Корневая сущность.
///
public class Entity
{
///
/// Идентификатор сущности.
///
[Key]
[Column(Order = 1)]
public int Id { get; set; }
///
/// Отображаемое имя сущности.
///
[Column(Order = 2)]
[Comment("Отображаемое имя")]
public LocaleString Name { get; set; } = [];
///
/// Тип сущности.
///
[Column(Order = 3)]
[Comment("Тип сущности")]
public EntityType Type { get; set; }
///
/// Часть имени в URL.
///
[Column(Order = 4)]
[MaxLength(Pf2eDbContext.NameLength)]
[Comment("Часть имени в URL")]
public string Slug { get; set; } = null!;
///
/// Изображение сущности.
///
[Column(Order = 5)]
[StringLength(255)]
[Comment("Изображение объекта")]
public string Img { get; set; } = null!;
///
/// Текстовое описание сущности.
///
[Column(Order = 6)]
[Comment("Текстовое описание сущности")]
public string Description { get; set; } = null!;
///
/// Редкость сущности.
///
[Column(Order = 7)]
[Comment("Редкость сущности")]
public EntityRarity Rarity { get; set; } = EntityRarity.Common;
///
/// Флаг, указывающий, что у объекта существует перевод.
///
[Column(Order = 8)]
[Comment("Флаг, указывающий, что у сущности существует перевод")]
public bool? IsTranslated { get; set; } = false;
///
/// Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи.
///
[Column(Order = 9)]
[Comment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи")]
public bool? IsChecked { get; set; } = false;
///
/// Коллекция признаков, связанных с сущностью.
///
public ICollection Traits { get; set; } = [];
///
/// Коллекция ключевых слов, связанных с сущностью.
///
public ICollection Keywords { get; set; } = [];
///
/// Коллекция источников, связанных с сущностью.
///
public ICollection Sources { get; set; } = [];
///
/// Коллекция внешних ссылок, связанных с сущностью.
///
public ICollection Externals { get; set; } = [];
///
/// Коллекция устаревших сущностей.
///
public IEnumerable LegacyEntities { get; set; } = [];
}