namespace ERPCore.Services.Gl;

/// <summary>
/// Purpose-built request/response shapes for the specific GL endpoints ERPCore's GRN
/// module calls directly (journal-entries, period lookup, bank-account listing) — not
/// a full model of GL's contract (docs/12-GENERAL-LEDGER-INTEGRATION.md §5/§6: typed
/// DTOs are added only for the flow that actually needs them).
/// </summary>
public sealed record GlJournalEntryLineRequest(string AccountCode, decimal DebitAmount, decimal CreditAmount, string? Memo = null);

public sealed class GlJournalEntryRequest
{
    public int PeriodId { get; set; }
    public DateOnly EntryDate { get; set; }
    public string? SourceModule { get; set; }
    public string? Reference { get; set; }
    public string? Narration { get; set; }
    public List<GlJournalEntryLineRequest> Lines { get; set; } = new();
}

public sealed record GlJournalEntryResult(string JournalNo, bool IsPosted);

public sealed record GlPeriod(int PeriodId, int FiscalYearId);

public sealed record GlBankAccount(
    string AccountType, long AccountId, string AccountName, string? BankName,
    string? CashAccountTypeName, string? AccountNumber, long GlAccountId, string GlAccountCode, string CurrencyCode);
