fix(dayplan): per-day transport positions for multi-day reservations

Reordering places on one day of a multi-day reservation no longer
affects the order on other days. Transport positions are now stored
per-day in a new reservation_day_positions table instead of a single
global day_plan_position on the reservation.
This commit is contained in:
Maurice
2026-04-05 23:02:42 +02:00
parent a676dbe881
commit 03757ed0af
5 changed files with 89 additions and 18 deletions
+3 -2
View File
@@ -91,10 +91,11 @@ router.put('/positions', authenticate, (req: Request, res: Response) => {
if (!Array.isArray(positions)) return res.status(400).json({ error: 'positions must be an array' });
updatePositions(tripId, positions);
const { day_id } = req.body;
updatePositions(tripId, positions, day_id);
res.json({ success: true });
broadcast(tripId, 'reservation:positions', { positions }, req.headers['x-socket-id'] as string);
broadcast(tripId, 'reservation:positions', { positions, day_id }, req.headers['x-socket-id'] as string);
});
router.put('/:id', authenticate, (req: Request, res: Response) => {