using Books.Api.EventFlow.ReadModels;
using GraphQL.Types;

namespace Books.Api.GraphQL.Types;

public class FiscalYearGraphType : ObjectGraphType<FiscalYearReadModelDto>
{
    public FiscalYearGraphType()
    {
        Name = "FiscalYear";
        Description = "A fiscal year (regnskabsaar)";

        Field(x => x.Id).Description("Unique identifier");
        Field(x => x.CompanyId).Description("Company this fiscal year belongs to");
        Field(x => x.Name).Description("Fiscal year name (e.g., '2024' or '2024/2025')");
        Field(x => x.StartDate).Description("First day of the fiscal year");
        Field(x => x.EndDate).Description("Last day of the fiscal year");
        Field(x => x.Status).Description("Current status (open, closed, locked)");
        Field(x => x.OpeningBalancePosted).Description("Whether opening balance has been posted");
        Field(x => x.ClosingDate, nullable: true).Description("When the fiscal year was closed");
        Field(x => x.ClosedBy, nullable: true).Description("User who closed the fiscal year");
        Field(x => x.ReopenedDate, nullable: true).Description("When the fiscal year was reopened");
        Field(x => x.ReopenedBy, nullable: true).Description("User who reopened the fiscal year");
        Field(x => x.LockedDate, nullable: true).Description("When the fiscal year was locked");
        Field(x => x.LockedBy, nullable: true).Description("User who locked the fiscal year");
        Field(x => x.CreatedAt).Description("When the fiscal year was created");
        Field(x => x.UpdatedAt).Description("When the fiscal year was last updated");
    }
}
