9dd36238bb
- ClockEntryType enum (Work/Break/Lunch) on EmployeeClockEntry; default 0 = Work so all existing entries are unaffected - Migration AddClockEntryType applied - Break and Lunch buttons on clock status card (only when AllowMultiplePunchesPerDay is enabled); GoOnBreak closes current Work segment and opens Break/Lunch segment - Return to Work button when on break/lunch; closes break segment, opens new Work - Status badges on clock card and Who'\''s In grid: Working / On Break / At Lunch - Break/Lunch hours excluded from all day totals, week totals, metrics, and CSV - Manager: Manual Entry modal to create a time entry for any company employee - Attendance report defaults to current ISO week; Week/Month mode toggle with auto-submitting dropdowns (last 12 weeks or months); period label shown inline - Attendance CSV: Type column added; day/week totals blank on Break/Lunch rows; filename uses period label - Week subtotal rows suppressed in single-week view (shown in month view only) - Help article and AI knowledge base updated for all new features Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
using PowderCoating.Core.Enums;
|
|
|
|
namespace PowderCoating.Core.Entities;
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public class EmployeeClockEntry : BaseEntity
|
|
{
|
|
public string UserId { get; set; } = string.Empty;
|
|
|
|
public DateTime ClockInTime { get; set; }
|
|
|
|
/// <summary>Null means the employee is currently clocked in.</summary>
|
|
public DateTime? ClockOutTime { get; set; }
|
|
|
|
/// <summary>Stored at clock-out time: (ClockOutTime - ClockInTime) in hours, rounded to 2 decimal places.</summary>
|
|
public decimal? HoursWorked { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether this segment is regular work time, a break, or a lunch period.
|
|
/// Only <see cref="ClockEntryType.Work"/> entries count toward paid-hours totals.
|
|
/// </summary>
|
|
public ClockEntryType EntryType { get; set; } = ClockEntryType.Work;
|
|
|
|
public string? Notes { get; set; }
|
|
|
|
public virtual ApplicationUser User { get; set; } = null!;
|
|
}
|