<?php

declare(strict_types=1);

namespace App\Controller\Solicitud;

use App\CustomResponse as Response;
use Fig\Http\Message\StatusCodeInterface;
use Psr\Http\Message\ServerRequestInterface as Request;

final class Create extends Base
{
    public function __invoke(Request $request, Response $response): Response
    {
        $input = (array) $request->getParsedBody();
        $Solicitud = $this->getSolicitudService()->create($input);

        return $response->withJson($Solicitud, StatusCodeInterface::STATUS_CREATED);
    }
}
