<?php

declare(strict_types=1);

use App\Core\Middleware\AuthMiddleware;
use App\Modules\Inventory\Presentation\Controllers\ItemAjaxController;
use App\Modules\Parties\Presentation\Controllers\PartyAjaxController;
use App\Modules\Purchases\Presentation\Controllers\SupplierOpenPurchaseInvoicesController;
use App\Modules\Sales\Presentation\Controllers\QuotationPriceController;

$router->get('/ajax/items/search', static function (): void { (new ItemAjaxController())->search(); }, [new AuthMiddleware()]);
$router->get('/ajax/items/info', static function (): void { (new ItemAjaxController())->info(); }, [new AuthMiddleware()]);
$router->get('/ajax/parties/search', static function (): void { (new PartyAjaxController())->search(); }, [new AuthMiddleware()]);
$router->get('/ajax/customers/search', static function (): void { (new PartyAjaxController())->customers(); }, [new AuthMiddleware()]);
$router->get('/ajax/suppliers/search', static function (): void { (new PartyAjaxController())->suppliers(); }, [new AuthMiddleware()]);
$router->get('/ajax/quotations/price', static function (): void { (new QuotationPriceController())->handle(); }, [new AuthMiddleware()]);
$router->get('/ajax/purchases/supplier-open-invoices', static function (): void { (new SupplierOpenPurchaseInvoicesController())->handle(); }, [new AuthMiddleware()]);
