<?php

use App\Domains\Sale\Controllers\AdminApp\SaleController;
use Illuminate\Support\Facades\Route;

Route::prefix('v1/adminapp/tenant')
    ->middleware(['auth:sanctum', 'adminapp.tenant'])
    ->group(function (): void {
        Route::get('sales', [SaleController::class, 'index']);
        Route::get('sales/pdf', [SaleController::class, 'downloadPdf']);
        Route::get('sales/excel', [SaleController::class, 'downloadExcel']);
        Route::get('sales/modifications', [SaleController::class, 'modifications']);
        Route::get('sales/modifications/pdf', [SaleController::class, 'downloadModificationsPdf']);
        Route::get('sales/modifications/excel', [SaleController::class, 'downloadModificationsExcel']);
        Route::post('sales/{sale}/confirm', [SaleController::class, 'confirm'])->whereNumber('sale');
        Route::post('sales/{sale}/cancel', [SaleController::class, 'cancel'])->whereNumber('sale');
        Route::get('sales/{sale}/tickets', [SaleController::class, 'tickets'])->whereNumber('sale');
        Route::get('sales/{sale}', [SaleController::class, 'show'])->whereNumber('sale');
    });
