using System;
using FreeSql.DataAnnotations;
using ZhonTai.Admin.Core.Entities;
using NPP.SmartSchedue.Api.Contracts.Core.Consts;

namespace NPP.SmartSchedue.Api.Contracts.Domain.Time;

/// <summary>
/// 员工休假
/// </summary>
[Table(Name = DbConsts.TableNamePrefix + "employee_leave")]
public partial class EmployeeLeaveEntity : EntityTenant
{
    /// <summary>
    /// 员工ID
    /// </summary>
    public long EmployeeId { get; set; }

    /// <summary>
    /// 人员ID (与PersonnelId对应)
    /// </summary>
    public long PersonnelId 
    { 
        get => EmployeeId; 
        set => EmployeeId = value; 
    }

    /// <summary>
    /// 休假类型
    /// </summary>
    [Column(StringLength = 50)]
    public string LeaveType { get; set; }

    /// <summary>
    /// 开始时间
    /// </summary>
    public DateTime StartTime { get; set; }

    /// <summary>
    /// 结束时间
    /// </summary>
    public DateTime EndTime { get; set; }

    /// <summary>
    /// 开始日期 (与StartTime对应)
    /// </summary>
    public DateTime StartDate 
    { 
        get => StartTime.Date; 
        set => StartTime = value; 
    }

    /// <summary>
    /// 结束日期 (与EndTime对应)
    /// </summary>
    public DateTime EndDate 
    { 
        get => EndTime.Date; 
        set => EndTime = value; 
    }

    /// <summary>
    /// 休假状态
    /// </summary>
    [Column(StringLength = 20)]
    public string Status { get; set; }

    /// <summary>
    /// 申请原因
    /// </summary>
    [Column(StringLength = 500)]
    public string Reason { get; set; }

    /// <summary>
    /// 审批人ID
    /// </summary>
    public long? ApproverId { get; set; }

    /// <summary>
    /// 审批时间
    /// </summary>
    public DateTime? ApprovalTime { get; set; }

    /// <summary>
    /// 审批意见
    /// </summary>
    [Column(StringLength = 200)]
    public string ApprovalComment { get; set; }
} 