<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\StockManagement\StockController as AdminStockController;

Route::prefix("/")->group(function (){

    Route::get("/",[AdminStockController::class,"index"])->name("index");
    Route::post("create",[AdminStockController::class,"create"])->name("create");

    Route::post("edit/product-id",[AdminStockController::class, "editProductId"])->name("edit.product-id");
    Route::post("edit/lot-id",[AdminStockController::class, "editLotId"])->name("edit.lot-id");
    Route::post("edit/expired-at",[AdminStockController::class,"editExpiredAt"])->name("edit.expired-at");

    Route::name('list-on-warehouse.')->prefix("list-on-warehouse")->group(function (){
        Route::get("/",[AdminStockController::class,"listOnWarehouse"])->name("list");
        Route::get("group-by-product",[AdminStockController::class,"listGroupedByProduct"])->name("group-by-product");
    });

    Route::prefix("{stock}")->group(function (){
        //Route::get("/",[])->name("show");

        Route::post("update",[AdminStockController::class,"update"])->name("update");
        Route::put("delete",[AdminStockController::class,"delete"])->name("delete");

        Route::name('adjustments.')->prefix("adjustments")->group(function (){
            Route::get("/",[AdminStockController::class,"list"])->name("index");
            Route::post("create",[AdminStockController::class,"update"])->name("create");
        });
    });
});
