<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'order', 'as' => 'order.', 'namespace' => 'Orders'], function () {
    Route::get('/show/{id}', 'FetchOrderController@fetch')->name('show');
    Route::get('/list', 'ListOrdersController@list')->name('list');
    Route::post('/create', 'CreateOrderController@create')->name('create');
    Route::put('/confirm/{id}', 'ConfirmOrderController@confirm')->name('confirm');
    Route::put('/cancel/{id}', 'CancelOrderController@cancel')->name('cancel');
    Route::put('/restore/{id}', 'RestoreOrderController@restore')->name('restore');
    Route::post('/address/change/request', 'RequestChangeOrderAddressController@request')->name('address.change.request');
    Route::post('/update/{id}','UpdateOrderController@update')->name('reference.update');
    Route::put('/address/{id}/status/{status}', 'ApproveChangeOrderAddressController@approve')->name('address.status.update');

    Route::post('/create-warehouse-packing-list', 'CreateWarehousePackingListController@create')->name('create.warehouse.packing_list');
    Route::post('/create-shipping-packing-list', 'CreateShippingPackingListController@create')->name('create.shipping.packing_list');

    Route::put('/assign-remark/{id}', 'AssignOrderRemarkController@create')->name('assign.remark');
    Route::get('/{id}/shipping-cost', 'ShippingCostController@calculate')->name('shipping.cost');
    
    Route::post('/{id}/remark/create', 'CreateOrderRemarkController@create')->name('remark.create');
});
