<?php

use App\Http\Controllers\Modules\InventoryDashboardController;
use Illuminate\Support\Facades\Route;

Route::get('/manage-inventory', [InventoryDashboardController::class, 'manageInventory']);

Route::get('/add-new-inventory-items', [InventoryDashboardController::class, 'showAddNewInventoryItems']);
Route::post('/add-new-inventory-items', [InventoryDashboardController::class, 'storeAddNewInventoryItems']);

Route::get('/edit-item-details/{id}', [InventoryDashboardController::class, 'showEditInventoryItem']);
Route::post('/edit-item-details/{id}', [InventoryDashboardController::class, 'storeEditInventoryItem']);

Route::get('/search-inventory-item/{id?}', [InventoryDashboardController::class, 'searchInventoryItem']);

Route::get('/update-inventory-stock-balances', [InventoryDashboardController::class, 'showUpdateInventoryStockBalances']);
Route::post('/update-inventory-stock-balances', [InventoryDashboardController::class, 'storeUpdateInventoryStockBalances']);

Route::get('/update-item-inventory-stock-balance/{id}', [InventoryDashboardController::class, 'showUpdateItemInventoryStockBalance']);
Route::post('/update-item-inventory-stock-balance/{id}', [InventoryDashboardController::class, 'storeUpdateItemInventoryStockBalance']);

Route::get('/make-a-sale', [InventoryDashboardController::class, 'showMakeASale']);
Route::post('/make-a-sale', [InventoryDashboardController::class, 'storeMakeASale']);

Route::get('/get-inventory-details/{id?}', [InventoryDashboardController::class, 'getInventoryDetails']);
Route::get('/view-sold-items-on-receipt/{id?}', [InventoryDashboardController::class, 'getReceiptSoldItems']);

Route::get('/daily-sales', [InventoryDashboardController::class, 'showSalesReport']);
Route::post('/daily-sales', [InventoryDashboardController::class, 'showSalesReport']);

Route::get('/loaded-inventory-analysis', [InventoryDashboardController::class, 'showInventoryReport']);
Route::post('/loaded-inventory-analysis', [InventoryDashboardController::class, 'showInventoryReport']);

Route::get('/sold-out-items', [InventoryDashboardController::class, 'getSoldOutItems']);

Route::get('/inventory-analysis', [InventoryDashboardController::class, 'getCompanyInventoryAnalysis']);


/**Routes to Manage Purchase Orders**/
Route::get('/purchase-orders', [InventoryDashboardController::class, 'getPurchaseOrders']);
Route::get('/create-new-purchase-order', [InventoryDashboardController::class, 'showCreateNewPurchaseOrder']);
Route::post('/create-new-purchase-order', [InventoryDashboardController::class, 'storeCreateNewPurchaseOrder']);

Route::get('/add-items-to-purchase-order/{id}', [InventoryDashboardController::class, 'showAddItemsToPurchaseOrder']);
Route::post('/add-items-to-purchase-order/{id}', [InventoryDashboardController::class, 'storeAddItemsToPurchaseOrder']);
Route::get('/get-inventory-details-for-purchase-order/{id?}', [InventoryDashboardController::class, 'getInventoryDetailsForPurchaseOrder']);
Route::delete('/delete-purchase-order-item/{id}', [InventoryDashboardController::class, 'deleteItemFromPurchaseOrder']);
Route::get('/edit-purchase-order-item/{id}', [InventoryDashboardController::class, 'showEditToPurchaseOrderItem']);
Route::post('/edit-purchase-order-item/{id}', [InventoryDashboardController::class, 'storeEditToPurchaseOrderItem']);
Route::get('/view-and-print-purchase-order/{id}', [InventoryDashboardController::class, 'viewPurchaseOrderItems']);

