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>
75 lines
2.4 KiB
C#
75 lines
2.4 KiB
C#
using PowderCoating.Core.Enums;
|
|
|
|
namespace PowderCoating.Application.DTOs.Timeclock;
|
|
|
|
public class EmployeeClockEntryDto
|
|
{
|
|
public int Id { get; set; }
|
|
public string UserId { get; set; } = string.Empty;
|
|
public string UserDisplayName { get; set; } = string.Empty;
|
|
public DateTime ClockInTime { get; set; }
|
|
public DateTime? ClockOutTime { get; set; }
|
|
public decimal? HoursWorked { get; set; }
|
|
public ClockEntryType EntryType { get; set; } = ClockEntryType.Work;
|
|
public string? Notes { get; set; }
|
|
public bool IsOpen => ClockOutTime == null;
|
|
}
|
|
|
|
public class ClockInRequest
|
|
{
|
|
public string? Notes { get; set; }
|
|
}
|
|
|
|
public class ClockOutRequest
|
|
{
|
|
public int EntryId { get; set; }
|
|
public string? Notes { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Request sent from the kiosk tablet — employee taps their tile and enters a PIN.
|
|
/// The server determines whether to clock in or clock out based on the employee's open entry.
|
|
/// </summary>
|
|
public class KioskPunchRequest
|
|
{
|
|
public string UserId { get; set; } = string.Empty;
|
|
public string Pin { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class EditClockEntryRequest
|
|
{
|
|
public int Id { get; set; }
|
|
public DateTime ClockInTime { get; set; }
|
|
public DateTime? ClockOutTime { get; set; }
|
|
public string? Notes { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sent when an employee clicks Break or Lunch to pause their work segment.
|
|
/// The server closes the current Work entry and opens a Break/Lunch entry.
|
|
/// </summary>
|
|
public class GoOnBreakRequest
|
|
{
|
|
/// <summary>Must be <see cref="ClockEntryType.Break"/> or <see cref="ClockEntryType.Lunch"/>.</summary>
|
|
public ClockEntryType BreakType { get; set; }
|
|
}
|
|
|
|
/// <summary>Manager request to create a time entry on behalf of any company employee.</summary>
|
|
public class ManualEntryRequest
|
|
{
|
|
public string UserId { get; set; } = string.Empty;
|
|
public DateTime ClockInTime { get; set; }
|
|
public DateTime? ClockOutTime { get; set; }
|
|
public string? Notes { get; set; }
|
|
}
|
|
|
|
/// <summary>Employee tile shown on the kiosk employee-selection grid.</summary>
|
|
public class KioskEmployeeDto
|
|
{
|
|
public string UserId { get; set; } = string.Empty;
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
public string Initials { get; set; } = string.Empty;
|
|
/// <summary>True when the employee has an open clock entry right now.</summary>
|
|
public bool IsClockedIn { get; set; }
|
|
}
|