<?php

use Illuminate\Support\Facades\Route;
use App\Modules\Sales\Controllers\SalesImportController;

Route::middleware(['auth', 'verified'])->prefix('sales')->name('sales-imports.')->group(function () {
    Route::middleware('permission:sales_imports.view')->group(function () {
        Route::get('/imports', [SalesImportController::class, 'index'])->name('index');
        Route::get('/imports/{import}', [SalesImportController::class, 'show'])->name('show');
    });

    Route::post('/imports', [SalesImportController::class, 'store'])->middleware('permission:sales_imports.create')->name('store');
    
    Route::post('/imports/{import}/confirm', [SalesImportController::class, 'confirm'])->middleware('permission:sales_imports.confirm')->name('confirm');
    Route::delete('/imports/{import}', [SalesImportController::class, 'destroy'])->middleware('permission:sales_imports.delete')->name('destroy');
});
