using cp for plans

This commit is contained in:
2025-10-18 23:35:46 +02:00
parent 07c495a6dc
commit 372b9b2f20
13 changed files with 485 additions and 9 deletions

View File

@@ -0,0 +1,25 @@
// routes/scheduling.ts
import express from 'express';
import { SchedulingService } from '../services/SchedulingService.js';
const router = express.Router();
router.post('/generate-schedule', async (req, res) => {
try {
const { shiftPlan, employees, availabilities, constraints } = req.body;
const scheduler = new SchedulingService();
const result = await scheduler.generateOptimalSchedule({
shiftPlan,
employees,
availabilities,
constraints
});
res.json(result);
} catch (error) {
res.status(500).json({ error: 'Scheduling failed', details: error });
}
});
export default router;