20 lines
818 B
C#
20 lines
818 B
C#
|
|
using Extrudex.Domain.DTOs.Moonraker;
|
||
|
|
|
||
|
|
namespace Extrudex.Domain.Interfaces;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Service interface for syncing Moonraker printer data into the Extrudex database.
|
||
|
|
/// Handles periodic polling of printer status and mapping print job history
|
||
|
|
/// to PrintJob and FilamentUsage entities.
|
||
|
|
/// </summary>
|
||
|
|
public interface IMoonrakerPrinterSyncService
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Performs a single sync cycle: queries all active Moonraker printers,
|
||
|
|
/// fetches their current status and print job history, and persists
|
||
|
|
/// updates to the database.
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="cancellationToken">Cancellation token for graceful shutdown.</param>
|
||
|
|
/// <returns>The number of printers successfully synced.</returns>
|
||
|
|
Task<int> SyncAllAsync(CancellationToken cancellationToken = default);
|
||
|
|
}
|