using ERPCore.Domain.Enums;

namespace ERPCore.Domain.Entities;

/// <summary>
/// Uploaded staff document (FR-HR-DOC-02..04) — the user's "Doc". <see cref="StoredFileName"/>/
/// <see cref="RelativePath"/> are server-generated (never the client's filename), so the
/// file is only ever reachable through <see cref="Services.Interfaces.IFileStorageService"/>,
/// never a guessable static path. Archived, not deleted, so the audit trail of what was
/// once on file is retained. Model: docs/12-BACKEND-HRM.md Part C.3.
/// </summary>
public class EmployeeDocument
{
    public int EmployeeDocumentId { get; set; }
    public int EmployeeId { get; set; }
    public Employee? Employee { get; set; }
    public int HrDocumentTypeId { get; set; }
    public HrDocumentType? HrDocumentType { get; set; }

    public string OriginalFileName { get; set; } = string.Empty;
    public string StoredFileName { get; set; } = string.Empty;
    public string RelativePath { get; set; } = string.Empty;
    public string ContentType { get; set; } = string.Empty;
    public long SizeBytes { get; set; }
    public DateTime? IssueDate { get; set; }
    public DateTime? ExpiryDate { get; set; }
    public string? Notes { get; set; }

    public int UploadedBy { get; set; }
    public DateTime UploadedAt { get; set; }
    public int? VerifiedBy { get; set; }
    public DateTime? VerifiedAt { get; set; }

    public EmployeeDocumentStatus Status { get; set; } = EmployeeDocumentStatus.Active;
    public uint RowVersion { get; set; }
}
