<?php

declare(strict_types=1);

namespace Apexl\Io\UserTabulator;

use Apexl\Io\Interfaces\ProvidesHooksInterface;
use Apexl\Io\Module;
use Apexl\Io\System\Interfaces\ProvidesRoutesInterface;
use Apexl\Io\UserTabulator\ConstantList\UserTabulator;
use Apexl\Io\UserTabulator\Controllers\SaveTabulatorLayoutController;
use Apexl\Io\UserTabulator\Hooks\SetTabulatorColumns;

readonly class UserTabulatorModule extends Module implements ProvidesRoutesInterface, ProvidesHooksInterface
{
    public function routes(): void
    {
        $this->post('/usertabulator/layout/save/tabulator', SaveTabulatorLayoutController::class)
            ->setName(UserTabulator::SAVE_LAYOUT);
    }

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