<?php

namespace App\Modules\PaxInformationRoom\Application\Delete;

use App\Modules\PaxInformationRoom\Domain\IdPaxInformationRoom;
use App\Modules\PaxInformationRoom\Domain\PaxInformationRoomRepository;
use App\Modules\Shared\Domain\Bus\Query\QueryHandler;

final class DeletePaxInformationRoomQueryHandler implements QueryHandler
{
    public function __construct(
        private PaxInformationRoomDeleter $deleter,
        private PaxInformationRoomRepository $repository
    ) {}

    public function __invoke(DeletePaxInformationRoomQuery $query): DeletePaxInformationRoomResponse
    {
        $this->deleter->__invoke(new IdPaxInformationRoom($query->idPaxInformationRoom()), $query->idAdmin());
        return new DeletePaxInformationRoomResponse();
    }
}
