using PowderCoating.Core.Entities;
namespace PowderCoating.Application.Interfaces;
///
/// Placeholder return types for operational reports. These will be replaced with proper
/// Application DTOs as each report is migrated from ReportsController in Phase 2/3.
///
public record JobCycleTimeReport(List Rows, int Months);
public record JobCycleTimeRow(string StatusName, double AvgDaysInStatus, int JobCount);
public record PowderUsageReport(List Rows, int Months);
public record PowderUsageRow(string ColorName, string VendorName, decimal TotalLbs, decimal TotalCost);
///
/// Read-only service for operational aggregate reports. All methods query the database
/// with AsNoTracking and return pre-shaped objects — no tracked entities are returned.
/// Implemented in Infrastructure; uses ApplicationDbContext directly.
///
public interface IOperationalReportService
{
/// Returns average time jobs spend in each status over the given lookback period.
Task GetJobCycleTimeAsync(int companyId, int months);
/// Returns powder usage (lbs and cost) broken down by color and vendor.
Task GetPowderUsageAsync(int companyId, int months);
///
/// Returns all active (non-deleted, non-voided) bills with their Vendor and non-deleted
/// Payments navigations loaded. Used by Analytics, ExpensesAp, and AI accounting actions
/// so those controllers do not need a direct ApplicationDbContext reference.
///
Task> GetActiveBillsAsync();
///
/// Returns all non-deleted direct expenses with their ExpenseAccount navigation loaded.
/// Used by Analytics, ExpensesAp, and AI accounting actions so those controllers do not
/// need a direct ApplicationDbContext reference.
///
Task> GetAllExpensesAsync();
///
/// Returns the full job status history log with FromStatus and ToStatus navigations
/// loaded. Used by Analytics and JobCycleTime so those actions do not need a direct
/// ApplicationDbContext reference.
///
Task> GetAllJobStatusHistoryAsync();
}