tenantId); $slotId = ScheduleSlotId::fromString($command->slotId); $slot = $this->slotRepository->get($slotId, $tenantId); $fromDate = new DateTimeImmutable($command->fromDate); if (!$slot->isActiveOnDate($fromDate)) { throw DateExceptionInvalideException::pourSlotEtDate($slotId, $fromDate); } $now = $this->clock->now(); $dayBefore = $fromDate->modify('-1 day'); $slot->terminerRecurrenceLe($dayBefore, $now); $this->slotRepository->save($slot); } }