<?php
namespace Modules\Outil;

use Skeleton\Router;
use Skeleton\Module;
use Psr\Container\ContainerInterface;
use Skeleton\Renderer\RendererInterface;
use Modules\Outil\Controller\ContainerFileController;
use Modules\Outil\Controller\AsynchroneController;
use Modules\Outil\Controller\MultiSelectController;

class OutilModule extends Module
{

    const DEFINITIONS = __DIR__ . '/config.php';

    public function __construct(ContainerInterface $container)
    {
       
        $container->get(RendererInterface::class)->addPath('outil-Multiselect', __DIR__ . '/Views/Multiselect');

        $router = $container->get(Router::class);

        $base_url = $container->get('baseUrl') . $container->get('Outil.prefix');
        
        // Controller Container File
        $router->get($base_url . '/creation-fichier', ContainerFileController::class, 'Outil.ContainerFile.creationFichier');
        $router->get($base_url . '/modification-fichier', ContainerFileController::class, 'Outil.ContainerFile.modificationFichier');

        // Controller Asynchone
        $router->get($base_url . '/getResultAsynchrone', AsynchroneController::class, 'Outil.Asynchrone.getResultAsynchrone');
        $router->get($base_url . '/call-V1-create-fichier-async-export', AsynchroneController::class, 'Outil.Asynchrone.callEmailAsync');
        ///oxaproc2/V2/outil/call-V1-create-fichier-async-export

        // MultiSelect
        $router->get($base_url . '/mutli-select/Entity', MultiSelectController::class, 'Outil.MultiSelect.entity');
        $router->get($base_url . '/mutli-select/searchEntity', MultiSelectController::class, 'Outil.MultiSelect.searchEntity');
    }
}
