2022-12-19 16:20:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Fo;
|
|
|
|
|
|
2023-05-16 20:34:47 +02:00
|
|
|
use App\Models\Shop\Order;
|
2023-03-01 11:02:42 +01:00
|
|
|
use App\Models\Shop\Shop;
|
2023-05-16 20:34:47 +02:00
|
|
|
use Ramsey\Uuid\Uuid;
|
2022-12-19 16:20:00 +01:00
|
|
|
|
|
|
|
|
class TimeSlotController
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Récupérer tout les créneaux disponible à partir de
|
|
|
|
|
* maintenant pour un magasin sur les jours à venir.
|
|
|
|
|
*
|
2023-05-11 11:37:16 +02:00
|
|
|
* @param \App\Models\Shop\Shop $shop Le magasin concerné.
|
2022-12-19 16:20:00 +01:00
|
|
|
* @return array
|
|
|
|
|
* @throws \RuntimeException Si la période demandé est incohérente.
|
|
|
|
|
*/
|
2023-05-11 11:37:16 +02:00
|
|
|
public function getAvailableCreneauxByShop(Shop $shop)
|
2022-12-19 16:20:00 +01:00
|
|
|
{
|
2023-05-16 20:34:47 +02:00
|
|
|
/** @var \App\Models\Shop\Order $order */
|
|
|
|
|
$order = Order::getCurrentOrder();
|
|
|
|
|
return $shop->getAvailableCreneaux(null, $order->id ?
|
|
|
|
|
Uuid::fromString($order->id) : null);
|
2022-12-19 16:20:00 +01:00
|
|
|
}
|
|
|
|
|
}
|