<?php

namespace App\Modules\RoomPassenger\Application\List;

use App\Modules\BookingExtraPassenger\Domain\IdBookingExtraPassenger;
use App\Modules\Room\Domain\IdRoom;
use App\Modules\RoomPassenger\Domain\ListRoomPassenger;
use App\Modules\RoomPassenger\Domain\RoomPassengerRepository;

final class RoomPassengerLister
{
    public function __construct(private RoomPassengerRepository $repository) {}

    public function __invoke(
        string $action,
        ?IdBookingExtraPassenger $idBookingExtraPassenger = null,
        ?IdRoom $idRoom = null
    ) {
        return $this->repository->search(new ListRoomPassenger(
            $idBookingExtraPassenger,
            $idRoom,
            $action
        ));
    }
}
