Fetch reservation with unit

This commit is contained in:
Juan Pablo Vial
2025-09-23 15:37:45 -03:00
parent d171a61b8a
commit 496dca9133
3 changed files with 46 additions and 6 deletions

View File

@ -123,7 +123,7 @@ class Reservation extends Ideal\Service\API
$date = new DateTimeImmutable($data['date']);
} catch (DateMalformedStringException) {}
try {
$reservation = $this->reservationRepository->fetchByBuyerAndDate($data['buyer_rut'], $date);
$reservation = $this->reservationRepository->fetchByBuyerAndUnitAndDate($data['buyer_rut'], (int) $data['units'][0], $date);
if (array_key_exists('broker_rut', $data) and $data['broker_rut'] !== '') {
try {