<?php

// Web routes  for opportunity.

include('routes.php');


if (Trans::isMultilingual()) {
    Route::group(
        [
            'prefix' => '{trans}',
            'where'  => ['trans' => Trans::keys('|')],
        ],
        function () {
            include('routes.php');

        }
    );
}

// Workflow routes for opportunity

Route::prefix('{guard}/opportunity')->group(function () {

    Route::get('/workflow/{opportunity}/{user}', 'OpportunityWorkflowController@get')
        ->name('bixo.opportunity.workflow');
    Route::post('/workflow/{opportunity}/{user}', 'OpportunityWorkflowController@post');

    Route::get('/action/{opportunity}/{user}', 'OpportunityActionController@get')
        ->name('bixo.opportunity.action');
    Route::post('/action/{opportunity}/{user}', 'OpportunityActionController@post');

});


// Workflow routes for offer

Route::prefix('{guard}/offer')->group(function () {

    Route::get('/workflow/{offer}/{user}', 'OfferWorkflowController@get')
        ->name('bixo.opportunity.workflow');
    Route::post('/workflow/{offer}/{user}', 'OfferWorkflowController@post');

    Route::get('/action/{offer}/{user}', 'OfferActionController@get')
        ->name('bixo.opportunity.action');
    Route::post('/action/{offer}/{user}', 'OfferActionController@post');

});


// Workflow routes for preferance

Route::prefix('{guard}/preferance')->group(function () {

    Route::get('/workflow/{preferance}/{user}', 'PreferanceWorkflowController@get')
        ->name('bixo.opportunity.workflow');
    Route::post('/workflow/{preferance}/{user}', 'PreferanceWorkflowController@post');

    Route::get('/action/{preferance}/{user}', 'PreferanceActionController@get')
        ->name('bixo.opportunity.action');
    Route::post('/action/{preferance}/{user}', 'PreferanceActionController@post');

});


// Workflow routes for viewing

Route::prefix('{guard}/viewing')->group(function () {

    Route::get('/workflow/{viewing}/{user}', 'ViewingWorkflowController@get')
        ->name('bixo.opportunity.workflow');
    Route::post('/workflow/{viewing}/{user}', 'ViewingWorkflowController@post');

    Route::get('/action/{viewing}/{user}', 'ViewingActionController@get')
        ->name('bixo.opportunity.action');
    Route::post('/action/{viewing}/{user}', 'ViewingActionController@post');

});