using PowderCoating.Application.DTOs.Accounting;
using PowderCoating.Core.Enums;
namespace PowderCoating.Application.Interfaces;
///
/// Read-only service for financial aggregate reports. All methods query the database
/// with AsNoTracking and return pre-shaped DTOs — no tracked entities are returned.
/// Implemented in Infrastructure; uses ApplicationDbContext directly.
/// The parameter overrides the company's stored preference when
/// supplied; pass null to fall back to the company's configured accounting method.
///
public interface IFinancialReportService
{
/// Returns a Profit & Loss report for the given company and date range.
Task GetProfitAndLossAsync(int companyId, DateTime from, DateTime to, AccountingMethod? method = null);
/// Returns a Balance Sheet snapshot as of the given date.
Task GetBalanceSheetAsync(int companyId, DateTime asOf, AccountingMethod? method = null);
/// Returns an AR Aging report bucketed at 0-30, 31-60, 61-90, and 90+ days.
Task GetArAgingAsync(int companyId, DateTime asOf);
/// Returns a Sales & Income report for the given company and date range.
Task GetSalesAndIncomeAsync(int companyId, DateTime from, DateTime to);
/// Returns an invoice-basis Sales Tax Liability report for the given company and date range.
Task GetSalesTaxReportAsync(int companyId, DateTime from, DateTime to);
/// Returns an AP Aging report bucketed at 0-30, 31-60, 61-90, and 90+ days past the bill due date.
Task GetApAgingAsync(int companyId, DateTime asOf);
/// Returns a Trial Balance using current account balances as of the given date.
Task GetTrialBalanceAsync(int companyId, DateTime asOf);
/// Looks up the accounting method configured for the given company. Returns Accrual if not found.
Task GetCompanyAccountingMethodAsync(int companyId);
/// Returns a dated activity statement for a customer showing opening balance, all transactions in the period, and closing balance.
Task GetCustomerStatementAsync(int companyId, int customerId, DateTime from, DateTime to);
/// Returns a dated activity statement for a vendor showing opening balance, all transactions in the period, and closing balance.
Task GetVendorStatementAsync(int companyId, int vendorId, DateTime from, DateTime to);
///
/// Returns a Cash Flow Statement for the period using the direct (cash-basis) method for
/// operating activities. Investing and Financing sections are derived from account-level data.
/// BeginningCash is computed from all cash/bank account credits and debits prior to
/// ; EndingCash adds the net change during the period.
///
Task GetCashFlowStatementAsync(int companyId, DateTime from, DateTime to);
}