<?php

declare(strict_types=1);

use App\Core\Middleware\AuthMiddleware;
use App\Core\Middleware\CsrfMiddleware;
use App\Controllers\PartyController;
use App\Modules\Parties\Presentation\Controllers\PartyViewController;

$router->get('/parties', static function (): void { (new PartyController())->handle('all'); }, [new AuthMiddleware()]);
$router->post('/parties', static function (): void { (new PartyController())->handle('all'); }, [new AuthMiddleware(), new CsrfMiddleware()]);
$router->get('/parties/customers', static function (): void { (new PartyController())->handle('customers'); }, [new AuthMiddleware()]);
$router->post('/parties/customers', static function (): void { (new PartyController())->handle('customers'); }, [new AuthMiddleware(), new CsrfMiddleware()]);
$router->get('/parties/suppliers', static function (): void { (new PartyController())->handle('suppliers'); }, [new AuthMiddleware()]);
$router->post('/parties/suppliers', static function (): void { (new PartyController())->handle('suppliers'); }, [new AuthMiddleware(), new CsrfMiddleware()]);
$router->get('/parties/view', static function (): void { (new PartyViewController())->show(); }, [new AuthMiddleware()]);
