<?php

// Prefix: /api/virtual
$router->group(['prefix' => 'virtual', 'as' => 'virtual', 'middleware' => ['adminAuth']], function ($router) {

    // The controllers live in Domains/Virtual/Http/Controllers
    $router->get('/', ['as' => 'index', 'uses' => 'VirtualController@index']);

    // 名称查找
    $router->get('/fetch/companies', ['as' => 'fetch.companies', 'uses' => 'FetchController@companies']);
    $router->get('/fetch/packages', ['as' => 'fetch.packages', 'uses' => 'FetchController@packages']);

    // 套餐管理
    $router->get('/packages/index', ['as' => 'packages.index', 'uses' => 'PackageController@index']);
    $router->get('/packages/show/{id}', ['as' => 'packages.show', 'uses' => 'PackageController@show']);
    $router->post('/packages/create', ['as' => 'packages.create', 'uses' => 'PackageController@create']);
    $router->post('/packages/update/{id}', ['as' => 'packages.update', 'uses' => 'PackageController@update']);
    $router->post('/packages/destroy', ['as' => 'packages.destroy', 'uses' => 'PackageController@destroy']);

    // 企业管理
    $router->get('/companies/index', ['as' => 'companies.index', 'uses' => 'CompanyController@index']);
    $router->get('/companies/show/{id}', ['as' => 'companies.show', 'uses' => 'CompanyController@show']);
    $router->post('/companies/create', ['as' => 'companies.create', 'uses' => 'CompanyController@create']);
    $router->post('/companies/update/{id}', ['as' => 'companies.update', 'uses' => 'CompanyController@update']);
    $router->post('/companies/destroy', ['as' => 'companies.destroy', 'uses' => 'CompanyController@destroy']);

    // 企业账号管理
    $router->get('/company/accounts/index', ['as' => 'company.accounts.index', 'uses' => 'CompanyAccountController@index']);
    $router->post('/company/accounts/create', ['as' => 'company.accounts.create', 'uses' => 'CompanyAccountController@create']);
    $router->post('/company/accounts/update/{id}', ['as' => 'company.accounts.update', 'uses' => 'CompanyAccountController@update']);
    $router->post('/company/accounts/destroy', ['as' => 'company.accounts.destroy', 'uses' => 'CompanyAccountController@destroy']);

    // 企业地址管理
    // $router->get('/company/addresses/index', ['as' => 'company.addresses.index', 'uses' => 'CompanyAddressController@index']);
    // $router->post('/company/addresses/create', ['as' => 'company.addresses.create', 'uses' => 'CompanyAddressController@create']);
    // $router->post('/company/addresses/update/{id}', ['as' => 'company.addresses.update', 'uses' => 'CompanyAddressController@update']);
    // $router->post('/company/addresses/destroy', ['as' => 'company.addresses.destroy', 'uses' => 'CompanyAddressController@destroy']);

    // 定价管理
    $router->get('/products/index', ['as' => 'products.index', 'uses' => 'ProductController@index']);
    $router->get('/products/history', ['as' => 'products.history', 'uses' => 'ProductController@history']);
    $router->post('/products/create', ['as' => 'products.create', 'uses' => 'ProductController@create']);
    $router->post('/products/update/{id}', ['as' => 'products.update', 'uses' => 'ProductController@update']);
    $router->post('/products/destroy', ['as' => 'products.destroy', 'uses' => 'ProductController@destroy']);

    // 属性管理
    $router->addRoute(['GET', 'POST'], '/properties/settings', ['as' => 'properties.settings', 'uses' => 'PropertyController@settings']);
    $router->get('/properties/index', ['as' => 'properties.index', 'uses' => 'PropertyController@index']);
    $router->post('/properties/store', ['as' => 'properties.store', 'uses' => 'PropertyController@store']);
    $router->get('/properties/export', ['as' => 'properties.export', 'uses' => 'PropertyController@export']);
    $router->post('/properties/import', ['as' => 'properties.import', 'uses' => 'PropertyController@import']);

    // 订单管理
    $router->get('/orders/index', ['as' => 'orders.index', 'uses' => 'OrderController@index']);
    $router->get('/orders/show/{id}', ['as' => 'orders.show', 'uses' => 'OrderController@show']);
    $router->post('/orders/create', ['as' => 'orders.create', 'uses' => 'OrderController@create']);
    $router->post('/orders/update/{id}', ['as' => 'orders.update', 'uses' => 'OrderController@update']);
    $router->post('/orders/destroy', ['as' => 'orders.destroy', 'uses' => 'OrderController@destroy']);
    $router->post('/orders/reset', ['as' => 'orders.reset', 'uses' => 'OrderController@reset']);
    $router->get('/orders/export', ['as' => 'orders.export', 'uses' => 'OrderController@export']);
    $router->get('/orders/cards', ['as' => 'orders.cards', 'uses' => 'OrderController@cards']);
    $router->get('/orders/cards-export', ['as' => 'orders.cardsExport', 'uses' => 'OrderController@cardsExport']);
    $router->post('/orders/ship', ['as' => 'orders.ship', 'uses' => 'OrderController@ship']);

    // 客户管理
    $router->get('/cards/index', ['as' => 'cards.index', 'uses' => 'CardController@index']);
    $router->get('/cards/export', ['as' => 'cards.export', 'uses' => 'CardController@export']);

    // 流量池管理
    $router->get('/flow-pools/real', ['as' => 'flow-pools.real', 'uses' => 'FlowPoolController@real']);
    $router->get('/flow-pools/packages', ['as' => 'flow-pools.packages', 'uses' => 'FlowPoolController@packages']);
    $router->get('/flow-pools/index', ['as' => 'flow-pools.index', 'uses' => 'FlowPoolController@index']);
    $router->get('/flow-pools/export', ['as' => 'flow-pools.export', 'uses' => 'FlowPoolController@export']);
    $router->get('/flow-pools/show', ['as' => 'flow-pools.show', 'uses' => 'FlowPoolController@show']);
    $router->get('/flow-pools/detail/export', ['as' => 'flow-pools.detailExport', 'uses' => 'FlowPoolController@detailExport']);
    $router->post('/flow-pools/create', ['as' => 'flow-pools.create', 'uses' => 'FlowPoolController@create']);
    $router->post('/flow-pools/update/{id}', ['as' => 'flow-pools.update', 'uses' => 'FlowPoolController@update']);
    $router->post('/flow-pools/destroy', ['as' => 'flow-pools.destroy', 'uses' => 'FlowPoolController@destroy']);
    $router->post('/flow-pools/setting', ['as' => 'flow-pools.setting', 'uses' => 'FlowPoolController@setting']);
    $router->addRoute(['GET', 'POST'], '/flow-pools/flows', ['as' => 'flow-pools.flows', 'uses' => 'FlowPoolController@flows']);
    $router->post('/flow-pools/import-flows', ['as' => 'flow-pools.import-flows', 'uses' => 'FlowPoolController@importFlows']);
});
