using Extrudex.Domain.Entities; using Extrudex.Domain.Enums; namespace Extrudex.Domain.Interfaces; /// /// Service for recording filament usage entries. Writes to the usage_logs table /// and provides query capabilities for usage history. /// public interface IUsageLogService { /// /// Records a filament usage entry. /// /// The spool that provided the filament. /// Grams of filament consumed. /// Where the data came from. /// Optional printer ID. /// Optional print job ID. /// Optional mm extruded. /// When the usage occurred (defaults to UTC now). /// Optional notes. /// The created UsageLog entity. Task RecordUsageAsync( Guid spoolId, decimal gramsUsed, DataSource dataSource, Guid? printerId = null, Guid? printJobId = null, decimal? mmExtruded = null, DateTime? usageTimestamp = null, string? notes = null); /// /// Retrieves usage logs for a specific spool, ordered by usage timestamp descending. /// /// The spool ID to filter by. /// Cancellation token. /// A collection of usage logs for the spool. Task> GetBySpoolAsync(Guid spoolId, CancellationToken cancellationToken = default); /// /// Retrieves usage logs for a specific printer, ordered by usage timestamp descending. /// /// The printer ID to filter by. /// Cancellation token. /// A collection of usage logs for the printer. Task> GetByPrinterAsync(Guid printerId, CancellationToken cancellationToken = default); /// /// Retrieves usage logs for a specific print job, ordered by usage timestamp descending. /// /// The print job ID to filter by. /// Cancellation token. /// A collection of usage logs for the print job. Task> GetByPrintJobAsync(Guid printJobId, CancellationToken cancellationToken = default); }