using IRaCIS.Core.Domain.Share;

namespace IRaCIS.Core.Domain.Models;

[Comment("后台 - 系统签署文档")]
[Table("SystemDocument")]
public class SystemDocument : BaseFullDeleteAuditEntity
{
    #region 导航属性
    [JsonIgnore]
    public List<SystemDocConfirmedIdentityUser> SystemDocConfirmedUserList { get; set; }


    [JsonIgnore]
    public List<SystemDocumentAttachment> SystemDocumentAttachmentList { get; set; }
    [JsonIgnore]
    public List<SystemDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
    [JsonIgnore]
    [ForeignKey("FileTypeId")]
    public Dictionary FileType { get; set; }
    #endregion
    public Guid FileTypeId { get; set; }
    public string Name { get; set; } = string.Empty;

    public int SignViewMinimumMinutes { get; set; }

    [StringLength(1000)]
    public string Path { get; set; } = string.Empty;

    public DocUserSignType DocUserSignType { get; set; }

    /// <summary>
    /// 现有员工培训天数
    /// </summary>
    public int? CurrentStaffTrainDays { get; set; }


    /// <summary>
    /// 新员工培训天数
    /// </summary>
    public int? NewStaffTrainDays { get; set; }

    /// <summary>
    /// 是否发布
    /// </summary>

    public bool IsPublish { get; set; } = true;



}

[Comment("后台 - 系统签署文档附件")]
[Table("SystemDocumentAttachment")]
public class SystemDocumentAttachment : BaseFullAuditEntity
{
    [JsonIgnore]
    [ForeignKey("SystemDocumentId")]
    public SystemDocument SystemDocument { get; set; }

    /// <summary>
    /// 系统文档Id
    /// </summary>
    public Guid SystemDocumentId { get; set; }

    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 文件名称
    /// </summary>
    public string FileName { get; set; } = string.Empty;

    /// <summary>
    /// 是否下线
    /// </summary>
    public bool OffLine { get; set; }

    /// <summary>
    /// 文件路径
    /// </summary>
    [StringLength(1000)]
    public string FilePath { get; set; } = string.Empty;

    /// <summary>
    /// 文件大小
    /// </summary>
    public decimal? FileSize { get; set; }

    /// <summary>
    /// 文件类型
    /// </summary>
    public string FileFormat { get; set; } = string.Empty;
}

public enum DocUserSignType
{
    //默认 内部 外部都需要签署
    InnerAndOuter=0,

    //仅仅内部需要签署
    OnlyInner=1,


}