<?php


namespace App\Controllers;


use App\v2\Modules\Especies\Services\EspecieFinderService;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\Response;
use Exception;

class TipoConvenioV2Controller extends Controller
{
    public function findAll(): Response
    {
        $sql = "select id, descricao from tipo_convenio";
        $data = db_connect()->query($sql)->getResultArray();
        return $this
            ->response
            ->setStatusCode(200)
            ->setJSON([
                'message' => 'Dados encontrados com sucesso.',
                'data' => $data
            ]);
    }
}
