<?php

namespace App\Modules\PaxInformationRoom\Application\Insert;

use App\Modules\Location\Domain\IdLocation;
use App\Modules\PaxInformationRoom\Domain\IdPaxInformationRoom;
use App\Modules\PaxInformationRoom\Domain\PaxInformationRoomDate;
use App\Modules\PaxInformationRoom\Domain\PaxInformationRoomDateUpdate;
use App\Modules\PaxInformationRoom\Domain\PaxInformationRoomDescription;
use App\Modules\PaxInformationRoom\Domain\PaxInformationRoomStatus;
use App\Modules\PaxInformationRoom\Domain\PaxInformationRoomVersion;
use App\Modules\TypeDomain\IdTypeDefinedService;
use App\Modules\PaxInformation\Domain\IdPaxInformation;
use App\Modules\Shared\Domain\Bus\Query\QueryHandler;
use App\Modules\TypeRoom\Domain\IdTypeRoom;

final class InsertPaxInformationRoomQueryHandler implements QueryHandler
{
    public function __construct(private PaxInformationRoomInserter $inserter) {}

    public function __invoke(InsertPaxInformationRoomQuery $query): InsertPaxInformationRoomResponse
    {
        return new InsertPaxInformationRoomResponse($this->inserter->__invoke(
            new IdPaxInformationRoom(0),
            new PaxInformationRoomDate($query->date),
            new PaxInformationRoomDateUpdate($query->dateUpdate),
            new PaxInformationRoomVersion(1),
            new PaxInformationRoomStatus($query->status),
            new IdPaxInformation($query->idPaxInformation),
            new IdTypeRoom($query->idTypeRoom),
            $query->idAdmin
        ));
    }
}
