<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' => 'transaction.'], function () {

    Route::get('/list', 'ListTransactionsController@list')->name('list');
    Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend');
    Route::put('{id}/status/update/{status}', 'UpdateTransactionStatusController@update')->where('status', 'approve|expire|reject')->name('update');

    Route::group(['prefix' => 'payment', 'as' => 'payment.'], function () {
        Route::post('/create', 'CreatePaymentTransactionController@create')->name('create');
        Route::post('/upload-verification-document/{transaction_id}', 'UploadPaymentVerificationDocumentController@upload')->name('verification.create');
        Route::put('/approve/{transaction_id}/{status}', 'ApprovePaymentTransactionController@approve')->where('status', 'approve|reject')->name('approval');
    });
    
    Route::group(['prefix' => 'invoice', 'as' => 'invoice.'], function () {
        route::post('/shipping-invoice/create', 'CreateShippingInvoiceTransactionController@create')->name('create');
        route::put('/shipping-invoice/{id}/update', 'UpdateShippingInvoiceTransactionController@update')->name('update');
        route::put('/shipping-invoice/{id}/approve', 'ApproveShippingInvoiceTransactionController@approve')->name('approve');
    });

    route::post('/shipping-invoice/calculator', 'ShippingEstimationCalculatorController@calculate')->name('shipping.estimation.calculator');

    // Route::group(['prefix' => '{id}/payment', 'as' => 'payment.'], function () {
    //     Route::post('quotation', 'FetchBookingPaymentQuotationController@fetch')->name('quotation');
    //     Route::post('create', 'CreateBookingPaymentController@create')->name('create');
    //     Route::post('{payment_id}/verification/create', 'CreatePaymentVerificationController@create')->name('verification.create');
    //     Route::put('/{payment_id}/approval/{status}', 'ApprovePaymentVerificationController@approve')->where('status', 'approve|reject')->name('approval');
    // });


    // route::post('{id}/bill/verification', 'CreatePaymentProofDocumentController@verify')->name('bill.verification');

    // Route::post('booking/{id}/details/update', 'CreatePurchaseOrderTransactionController@create')->name('po.create');

});