<?php

declare(strict_types=1);

namespace Apexl\UserTabulator;

use apexl\Io\enums\HttpMethod;
use apexl\Io\includes\Module;
use apexl\Io\includes\RouteManager;
use apexl\Io\modules\system\interfaces\ProvidesRoutesInterface;
use Apexl\UserTabulator\ConstantList\UserTabulator;
use Apexl\UserTabulator\Controllers\SaveTabulatorLayoutController;
use Apexl\UserTabulator\Hooks\SetTabulatorColumns;
use app\vendor\apexl\io\src\Io\interfaces\ProvidesHooksInterface;


class UserTabulatorModule extends Module implements ProvidesRoutesInterface, ProvidesHooksInterface
{
    public function routes(RouteManager $routeManager): void
    {
        $this->addRoute(
            $routeManager,
            HttpMethod::POST,
            UserTabulator::SAVE_LAYOUT,
            'layout/save/tabulator',
            SaveTabulatorLayoutController::class,
        );
    }

    public function hooks(): array
    {
        return [
            SetTabulatorColumns::class,
        ];
    }
}
