using APT.Infrastructure.Core;
using APT.MS.Domain.Enums;
using System;
using System.ComponentModel;

namespace APT.MS.Domain.Entities.CM
{
    /// <summary>
    /// 物资操作明细
    /// </summary>
    [Description("物资操作明细")]
    public class T_CM_MATERIAL_OPERATE_DETAIL : MesEntityBase
    {
        /// <summary>
        /// 操作单
        /// </summary>
        [Description("操作单")]
        [DataFieldForeignKey("Nav_Record", "Nav_listDetail")]
        public Guid RECORD_ID { get; set; }

        /// <summary>
        /// 操作单
        /// </summary>
        [Description("操作单")]
        public virtual T_CM_MATERIAL_OPERATE_RECORD Nav_Record { get; set; }

        /// <summary>
        /// 物资信息
        /// </summary>
        [Description("物资信息ID")]
        [DataFieldForeignKey("Nav_Material")]
        public Guid MATERIAL_ID { get; set; }

        /// <summary>
        /// 物资信息
        /// </summary>
        [Description("物资信息")]
        public virtual T_CM_MATERIAL_LIBRARY Nav_Material { get; set; }

        /// <summary>
        /// 操作类型
        /// </summary>
        [Description("操作类型")]
        public CMOperation? OPERATETYPE { get; set; }

        /// <summary>
        /// 原库存数量
        /// </summary>
        [Description("原库存数量")]
        public decimal COUNT_START { get; set; }

        /// <summary>
        /// 操作数量
        /// </summary>
        [Description("操作数量")]
        [FormFieldEdit]
        public decimal COUNT_OPERATE { get; set; }

        /// <summary>
        /// 最终库存
        /// </summary>
        [Description("最终库存")]
        public decimal COUNT_END { get; set; }

        /// <summary>
        /// 是否盘点一致
        /// </summary>
        [Description("是否盘点一致")]
        public bool? ISCHECKSAME { get; set; }

        /// <summary>
        /// 说明 归还 数量与之前数量不一致 得有说明
        /// </summary>
        [Description("说明")]
        [DataFieldLength(300)]
        [FormFieldEdit]
        public string REASON { get; set; }


        /// <summary>
        /// 是否结束  借出 归还后结束
        /// </summary>
        [Description("是否结束")]
        public bool ISEND { get; set; } = true;


        /// <summary>
        /// 已归还数量
        /// </summary>
        [Description("已归还数量")]
        [DataFieldIngore]
        public int? COUNT_RETURN { get; set; }

        /// <summary>
        /// 操作明细ID
        /// </summary>
        [Description("操作明细ID")]
        [DataFieldForeignKey("Nav_Detail")]
        public Guid? PARENT_ID { get; set; }

        /// <summary>
        /// 操作明细
        /// </summary>
        [Description("操作明细")]
        public virtual T_CM_MATERIAL_OPERATE_DETAIL Nav_Detail { get; set; }
    }
}