namespace Books.Api.EventFlow.ReadModels;

/// <summary>
/// DTO for reading fiscal year data from the database.
/// Uses a class with properties because PostgreSQL returns column names
/// in lowercase, and Dapper matches properties case-insensitively.
/// </summary>
public class FiscalYearReadModelDto
{
    public string Id { get; set; } = string.Empty;
    public string CompanyId { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }
    public string Status { get; set; } = string.Empty;
    public bool OpeningBalancePosted { get; set; }

    // Audit fields for state transitions
    public DateTime? ClosingDate { get; set; }
    public string? ClosedBy { get; set; }
    public DateTime? ReopenedDate { get; set; }
    public string? ReopenedBy { get; set; }
    public DateTime? LockedDate { get; set; }
    public string? LockedBy { get; set; }

    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
}
