starting from new for scheduling

This commit is contained in:
2025-10-18 22:55:32 +02:00
parent e84d1af604
commit 07c495a6dc
2 changed files with 8 additions and 1813 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -156,7 +156,10 @@ export class ShiftAssignmentService {
}
// Set cache for scheduler
IntelligentShiftScheduler.scheduledShiftsCache.set(shiftPlan.id, scheduledShifts);
IntelligentShiftScheduler.scheduledShiftsCache.set(shiftPlan.id, {
shifts: scheduledShifts,
timestamp: Date.now()
});
// 🔥 RUN SCHEDULING FOR FIRST WEEK ONLY
const schedulingResult = await IntelligentShiftScheduler.generateOptimalSchedule(
@@ -344,7 +347,7 @@ export class ShiftAssignmentService {
// Group pattern shifts by day-timeSlot for easy lookup
const patternMap = new Map<string, string[]>();
weeklyPattern.weekShifts.forEach(patternShift => {
weeklyPattern.weekShifts.forEach((patternShift: ScheduledShift) => {
const dayOfWeek = this.getDayOfWeek(patternShift.date);
const patternKey = `${dayOfWeek}-${patternShift.timeSlotId}`;