using MilitaryTrainingManagement.Models.Enums;

namespace MilitaryTrainingManagement.Models.Entities;

/// <summary>
/// 人员审批历史记录
/// </summary>
public class PersonnelApprovalHistory
{
    public int Id { get; set; }
    
    /// <summary>
    /// 人员ID
    /// </summary>
    public int PersonnelId { get; set; }
    
    /// <summary>
    /// 人员
    /// </summary>
    public Personnel Personnel { get; set; } = null!;
    
    /// <summary>
    /// 审批动作
    /// </summary>
    public PersonnelApprovalAction Action { get; set; }
    
    /// <summary>
    /// 审批前状态
    /// </summary>
    public PersonnelStatus? PreviousStatus { get; set; }
    
    /// <summary>
    /// 审批后状态
    /// </summary>
    public PersonnelStatus NewStatus { get; set; }
    
    /// <summary>
    /// 审批前等级
    /// </summary>
    public PersonnelLevel? PreviousLevel { get; set; }
    
    /// <summary>
    /// 审批后等级
    /// </summary>
    public PersonnelLevel? NewLevel { get; set; }
    
    /// <summary>
    /// 审批人用户ID
    /// </summary>
    public int ReviewedByUserId { get; set; }
    
    /// <summary>
    /// 审批人用户
    /// </summary>
    public UserAccount ReviewedByUser { get; set; } = null!;
    
    /// <summary>
    /// 审批单位ID
    /// </summary>
    public int? ReviewedByUnitId { get; set; }
    
    /// <summary>
    /// 审批单位
    /// </summary>
    public OrganizationalUnit? ReviewedByUnit { get; set; }
    
    /// <summary>
    /// 审批意见
    /// </summary>
    public string? Comments { get; set; }
    
    /// <summary>
    /// 审批时间
    /// </summary>
    public DateTime ReviewedAt { get; set; } = DateTime.UtcNow;
}