using PowderCoating.Core.Enums;
namespace PowderCoating.Core.Entities;
///
/// Facility-level clock-in/clock-out record for an employee.
/// Tracks when an employee arrives and leaves the facility — separate from JobTimeEntry which tracks
/// hours against a specific job. Multiple entries per day are fully supported (lunch breaks, etc.).
/// The only enforced constraint: a user may not have more than one open entry (ClockOutTime == null) at a time.
///
public class EmployeeClockEntry : BaseEntity
{
public string UserId { get; set; } = string.Empty;
public DateTime ClockInTime { get; set; }
/// Null means the employee is currently clocked in.
public DateTime? ClockOutTime { get; set; }
/// Stored at clock-out time: (ClockOutTime - ClockInTime) in hours, rounded to 2 decimal places.
public decimal? HoursWorked { get; set; }
///
/// Whether this segment is regular work time, a break, or a lunch period.
/// Only entries count toward paid-hours totals.
///
public ClockEntryType EntryType { get; set; } = ClockEntryType.Work;
public string? Notes { get; set; }
public virtual ApplicationUser User { get; set; } = null!;
}