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

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 产品变更日志
    /// </summary>
    [Table("ProductChangeLogs")]
    public class ProductChangeLog
    {
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 产品ID
        /// </summary>
        public long ProductId { get; set; }

        /// <summary>
        /// 归属公司ID
        /// </summary>
        public long CorporationId { get; set; }

        /// <summary>
        /// 变更类型，新增，编辑，删除，恢复
        /// </summary>
        public int ChangeType { get; set; }

        /// <summary>
        /// 操作用户ID
        /// </summary>
        public long? Operator { get; set; }

        /// <summary>
        /// 操作账号
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Username { get; set; } = string.Empty;

        /// <summary>
        /// 日志操作方
        /// </summary>
        public int OperatorParty { get; set; }

        /// <summary>
        /// 操作摘要
        /// </summary>
        [Column(TypeName = "varchar(256)")]
        public string Summary { get; set; } = string.Empty;

        /// <summary>
        /// 操作内容
        /// </summary>
        [Column(TypeName = "text")]
        public string Details { get; set; } = string.Empty;

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

    }
}
