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

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 货币信息
    /// </summary>
    public class Currency
    {
        /// <summary>
        /// 数据ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [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(10)")]
        public string CurrencyCode { get; set; }= string.Empty;

        /// <summary>
        /// 本地显示
        /// </summary>
        [Column(TypeName = "varchar(15)")]
        public string DisplayLocale { get; set;} = string.Empty;

        /// <summary>
        /// 货币符号
        /// </summary>
        [Column(TypeName = "varchar(8)")]
        public string Symbolic { get; set; } = string.Empty;

        /// <summary>
        /// 数字自定义格式化
        /// </summary>
        [Column(TypeName = "varchar(20)")]
        public string CustomFormatting { get; set; } = string.Empty;

        /// <summary>
        /// 兑换汇率
        /// </summary>
        [Column(TypeName = "decimal(16, 4)")]
        public decimal Rate { get; set; }

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

        /// <summary>
        /// 是否显示
        /// </summary>
        public bool EnableDisplay { get; set; }

        /// <summary>
        /// 启用支付
        /// </summary>
        public bool EnablePay { get; set; }

        /// <summary>
        /// 是否可用
        /// </summary>

        public bool Enabled { get; set; }


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

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