using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 语言
    /// </summary>
    [Table("Languages")]
    public class Language
    {
        /// <summary>
        /// 数据ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 语言名称
        /// </summary>
        [Column(TypeName = "varchar(50)")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 语言标题
        /// </summary>
        [Column(TypeName = "varchar(50)")]
        public string Title { get; set; } = string.Empty;

        /// <summary>
        /// 语言名称
        /// </summary>
        [Column(TypeName = "varchar(25)")]
        public string Culture { get; set; } = string.Empty;

        /// <summary>
        /// 国旗
        /// </summary>
        [Column(TypeName = "varchar(255)")]
        public string FlagImage { get; set; } = string.Empty;

        /// <summary>
        /// 排序
        /// </summary>
        public int DisplayOrder { get; set; }

        /// <summary>
        /// 是否可用，系统面
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// 多语言资源的版本，可以是时间戳或哈希
        /// </summary>
        [Column(TypeName = "varchar(25)")]
        public string ResourceVersion { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime CreateTime { get; set; } = DateTime.UtcNow;

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime? UpdateTime { get; set; }
    }
}
