<?php

namespace App\Controllers;

use App\Controllers\BaseController;
use App\Services\ServiceResponse\ServiceResponseInterface;
use CodeIgniter\HTTP\Response;
use CodeIgniter\HTTP\ResponseInterface;
use App\Services\ServiceResponse\ServiceResponse;

class IntergacaoVetusController extends BaseController {
	
	public function getAccessValid():Response{
		
		$service_response = new ServiceResponse();
		
		$service_response->setStatus(ServiceResponseInterface::SUCESS);
		
		$response_messages = [
				ServiceResponseInterface::SUCESS => [
						'code' => ResponseInterface::HTTP_OK,
						'message' => 'Usuario validado. acesso liberado'
				],
				ServiceResponseInterface::FORBIDDEN => [
						'code' => ResponseInterface::HTTP_FORBIDDEN,
						'message' => 'Usuário sem permissão para esta operação.'
				],
				ServiceResponseInterface::HAVE_CONFLICTS => [
						'code' => ResponseInterface::HTTP_CONFLICT,
						'message' => 'Dados conflitantes.'
				],
				ServiceResponseInterface::FOREIGN_KEY_DONT_EXISTS => [
						'code' => ResponseInterface::HTTP_BAD_REQUEST,
						'message' => 'Dados inválidos.'
				],
				ServiceResponseInterface::INSUFFICIENT_DATA => [
						'code' => ResponseInterface::HTTP_BAD_REQUEST,
						'message' => 'Dados inválidos.'
				],
				ServiceResponseInterface::SERVICE_INTERNAL_ERROR => [
						'code' => ResponseInterface::HTTP_INTERNAL_SERVER_ERROR,
						'message' => 'Erro interno do servidor.'
				],
				ServiceResponseInterface::UNKNOWN_ERROR => [
						'code' => ResponseInterface::HTTP_INTERNAL_SERVER_ERROR,
						'message' => 'Erro interno do servidor.'
				],
				ServiceResponseInterface::DATABASE_CONNECTION_ERROR => [
						'code' => ResponseInterface::HTTP_FAILED_DEPENDENCY,
						'message' => 'Erro interno decomunicação com Banco de dados.'
				]
		];
		
		return $this->getResponse( $service_response, $response_messages );
		
	}

}

