<?php

use App\Http\Controllers\Medicine\CategoryController;
use App\Http\Controllers\Medicine\CustomerController;
use App\Http\Controllers\Medicine\LeafSettingController;
use App\Http\Controllers\Medicine\MedicineCompanyController;
use App\Http\Controllers\Medicine\MedicineController;
use App\Http\Controllers\Medicine\PurchaseController;
use App\Http\Controllers\Medicine\ShelfController;
use App\Http\Controllers\Medicine\SupplierController;
use App\Http\Controllers\Medicine\TypeController;
use App\Http\Controllers\Medicine\UnitController;
use App\Http\Controllers\User\UserController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| User Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
| Route prefix "api/user"
*/

/** Start Staff Sell Target */
Route::get('all_staff', [UserController::class, 'all_staff']);
Route::post('store_sell_target', [UserController::class, 'store_sell_target']);
Route::put('update_sell_target', [UserController::class, 'update_sell_target']);
/** End Staff Sell Target */
/** medicine company */
Route::put('medicine_company/{medicine_company}/change_status', [MedicineCompanyController::class, 'change_status']);
Route::resource('medicine_company', MedicineCompanyController::class)->except(['create']);
/** Supplier*/
Route::get('supplier/medicine_companies', [SupplierController::class, 'medicine_companies']);
Route::put('supplier/{supplier}/change_status', [SupplierController::class, 'change_status']);
Route::resource('supplier', SupplierController::class)->except(['create']);
/**  Category */
Route::put('category/{category}/change_status', [CategoryController::class, 'change_status']);
Route::resource('category', CategoryController::class)->except(['create']);
/**  Unit */
Route::put('unit/{unit}/change_status', [UnitController::class, 'change_status']);
Route::resource('unit', UnitController::class)->except(['create']);
/**  Type */
Route::put('type/{type}/change_status', [TypeController::class, 'change_status']);
Route::resource('type', TypeController::class)->except(['create']);
/**  Leaf Setting */
Route::resource('leaf_setting', LeafSettingController::class)->except(['create']);
/**  Shelf Setting */
Route::resource('shelf', ShelfController::class)->except(['create']);
/**  Medicine */
Route::get('medicine/all_active_categorical_data', [MedicineController::class, 'all_active_categorical_data']);
Route::put('medicine/{medicine}/change_status', [TypeController::class, 'change_status']);
Route::resource('medicine', MedicineController::class)->except(['create']);

/** Stock Manage */
Route::get('purchase/pre_required_data', [PurchaseController::class, 'pre_required_data']);
Route::get('purchase/search_medicine', [PurchaseController::class, 'search_medicine']);
Route::resource('purchase', PurchaseController::class)->except(['create', 'destroy']);
/** Customer */
Route::resource('customer', CustomerController::class)->except(['create', 'destroy']);
