using APT.BaseData.Domain.Entities;
using APT.BaseData.Domain.Entities.FM;
using APT.Infrastructure.Core;
using APT.MS.Domain.Entities.HM;
using APT.MS.Domain.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace APT.MS.Domain.Entities.BS
{
    /// <summary>
    /// 检查记录确认
    /// 如果根据状态去搜索，很经常出问题
    /// 所以检查记录确认这个做中间表
    /// 顺便看看是否能解决 检查登记人 不能是确认人 
    /// 表单操作思路 同一个安全检查 如果没有单就 添加单和明细 否则 直接加明细
    /// </summary>
    [Description("检查记录确认")]
    public class T_BS_SAFE_CHECK_RECORD : MesEntityBase
    {
        /// <summary>
        /// 检查类型
        /// </summary>
        [Description("安全检查")]
        [DataFieldForeignKey("Nav_SafeCheck")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public Guid? SAFE_CHECK_ID { get; set; }

        /// <summary>
        /// 导航：检查类型表
        /// </summary>
        [Description("导航：检查类型")]
        public virtual T_BS_SAFE_CHECK Nav_SafeCheck { get; set; }

        /// <summary>
        /// 确认人
        /// </summary>
        [Description("确认人")]
        [DataFieldForeignKey("Nav_User")]
        public Guid? USER_ID { get; set; }

        /// <summary>
        /// 制定检查表的人
        /// </summary>
        [Description("确认人")]
        public T_FM_USER Nav_User { get; set; }

        /// <summary>
        /// 检查部门（检查记录的部门ID，不做外键 需要再加）
        /// </summary>
        [Description("检查部门")]
        public Guid? DEPARTMENT_ID { get; set; }

        /// <summary>
        /// 确认明细
        /// </summary>
        [Description("导航：确认明细")]
        public virtual IEnumerable<T_BS_SAFE_CHECK_RECORD_DETAIL> Nav_ListRecordDetail { get; set; }

        /// <summary>
        /// 是否确认
        /// </summary>
        [Description("是否确认")]
        public bool ISCHECK { get; set; } = false;
    }
}