<?php

namespace App\Modules\Booking\Application\FindByCode;

use App\Modules\Booking\Domain\BookingCode;
use App\Modules\Booking\Domain\BookingRepository;
use App\Modules\Booking\Domain\FindByCodeBooking;

class BookingByCodeFinder
{
    public function __construct(
        private BookingRepository $bookingRepository
    ) {}

    public function __invoke(BookingCode $code)
    {
        return $this->bookingRepository->find(new FindByCodeBooking($code));
    }
}
