using ERPCore.Domain.Enums;

namespace ERPCore.Domain.Entities;

/// <summary>
/// Attendance upload batch (FR-HR-ATT) — the transactional document driving the
/// exact status flow Draft→Validated→Confirmed→UsedInPayroll. Scoped to exactly
/// one payroll period, numbered via <see cref="NumberSequence"/> (docType "ATT").
/// Model: docs/12-BACKEND-HRM.md Part C.4.
/// </summary>
public class AttendanceUploadBatch
{
    public int AttendanceUploadBatchId { get; set; }
    public string DocNo { get; set; } = string.Empty;
    public DateTime PeriodStart { get; set; }
    public DateTime PeriodEnd { get; set; }
    public AttendanceSourceType SourceType { get; set; }
    public string? OriginalFileName { get; set; }

    public int UploadedBy { get; set; }
    public DateTime UploadedAt { get; set; }
    public AttendanceBatchStatus Status { get; set; } = AttendanceBatchStatus.Draft;
    public int? ConfirmedBy { get; set; }
    public DateTime? ConfirmedAt { get; set; }

    public int RowCountTotal { get; set; }
    public int RowCountDuplicate { get; set; }
    public int RowCountError { get; set; }

    public uint RowVersion { get; set; }
}
