<?php

namespace App\Http\Controllers\Owner\PaxInformationRoomPassenger;

use App\Http\Controllers\Controller;
use App\Http\Controllers\Owner\c_Admin_Session;
use App\Http\Helpers\ResponseBuilder;
use App\Modules\PaxInformationRoomPassenger\Application\Delete\DeletePaxInformationRoomPassengerQuery;
use App\Modules\Shared\Domain\Bus\Query\QueryBus;
use App\Modules\Shared\Domain\Transaction;
use Illuminate\Http\Request;

class PaxInformationRoomPassengerDeleteController extends Controller
{
    private $domain = "PaxInformationRoomPassenger";

    public function __construct(
        private QueryBus $queryBus,
        private Transaction $transaction
    ) {}

    public function __invoke(Request $request, $Id)
    {
        $adminSession = c_Admin_Session::check($request);

        $this->queryBus->ask(new DeletePaxInformationRoomPassengerQuery($Id, $adminSession['Id_Admin']));

        return ResponseBuilder::Response([
            "Response_Status"           => 200,
            "Response_Code"             => 200,
            "Response_Data"             => [],
            "Response_Domain"           => $this->domain,
            "Response_Message"          => 'Pasajero de habitación eliminado con éxito',
            "Response_Error_Message"    => '',
            "Response_Error_Reason"     => '',
        ]);
    }
}
