<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function () {

    require __DIR__ . '/account.php';

//    Route::get('/rate/calculate', 'RateCalculateCurrencyController@convert')->name('calculate');

    Route::group(['prefix' => 'service', 'as' => 'service.'], function () {
        Route::get('countries/list', 'Services\CountriesListController@index')->name('list.countries');
    });

    Route::post('online_payment/callback', 'Billplz\CallbackBillplzController@callback')->name('online_payment.callback');

    Route::group(['middleware' => 'valid.token'], function () {

        Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file');
        Route::post('/import/update-debtor/f614e339d7058904a831aad742e24d55', 'Imports\ImportUpdateDebtorController@import')->name('debtor.import');
        Route::post('/import/upload-honey-trap', 'Imports\ImportHoneyTrapController@import')->name('honey_trap.upload');
        Route::post('/import/upload-import-invoices', 'Imports\ImportStatementInvoiceController@import')->name('import_invoices.upload');
        Route::post('/import/upload-import-receipt', 'Imports\ImportStatementReceiptsController@import')->name('import_receipts.upload');
        Route::post('/customers/invoices', 'Companies\BulkDownloadCustomerInvoicesController@download')->name('customers.invoices');
        Route::post('/supplier/white-form/bulk-download', 'Companies\BulkDownloadSupplierWhiteFormsController@download')->name('suppliers.white_forms');

        require __DIR__ . '/company.php';

        require __DIR__ . '/document.php';

        require __DIR__ . '/segment.php';

        require __DIR__ . '/segment_constant.php';

        require __DIR__ . '/currency.php';

        require __DIR__ . '/bank.php';

        require __DIR__ . '/booking.php';

        require __DIR__ . '/transaction.php';

        require __DIR__ . '/crud.php';

        require __DIR__ . '/announcement.php';

        require __DIR__ . '/billplz.php';

        require __DIR__ . '/wallet.php';

        require __DIR__ . '/voucher.php';
        
        require __DIR__ . '/accounting.php';

        require __DIR__ . '/reward.php';

        require __DIR__ . '/milestone.php';

//        require __DIR__ . '/rate.php';
//        require __DIR__ . '/receipt.php';

    });
});
