using ERPCore.Domain.Enums;

namespace ERPCore.Domain.Entities;

/// <summary>
/// Attendance baseline (FR-HR-MD-01) — the shift definition Late/Early/OT figures
/// are computed against (docs/12-BACKEND-HRM.md A.3, C.1). <see cref="IsOvernight"/>
/// is explicit rather than inferred from End&lt;Start, since that comparison alone
/// is ambiguous for a shift that starts and ends the same clock time next day.
/// </summary>
public class WorkShift
{
    public int WorkShiftId { get; set; }
    public string Code { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public TimeSpan StartTime { get; set; }
    public TimeSpan EndTime { get; set; }
    public bool IsOvernight { get; set; }
    public int GraceMinutes { get; set; } = 15;
    public int BreakMinutes { get; set; } = 60;
    public int StandardWorkingMinutes { get; set; } = 480;
    public decimal OtMultiplier { get; set; } = 1.5m;

    /// <summary>Bitmask, bit 0 = Monday .. bit 6 = Sunday.</summary>
    public int WorkingDaysMask { get; set; } = 0b0111111;

    public EntityStatus Status { get; set; } = EntityStatus.Active;

    public DateTime CreatedAt { get; set; }
    public DateTime? UpdatedAt { get; set; }
    public uint RowVersion { get; set; }
}
