<?php

/*
|--------------------------------------------------------------------------
| Module Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for this module.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::group(['prefix' => Config::get('app.api_path'), 'middleware' => ['web', 'auth']], function () {

});

/*
|--------------------------------------------------------------------------
| Pages rendered on the server
|--------------------------------------------------------------------------
|
| This group routes are pages rendered on the server.
| All the pages require the user to be authentificated.
|
*/

Route::group(['middleware' => ['web', 'auth']], function () {
    Route::get('accounts/{client_id}/invoices', ['as' => 'accounts.invoices', 'uses' => 'App\Modules\Accounts\AccountsController@getInvoices'])
        ->where(['client_id' => '[0-9]+']);
    Route::get('accounts/{client_id}/{client_type}', ['as' => 'accounts.show', 'uses' => 'App\Modules\Accounts\AccountsController@getShow'])
        ->where(['client_id' => '[0-9]+', 'client_type' => '^(client|customer)$']);
    Route::get('accounts', ['as' => 'accounts.index', 'uses' => 'App\Modules\Accounts\AccountsController@getIndex']);
});
