<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'segment', 'as' => 'segment.', 'namespace' => 'Segments'], function () {
    Route::post('/create', 'CreateSegmentController@create')->name('create');
    Route::delete('/delete/{id}', 'DeleteSegmentController@destroy')->name('delete');
    Route::get('/{id}/show', 'FetchSegmentController@fetch')->name('show');
    Route::put('/update/{id}', 'UpdateSegmentController@update')->name('update');
    Route::put('price/update/{id}', 'UpdateSegmentPriceController@update')->name('price.update');
    Route::get('/list', 'ListSegmentsController@list')->name('list');

    Route::get('/air-shipment/item-price/list', 'ListAirShipmentPriceController@list')->name('air_shipment.price.list');

    Route::group(['prefix' => '{id}/constant', 'as' => 'constant.'], function () {
        Route::put('/service/update', 'UpdateCustomServiceConstantController@update')->name('service.update');
        Route::put('/update', 'UpdateConstantController@update')->name('update');
        Route::get('/show/{reference}', 'FetchConstantController@fetch')->name('show');
        Route::put('/update/postcode', 'UpdateConstantPostcodeController@update')->name('update.postcode');

        Route::post('base-price/create', 'CreateBasePriceController@create')->name('basePrice.create');
        Route::get('base-price/show', 'FetchBasePriceController@fetch')->name('basePrice.show');
    });
});