using System;
using System.Collections.Generic;
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 + "shift")]
[Index("ix_shift_shiftnumber_enabled", nameof(ShiftNumber))]
[Index("ix_shift_starttime_endtime", nameof(StartTime))]
public partial class ShiftEntity : EntityTenant
{
    /// <summary>
    /// 班次名称
    /// </summary>
    [Column(StringLength = 100)]
    public string Name { get; set; }
    
    public int ShiftNumber { get; set; }

    /// <summary>
    /// 班次开始时间
    /// </summary>
    public TimeSpan StartTime { get; set; }

    /// <summary>
    /// 班次结束时间
    /// </summary>
    public TimeSpan EndTime { get; set; }
    
    public bool IsEnabled { get; set; } = true;

    /// <summary>
    /// 班次描述
    /// </summary>
    [Column(StringLength = 200)]
    public string Description { get; set; }

    /// <summary>
    /// 班次后强制休息天数 (默认值，可被规则覆盖)
    /// </summary>
    public int RestDaysAfterShift { get; set; } = 1;

    /// <summary>
    /// 是否允许连续排班 (默认值，可被规则覆盖)
    /// </summary>
    public bool AllowConsecutive { get; set; } = false;

    /// <summary>
    /// 班次优先级权重
    /// </summary>
    public int PriorityWeight { get; set; } = 1;
} 