<?php

use Illuminate\Support\Facades\Route;

$proxy_url = getenv("PROXY_URL");
$proxy_schema = getenv("PROXY_SCHEMA");

if (!empty($proxy_url)) {
    URL::forceRootUrl($proxy_url);
}

if (!empty($proxy_schema)) {
    URL::forceScheme($proxy_schema);
}

/*
    |--------------------------------------------------------------------------
    | Web Routes
    |--------------------------------------------------------------------------
    |
    | Here is where you can register web routes for your application. These
    | routes are loaded by the RouteServiceProvider within a group which
    | contains the "web" middleware group. Now create something great!
    |
    */
// Route::prefix("gps")->group(function () {
Route::get("/login", "AuthController@view_login")->name("view_login");
Route::get("/admin", "AuthController@view_login_admin")->name("login_admin");
Route::get("/client", "AuthController@view_login_client")->name("login_client");
Route::get("/vendor", "AuthController@view_login_vendor")->name("login_vendor");
Route::get("/checker", "AuthController@view_login_checker")->name("login_checker");
Auth::routes([
    "register" => false,
    // 'reset' => false,
    // 'verify' => false,
]);
// Route::get('/home', 'HomeController@index')->name('home');

Route::middleware(["auth", "auth.user"])->group(function () {
    /**
     * START VIEWS
     */
    Route::get("/", "HomeController@check_redirect")->name("view_dashboard_0");
    Route::get("/home", "HomeController@check_redirect")->name("view_dashboard_1");

    Route::get("/transactions", "MenuController@view_transactions")
        ->name("view_transactions")
        ->middleware("permission:transaction.view");

    Route::get("/transactions/confirm", "MenuController@view_transactions_confirm")->name(
        "view_transactions_confirm"
    );
    Route::get("/transactions/view", "MenuController@view_transactions_view")
        ->name("view_transactions_view")
        ->middleware("permission:transaction.view");

    Route::get("/transactions/add", "MenuController@view_transactions_add")
        ->name("view_transactions_add")
        ->middleware("permission:transaction.create");

    Route::get("/transactions/download_do", "TransactionController@view_transactions_download_do")->name(
        "view_transactions_download_do"
    );
    Route::get(
        "/transactions/download_invoice",
        "TransactionController@view_transactions_download_invoice"
    )->name("view_transactions_download_invoice");
    Route::get(
        "/transactions/download_payout",
        "TransactionController@view_transactions_download_payout"
    )->name("view_transactions_download_payout");
    Route::get(
        "/transactions/download_report_pickup",
        "TransactionController@view_transactions_download_report_pickup"
    )->name("view_transactions_download_report_pickup");
    Route::get(
        "/transactions/download_report_drop",
        "TransactionController@view_transactions_download_report_drop"
    )->name("view_transactions_download_report_drop");
    Route::get(
        "/transactions/download_report_acdnt",
        "TransactionController@view_transactions_download_report_acdnt"
    )->name("view_transactions_download_report_acdnt");
    Route::get("/transactions/download_spk", "TransactionController@view_transactions_download_spk")->name(
        "view_transactions_download_spk"
    );
    Route::get(
        "/transactions/download_summary",
        "TransactionController@view_transactions_download_summary"
    )->name("view_transactions_download_summary");
    // new
    Route::get("/transactions/add/special", "TransactionSpcController@view_transactions_spc_add")->name(
        "view_transactions_spc_add"
    );
    // ./new

    Route::get("/clients", "ClientController@view_clients")
        ->name("view_clients")
        ->middleware("permission:client.view");
    Route::get("/zone", "ZoneController@view_zone")
        ->name("view_zone")
        ->middleware("permission:zone.view");
    Route::get("/zone/add", "ZoneController@view_zone_add")
        ->name("view_zone_add")
        ->middleware("permission:zone.create");
    Route::get("/zone/edit/{zid}", "ZoneController@view_zone_edit")
        ->name("view_zone_edit")
        ->middleware("permission:zone.edit");
    Route::get("/dashboard", "MenuController@view_dashboard")
        ->name("view_dashboard")
        ->middleware("permission:dashboard.view");
    Route::get("/drivers", "MenuController@view_drivers")
        ->name("view_drivers")
        ->middleware("permission:driver.view");

    Route::get("/vehicles", "MenuController@view_vehicles")
        ->name("view_vehicles")
        ->middleware("permission:vehicle.view");

    Route::get("/users", "UsersController@view_users")
        ->name("view_users")
        ->middleware("permission:user.view");
    Route::get("/users/logs", "UsersController@view_user_logs1")->name("view_user_logs1");
    Route::get("/api/users/logs", "UsersController@api_user_logs1")->name("api_user_logs1");

    Route::get("/user-logs", "UserLogsController@view_user_logs")->name("view_user_logs");
    Route::get("/api/user-logs", "UserLogsController@api_user_logs")->name("api_user_logs");

    Route::get("/roles", "RolesController@view")
        ->name("view_roles")
        ->middleware("permission:role.view");

    Route::get("/profile", "UsersController@view_profile")->name("view_profile");
    Route::get("/config/rates", "ConfRateController@view_rates")->name("view_config_rates");
    Route::get("/config/pocket", "PocketController@view_pockets")->name("view_config_pockets");
    Route::get("/config/insurances", "InsuranceController@view_insurances")->name("view_config_insurances");
    Route::get("/config/static_insurances", "StaticInsuranceController@view_static_insurances")->name(
        "view_config_static_insurances"
    );
    Route::get("/config/truck_types", "ConfTruckTypeController@view_truck_types")
        ->name("view_config_truck_types")
        ->middleware("permission:config_truck_type.view");

    Route::get("/config/devices", "DevicesController@view_devices")
        ->name("view_config_devices")
        ->middleware("permission:config_master_device.view");

    Route::get("/config/logs_gps", "MenuController@view_logs_gps")
        ->name("view_config_logs_gps")
        ->middleware("permission:config_logs_gps.view");

    Route::get("/config/a_items", "AItemsController@view_a_items")->name("view_adm_a_items");
    Route::get("/config/menu_permissions", "UsersMenuPermissionsController@view_menu_permissions")->name(
        "view_adm_menu_permissions"
    );
    Route::get("/config/logbook_types", "LogbookTypesController@view_lgb_types")->name(
        "view_config_lgb_types"
    );
    Route::get("/config/logbook_keys", "LogbookKeysController@view_lgb_keys")->name("view_config_lgb_keys");

    // config distribution category
    Route::get("/config/distribution_category", "ConfDistributionController@view_distribution_category")
        ->name("view_config_distribution_category")
        ->middleware("permission:config_distribution_category.view");
    Route::post("/api/conf/distribution_category", "ConfDistributionController@api_add_distribution_category")->name("api_conf_add_distribution_category");
    Route::get("/api/conf/distribution_category", "ConfDistributionController@api_list_distribution_category")->name("api_conf_list_distribution_category");
    Route::get("/api/conf/distribution_category/{id}", "ConfDistributionController@api_show_distribution_category")->name("api_conf_show_distribution_category");
    Route::delete("/api/conf/distribution_category/{id}", "ConfDistributionController@api_del_distribution_category")->name("api_conf_del_distribution_category");

    // config pool
    Route::get("/config/pool", "ConfPoolController@view_pool")
        ->name("view_config_pool")
        ->middleware("permission:config_pool.view");
    Route::post("/api/conf/pool", "ConfPoolController@api_add_pool")->name("api_conf_add_pool");
    Route::get("/api/conf/pool", "ConfPoolController@api_list_pool")->name("api_conf_list_pool");
    Route::get("/api/conf/pool/{id}", "ConfPoolController@api_show_pool")->name("api_conf_show_pool");
    Route::delete("/api/conf/pool/{id}", "ConfPoolController@api_del_pool")->name("api_conf_del_pool")->middleware("permission:config_pool.delete");


    // reports
    Route::get("/reports/vehicle-trips", "ReportsController@view_report_vehicle_trips")->name("view_report_vehicle_trips");
    Route::get("/reports/vehicle-trips-list", "ReportsController@api_report_vehicle_trips_list")->name("api_report_vehicle_trips_list");
    Route::get("/reports/vehicle-trip-detail", "ReportsController@view_report_trip_detail")->name("view_report_trip_detail");
    Route::get("/reports/abnormalities", "ReportsController@view_report_abnormalities")->name("view_report_abnormalities");
    Route::get("/reports/abnormalities-list", "ReportsController@api_report_abnormalities_list")->name("api_report_abnormalities_list");
    // media
    Route::get("/media", "MediaController@view_media")
        ->name("view_media")
        ->middleware("permission:media.view");
    Route::get("/api/media", "MediaController@api_get_media")->name("api_get_media");


    Route::get("/user/vendor/transactions", "MenuController@view_user_vendor_transaction")->name(
        "view_user_vendor_transaction"
    );
    Route::get("/user/vendor/transactions/view", "MenuController@view_user_vendor_transaction_view")->name(
        "view_user_vendor_transaction_view"
    );
    Route::get(
        "/user/vendor/transactions/newOrder",
        "MenuController@view_user_vendor_transaction_new_order"
    )->name("view_user_vendor_transaction_new_order");
    // Route::get('/user/vendor/transactions/newOrder', 'MenuController@view_user_vendor_transaction_new_order_v1')->name('view_user_vendor_transaction_new_order_v1');
    Route::get(
        "/user/vendor/transactions/download_do",
        "TransactionController@view_transactions_download_do"
    )->name("view_user_vendor_transactions_download_do");
    Route::get(
        "/user/vendor/transactions/download_spk",
        "TransactionController@view_transactions_download_spk"
    )->name("view_user_vendor_transactions_download_spk");
    Route::get(
        "/user/vendor/transactions/download_summary",
        "TransactionController@view_transactions_download_summary"
    )->name("view_user_vendor_transactions_download_summary");

    Route::get("/user/clients/transactions", "MenuController@view_user_client_transaction")->name(
        "view_user_client_transaction"
    );
    Route::get("/user/clients/transactions/view", "MenuController@view_user_client_transaction_view")->name(
        "view_user_client_transaction_view"
    );
    Route::get("/user/clients/transactions/addNew", "MenuController@view_user_client_transaction_add")->name(
        "view_user_client_transaction_add"
    );

    Route::get("/user/checker", "MenuController@view_user_checker")->name("view_user_checker");
    Route::get("/user/checker/view", "MenuController@view_user_checker_view")->name("view_user_checker_view");
    Route::get("/user/checker/edt_zone", "ZoneController@view_user_checker_zone_edit")->name(
        "view_user_checker_zone_edit"
    );
    Route::get(
        "/user/checker/transactions/download_spk",
        "TransactionController@view_transactions_download_spk"
    )->name("view_user_checker_transactions_download_spk");

    // Finance
    Route::get("/finance/payment/paymentList", "MenuController@view_keuangan_payment")->name(
        "view_keuangan_payment"
    );
    Route::get("/finance/payment/paymentList/view", "MenuController@view_keuangan_payment_view")->name(
        "view_keuangan_payment_view"
    );
    Route::get("/finance/billing/billingList", "MenuController@view_keuangan_billing")->name(
        "view_keuangan_billing"
    );
    Route::get("/finance/billing/billingList/view", "MenuController@view_keuangan_billing_view")->name(
        "view_keuangan_billing_view"
    );
    Route::get("/finance/ledgerBalance/ledgerBalanceList", "FinanceController@view_ledger_balance")->name(
        "view_ledger_balance"
    );
    Route::get("/finance/download_invoice", "FinanceController@view_finance_download_invoice")->name(
        "view_finance_download_invoice"
    );
    Route::get("/finance/pocket_tf_history", "FinanceController@view_pocket_tf_history")->name(
        "view_fiinance_pocket_tf_history"
    );
    // config
    Route::get("/finance/config/a_items", "AItemsController@view_a_items")->name("view_a_items");
    Route::get("/finance/config/dana", "DanaController@view_dana")->name("view_finance_dana");

    /**
     * END VIEWSapi_universal_show_client_pt
     */

    /**
     * START API
     */

    Route::get("/api/tracks/vehicles/current", "TrackController@api_list_currect_track_vhc")->name(
        "api_list_currect_track_vhc"
    );
    Route::get("/api/tracks/vehicles/last_move", "TrackController@api_last_move_track_vhc")->name(
        "api_last_move_track_vhc"
    );
    Route::get("/api/tracks/orders", "TrackController@api_track_order")->name("api_track_order");

    Route::get("/api/clients", "ClientController@api_list_clients")->name("api_list_clients");
    Route::get("/api/clients/{cid}", "ClientController@api_show_client")->name("api_show_client");
    Route::get("/api/universal/clients/show", "ClientController@api_universal_show_client_pt")->name(
        "api_universal_show_client_pt"
    );
    Route::post("/api/clients", "ClientController@api_add_client")->name("api_add_client");
    Route::put("/api/clients/{cid}", "ClientController@api_edit_client")->name("api_edit_client");
    Route::delete("/api/clients/{cid}", "ClientController@api_del_client")->name("api_del_client");

    Route::get("/api/users", "UsersController@api_list_users")->name("api_list_users");
    Route::get("/api/users/{uid}", "UsersController@api_show_user")->name("api_show_user");
    Route::post("/api/users", "UsersController@api_add_user")->name("api_add_user");
    Route::put("/api/users/{uid}", "UsersController@api_edit_user")->name("api_edit_user");
    Route::put("/api/users/profile/{uid}", "UsersController@api_edit_user_profile")->name(
        "api_edit_user_profile"
    );
    Route::delete("/api/users/{uid}", "UsersController@api_del_user")->name("api_del_user");
    Route::post("/api/users/search/name", "UsersController@api_search_user_name")->name(
        "api_search_user_name"
    );

    Route::get("/api/roles", "RolesController@api_list")->name("api_list_roles");
    Route::get("/api/roles/{uid}", "RolesController@api_show")->name("api_show_role");
    Route::post("/api/roles", "RolesController@api_add")->name("api_add_role");
    Route::put("/api/roles/{uid}", "RolesController@api_edit")->name("api_edit_role");
    Route::delete("/api/roles/{uid}", "RolesController@api_del")->name("api_del_role");
    Route::post("/api/roles/search", "RolesController@api_search")->name("api_search_role");

    Route::get("/api/drivers", "DriversController@api_list_drivers")->name("api_list_drivers");
    Route::get("/api/drivers/{did}", "DriversController@api_show_driver")->name("api_show_driver");
    Route::post("/api/drivers", "DriversController@api_add_driver")->name("api_add_driver");
    Route::put("/api/drivers/{did}", "DriversController@api_edit_driver")->name("api_edit_driver");
    Route::delete("/api/drivers/{did}", "DriversController@api_del_driver")->name("api_del_driver");
    Route::post("/api/drivers/search/name", "DriversController@api_search_driver_name")->name(
        "api_search_driver_name"
    );
    Route::delete(
        "/api/drivers/api_reset_login_driver/{did}",
        "DriversController@api_reset_login_driver"
    )->name("api_reset_login_driver");

    Route::get("/api/vehicles", "VehiclesController@api_list_vehicles")->name("api_list_vehicles");
    Route::get("/api/vehicles1", "VehiclesController@api_list_vehicles1")->name("api_list_vehicles1");
    Route::get("/api/vehicles/{vid}", "VehiclesController@api_show_vehicle")->name("api_show_vehicle");
    Route::post("/api/vehicles", "VehiclesController@api_add_vehicle")->name("api_add_vehicle");
    Route::put("/api/vehicles/{vid}", "VehiclesController@api_edit_vehicle")->name("api_edit_vehicle");
    Route::delete("/api/vehicles/{vid}", "VehiclesController@api_del_vehicle")->name("api_del_vehicle");
    Route::post("/api/vehicles/search/device_id", "VehiclesController@api_search_device_id")->name(
        "api_search_device_id"
    );
    Route::post("/api/vehicles/search/nopol", "VehiclesController@api_search_nopol")->name(
        "api_search_nopol"
    );

    Route::get("/api/zones", "ZoneController@api_list_zones")->name("api_list_zones");
    Route::get("/api/zones/{zid}", "ZoneController@api_show_zone")->name("api_show_zone");
    Route::post("/api/zones", "ZoneController@api_add_zone")->name("api_add_zone");
    Route::put("/api/zones/{zid}", "ZoneController@api_edit_zone")->name("api_edit_zone");
    Route::delete("/api/zones/{zid}", "ZoneController@api_del_zone")->name("api_del_zone");
    Route::post("/api/zones/list/clients", "ZoneController@api_list_client_zones")->name(
        "api_list_client_zones"
    );
    Route::get("/api/zones/list/checkpoints", "ZoneController@api_list_checkpoints")->name(
        "api_list_checkpoints"
    );
    // universal
    Route::get("/api/universal/zones/list", "ZoneController@api_universal_list_zones")->name(
        "api_universal_list_zones"
    );
    // checker change zone
    Route::post("/api/user/checker/zones/list/clients", "ZoneController@api_list_client_zones")->name(
        "api_checker_list_client_zones"
    );
    Route::put("/api/user/checker/change_zone", "ZoneController@api_user_checker_change_zone")->name(
        "api_user_checker_change_zone"
    );
    Route::put(
        "/api/user/checker/change_zone_by_zid",
        "ZoneController@api_user_checker_change_zone_by_zid"
    )->name("api_user_checker_change_zone_by_zid");
    // end checker change zone

    // client trx
    Route::post(
        "api/user/clients/transactions/check_packing_list",
        "TransactionController@api_check_packing_list"
    )->name("api_user_client_check_packing_list");
    Route::post("api/user/clients/transactions/checkout_v1", "TransactionController@api_checkout_v1")->name(
        "api_user_client_checkout_v1"
    );
    Route::post("api/user/clients/transactions/checkout_v2", "TransactionController@api_checkout_v2")->name(
        "api_user_client_checkout_v2"
    );
    Route::post(
        "api/user/clients/transactions/create_order_v1",
        "TransactionController@api_create_order_v1"
    )->name("api_user_client_create_order_v1");
    Route::post(
        "api/user/clients/transactions/create_order_v2",
        "TransactionController@api_create_order_v2"
    )->name("api_user_client_create_order_v2");
    Route::get("api/user/clients/transactions/list_orders", "TransactionController@api_list_orders")->name(
        "api_user_client_list_orders"
    );
    Route::get(
        "api/user/clients/transactions/download_package_list/{ord_id}",
        "TransactionController@api_download_package_list"
    )->name("api_user_client_download_package_list");
    // admin trx
    Route::get("api/transactions/list_orders", "TransactionController@api_list_orders")->name(
        "api_list_orders"
    );
    Route::get(
        "api/transactions/download_package_list/{ord_id}",
        "TransactionController@api_download_package_list"
    )->name("api_download_package_list");
    Route::get("api/transactions/show_order/{ord_id}", "TransactionController@api_show_order")->name(
        "api_show_order"
    );
    Route::post("api/transactions/adm_find_driver", "TransactionController@api_adm_find_driver")->name(
        "api_adm_find_driver"
    );
    Route::post(
        "api/transactions/api_adm_assign_vendor",
        "TransactionController@api_adm_assign_vendor"
    )->name("api_adm_assign_vendor");
    Route::post("api/transactions/adm_confirm_price", "TransactionController@api_adm_confirm_price")->name(
        "api_adm_confirm_price"
    );
    Route::post("api/transactions/adm_invc_to_client", "TransactionController@api_adm_invc_to_client")->name(
        "api_adm_invc_to_client"
    );
    Route::post(
        "api/transactions/adm_confirm_client_pay",
        "TransactionController@api_adm_confirm_client_pay"
    )->name("api_adm_confirm_client_pay");
    Route::post(
        "api/transactions/adm_payout_to_vendor",
        "TransactionController@api_adm_payout_to_vendor"
    )->name("api_adm_payout_to_vendor");
    Route::post(
        "api/transactions/adm_confirm_vendor_pay",
        "TransactionController@api_adm_confirm_vendor_pay"
    )->name("api_adm_confirm_vendor_pay");
    Route::post("api/transactions_spc/checkout_v1", "TransactionSpcController@api_trx_spc_checkout_v1")->name(
        "api_trx_spc_checkout_v1"
    );
    Route::post(
        "api/transactions_spc/create_order_v1",
        "TransactionSpcController@api_trx_spc_create_order_v1"
    )->name("api_trx_spc_create_order_v1");
    Route::delete("api/transactions/delete_order/{ord_id}", "TransactionController@api_delete_order")->name(
        "api_delete_order"
    );
    // vendor trx
    Route::get("api/user/vendor/transactions/list_orders", "TransactionController@api_list_orders")->name(
        "api_user_vendor_list_orders"
    );
    Route::get(
        "api/user/vendor/transactions/download_package_list/{ord_id}",
        "TransactionController@api_download_package_list"
    )->name("api_user_vendor_download_package_list");
    Route::post(
        "api/user/vendor/transactions/want_this_order_v1",
        "TransactionController@api_want_this_order_v1"
    )->name("api_user_vendor_want_this_order_v1");
    Route::post(
        "api/user/vendor/transactions/accept_order_v1",
        "TransactionController@api_accept_order_v1"
    )->name("api_user_vendor_accept_order_v1");
    // checker trx
    Route::get("api/user/checker/transactions/list_orders", "TransactionController@api_list_orders")->name(
        "api_user_checker_list_orders"
    );
    Route::post(
        "api/user/checker/transactions/submit_items",
        "TransactionController@api_checker_submit_items"
    )->name("api_user_checker_submit_items");
    Route::post(
        "api/user/checker/transactions/submit_pickup",
        "TransactionController@api_checker_submit_pickup"
    )->name("api_checker_submit_pickup");
    Route::post(
        "api/user/checker/transactions/submit_drop",
        "TransactionController@api_checker_submit_drop"
    )->name("api_checker_submit_drop");
    Route::post(
        "api/user/checker/transactions/submit_accident",
        "TransactionController@api_checker_submit_accident"
    )->name("api_checker_submit_accident");
    Route::post("api/user/checker/transactions/aprv_pck", "TransactionController@api_checker_aprv_pck")->name(
        "api_checker_aprv_pck"
    );
    Route::post(
        "api/user/checker/transactions/recreate_pocket",
        "TransactionController@api_recreate_pocket"
    )->name("api_recreate_pocket");
    // finance trx
    Route::post(
        "api/finance/transactions/change_pic_invoice",
        "TransactionController@api_change_pic_invoice"
    )->name("api_change_pic_invoice");
    // end trx

    // finance
    Route::get("api/finance/list_billings", "FinanceController@api_finance_list_billings")->name(
        "api_finance_list_billings"
    );
    Route::get("api/finance/list_payments", "FinanceController@api_finance_list_payments")->name(
        "api_finance_list_payments"
    );
    Route::get(
        "api/finance/list_ledger_balances",
        "FinanceController@api_finance_list_ledger_balances"
    )->name("api_finance_list_ledger_balances");
    Route::get(
        "api/finance/list_adt_items_payments",
        "FinanceController@api_finance_list_adt_items_payments"
    )->name("api_finance_list_adt_items_payments");
    Route::get("api/finance/show_a_item/{ord_a_item_id}", "FinanceController@api_finance_show_a_item")->name(
        "api_finance_show_a_item"
    );
    Route::post("api/finance/add_a_items", "FinanceController@api_finance_add_a_items")->name(
        "api_finance_add_a_items"
    );
    Route::put("api/finance/pay_a_items/{ord_a_item_id}", "FinanceController@api_finance_pay_a_items")->name(
        "api_finance_pay_a_items"
    );
    Route::post("api/finance/crt_updt_invc", "FinanceController@api_finance_crt_updt_invc")->name(
        "api_finance_crt_updt_invc"
    );
    Route::post("api/finance/finance_crt_updt_tax", "FinanceController@api_finance_crt_updt_tax")->name(
        "api_finance_crt_updt_tax"
    );
    Route::put("api/finance/confirm_invc", "FinanceController@api_finance_confirm_invc")->name(
        "api_finance_confirm_invc"
    );
    Route::put("api/finance/save_note/{ord_id}", "FinanceController@api_finance_save_note")->name(
        "api_finance_save_note"
    );
    Route::delete(
        "api/finance/del_a_items/{ord_a_item_id}",
        "FinanceController@api_finance_del_a_items"
    )->name("api_finance_del_a_items");
    Route::put(
        "api/finance/reject_a_items/{ord_a_item_id}",
        "FinanceController@api_finance_reject_a_items"
    )->name("api_finance_rjct_a_items");
    Route::post(
        "api/finance/merge_a_items/{ord_a_item_id}",
        "FinanceController@api_finance_merger_a_items"
    )->name("api_finance_merger_a_items");
    Route::get("api/finance/pocket_tf_history", "FinanceController@api_list_pocket_tf_history")->name(
        "api_finance_list_pocket_tf_history"
    );
    Route::post("api/finance/resend_pocket", "FinanceController@api_resend_pocket")->name(
        "api_finance_resend_pocket"
    );
    // finance for admin
    Route::get(
        "api/admin/finance/list_adt_items_payments",
        "FinanceController@api_finance_list_adt_items_payments"
    )->name("api_finance_adm_list_adt_items_payments");
    Route::get(
        "api/admin/finance/show_a_item/{ord_a_item_id}",
        "FinanceController@api_finance_show_a_item"
    )->name("api_finance_adm_show_a_item");
    Route::post("api/admin/finance/add_a_items", "FinanceController@api_finance_add_a_items")->name(
        "api_finance_adm_add_a_items"
    );
    Route::put(
        "api/admin/finance/updt_a_items/{ord_a_item_id}",
        "FinanceController@api_finance_updt_a_items"
    )->name("api_finance_adm_updt_a_items");
    Route::delete(
        "api/admin/finance/del_a_items/{ord_a_item_id}",
        "FinanceController@api_finance_del_a_items"
    )->name("api_finance_adm_del_a_items");
    Route::post("api/admin/finance/merge_trx", "FinanceController@api_finance_merger_trx")->name(
        "api_finance_merger_trx"
    );
    // end finance

    Route::get("/api/conf/rates", "ConfRateController@api_list_rates")->name("api_conf_list_rates");
    Route::get("/api/conf/rates/{rid}", "ConfRateController@api_show_rate")->name("api_conf_show_rate");
    Route::post("/api/conf/rates", "ConfRateController@api_add_rate")->name("api_conf_add_rate");
    Route::put("/api/conf/rates/{rid}", "ConfRateController@api_edit_rate")->name("api_conf_edit_rate");
    Route::delete("/api/conf/rates/{rid}", "ConfRateController@api_del_rate")->name("api_conf_del_rate");

    Route::get("/api/pocket", "PocketController@api_list_pockets")->name("api_list_pockets");
    Route::get("/api/pocket/{pocket_id}", "PocketController@api_show_pocket")->name("api_show_pocket");
    Route::post("/api/pocket", "PocketController@api_add_pocket")->name("api_add_pocket");
    Route::put("/api/pocket/{pocket_id}", "PocketController@api_edit_pocket")->name("api_edit_pocket");
    Route::delete("/api/pocket/{pocket_id}", "PocketController@api_del_pocket")->name("api_del_pocket");
    Route::post("/api/pocket/pck_drop", "PocketController@api_pck_drop_pocket")->name("api_pck_drop_pocket");
    // checker
    Route::post("/api/user/checker/get_pocket", "PocketController@api_pck_drop_pocket")->name(
        "api_checker_get_pocket"
    );
    // checker

    Route::get("/api/insurances", "InsuranceController@api_list_insurances")->name("api_list_insurances");
    Route::get("/api/insurances/{iid}", "InsuranceController@api_show_insurance")->name("api_show_insurance");
    Route::post("/api/insurances", "InsuranceController@api_add_insurance")->name("api_add_insurance");
    Route::put("/api/insurances/{iid}", "InsuranceController@api_edit_insurance")->name("api_edit_insurance");
    Route::delete("/api/insurances/{iid}", "InsuranceController@api_del_insurance")->name(
        "api_del_insurance"
    );

    Route::get("/api/static_insurances", "StaticInsuranceController@api_list_static_insurances")->name(
        "api_list_static_insurances"
    );
    Route::get("/api/static_insurances/{id}", "StaticInsuranceController@api_show_static_insurance")->name(
        "api_show_static_insurance"
    );
    Route::put("/api/static_insurances/{id}", "StaticInsuranceController@api_edit_static_insurance")->name(
        "api_edit_static_insurance"
    );

    Route::get("/api/conf/truck_types", "ConfTruckTypeController@api_list_truck_types")->name(
        "api_conf_list_truck_types"
    );
    Route::get("/api/conf/truck_types/{ttid}", "ConfTruckTypeController@api_show_truck_type")->name(
        "api_conf_show_truck_type"
    );
    Route::post("/api/conf/truck_types", "ConfTruckTypeController@api_add_truck_type")->name(
        "api_conf_add_truck_type"
    );
    Route::put("/api/conf/truck_types/{ttid}", "ConfTruckTypeController@api_edit_truck_type")->name(
        "api_conf_edit_truck_type"
    );
    Route::delete("/api/conf/truck_types/{ttid}", "ConfTruckTypeController@api_del_truck_type")->name(
        "api_conf_del_truck_type"
    );

    Route::get("/api/devices", "DevicesController@api_list_devices")->name("api_list_devices");
    Route::get("/api/devices/{id}", "DevicesController@api_show_device")->name("api_show_device");
    Route::post("/api/devices", "DevicesController@api_add_device")->name("api_add_device");
    Route::put("/api/devices/{id}", "DevicesController@api_updt_device")->name("api_updt_device");
    Route::delete("/api/devices/{id}", "DevicesController@api_del_device")->name("api_del_device");

    Route::get("/api/a_items", "AItemsController@api_list_a_items")->name("api_list_a_items");
    Route::get("/api/a_items/{id}", "AItemsController@api_show_a_items")->name("api_show_a_items");
    Route::post("/api/a_items", "AItemsController@api_add_a_items")->name("api_add_a_items");
    Route::put("/api/a_items/{id}", "AItemsController@api_updt_a_items")->name("api_updt_a_items");
    Route::delete("/api/a_items/{id}", "AItemsController@api_del_a_items")->name("api_del_a_items");

    Route::get("/api/conf/logs_gps", "TrackController@api_conf_list_logs_gps")->name(
        "api_conf_list_logs_gps"
    );

    Route::post("/api/osm/geo_addr", "OSMController@api_geo_addr")->name("api_osm_geo_addr");

    Route::get("/api/region/list_city", "RegionController@api_list_city")->name("api_region_list_city");
    Route::get("/api/region/list_district", "RegionController@api_list_district")->name(
        "api_region_list_district"
    );
    Route::get("/api/region/list_village", "RegionController@api_list_village")->name(
        "api_region_list_village"
    );

    Route::get("/api/menu_permissions", "UsersMenuPermissionsController@api_list_menu_permissions")->name(
        "api_list_menu_permissions"
    );
    Route::get(
        "/api/menu_permissions/{id}",
        "UsersMenuPermissionsController@api_show_menu_permissions"
    )->name("api_show_menu_permissions");
    Route::post("/api/menu_permissions", "UsersMenuPermissionsController@api_add_menu_permissions")->name(
        "api_add_menu_permissions"
    );
    Route::put(
        "/api/menu_permissions/{id}",
        "UsersMenuPermissionsController@api_updt_menu_permissions"
    )->name("api_updt_menu_permissions");
    Route::delete(
        "/api/menu_permissions/{id}",
        "UsersMenuPermissionsController@api_del_menu_permissions"
    )->name("api_del_menu_permissions");

    Route::get("/api/lgb_types", "LogbookTypesController@api_list_lgb_types")->name("api_list_lgb_types");
    Route::get("/api/lgb_types/{lgb_type_id}", "LogbookTypesController@api_show_lgb_type")->name(
        "api_show_lgb_type"
    );
    Route::post("/api/lgb_types", "LogbookTypesController@api_add_lgb_type")->name("api_add_lgb_type");
    Route::put("/api/lgb_types/{lgb_type_id}", "LogbookTypesController@api_edit_lgb_type")->name(
        "api_edit_lgb_type"
    );
    Route::delete("/api/lgb_types/{lgb_type_id}", "LogbookTypesController@api_del_lgb_type")->name(
        "api_del_lgb_type"
    );
    Route::get("/api/lgb_types/selection", "LogbookTypesController@api_selection_lgb_types")->name(
        "api_selection_lgb_types"
    );

    Route::get("/api/lgb_keys", "LogbookKeysController@api_list_lgb_keys")->name("api_list_lgb_keys");
    Route::get("/api/lgb_keys/{lgb_key_id}", "LogbookKeysController@api_show_lgb_key")->name(
        "api_show_lgb_key"
    );
    Route::post("/api/lgb_keys", "LogbookKeysController@api_add_lgb_key")->name("api_add_lgb_key");
    Route::put("/api/lgb_keys/{lgb_key_id}", "LogbookKeysController@api_edit_lgb_key")->name(
        "api_edit_lgb_key"
    );
    Route::delete("/api/lgb_keys/{lgb_key_id}", "LogbookKeysController@api_del_lgb_key")->name(
        "api_del_lgb_key"
    );

    Route::get("/api/dtypes", "DataTypesController@api_list_dtypes")->name("api_list_dtypes");
    Route::get("/api/dtypes/{dtypes_id}", "DataTypesController@api_show_dtypes")->name("api_show_dtypes");
    Route::post("/api/dtypes", "DataTypesController@api_add_dtypes")->name("api_add_dtypes");
    Route::put("/api/dtypes/{dtypes_id}", "DataTypesController@api_edit_dtypes")->name("api_edit_dtypes");
    Route::delete("/api/dtypes/{dtypes_id}", "DataTypesController@api_del_dtypes")->name("api_del_dtypes");

    Route::put("/api/dana/{dana_id}", "DanaController@api_edit_dana")->name("api_edit_dana");

    Route::post("/api/universal/logger", "LoggerController@logger")->name("api_send_log");

    Route::resource("/checklist", "ChecklistController");
    Route::post("/checklist/table", "ChecklistController@table");
    /**
     * END API
     */
});

/**
 * VIEW WITH NO AUTH
 */

Route::get(
    "/user/vendor/transactions/bidOrder",
    "TransactionController@view_user_vendor_transaction_bid_order"
)->name("view_user_vendor_transaction_bid_order");
// });
