using GB5Shared.DTO.Framework.Login; using MMDAL.DTO.Scheduling; namespace MMBLL.Scheduling.Engine { public interface ICalendarService { // Batch-loads all shift patterns for the given work centers and pre-populates the // CalendarCache inside context. Call once before the EU scheduling loop to eliminate // per-day DB calls. Cache misses during the loop fall back to BuildDayWindowsAsync. Task PrePopulateCalendarCacheAsync( IEnumerable workCenterIds, DateTime horizonFrom, DateTime horizonTo, SchedulingContext context, LoginDTO login, CancellationToken ct); // Returns the contiguous working time windows for a machine on the given date range, // with planned downtime (TTASK TASKNATURE=2) and breakdown calls (TCALL) already subtracted. // Results per (WorkCenterId, Date) are cached inside SchedulingContext for the run lifetime. Task> GetWorkingWindowsAsync( int machineId, int workCenterId, DateTime from, DateTime to, SchedulingContext context, LoginDTO login, CancellationToken ct); } }