<?php

use App\Domains\Budget\Controllers\DeleteController;
use App\Domains\Budget\Controllers\SaveController;
use App\Domains\Budget\Controllers\ListController;
use App\Middleware\IdentifyTenant;
use Illuminate\Support\Facades\Route;

Route::prefix('api/v1')->group(function () {
    Route::middleware(IdentifyTenant::class)->group(function () {
        Route::prefix('budget')->group(function () {
            Route::middleware(['auth'])->group(function () {
                Route::prefix('/{costUnitId}')->group(function () {
                    Route::get('/list/{estimateType}', ListController::class);
                    Route::get('{estimateId}/delete', DeleteController::class);
                    Route::post('/save-estimate', SaveController::class);
                });
            });
        });
    });
});
