<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/



/*
 * A supprimer en prodution
 *
 */	
Route::post('paymentTest','ChoixPaiementController@paymentTest')->name('paiement.test');
/*Route::get('annulepaiements/{id}','ChoixPaiementController@annulePaiements')->name('paiements.annule');

Route::get('test_signature', function () { return view('demandes.signature', ['name' => 'signature']); });
*/
// Fin a supprimer *********************

Route::get('/', 'HomeController@index');

Auth::routes(['verify' => true]);

Route::get('/home', 'HomeController@index')->name('home');
Route::resource('demandes','DemandeController');
Route::get('/devis/{id}','DemandeController@voirDevis')->name('voirdevis');
Route::resource('factures','DemandeController');
Route::get('/voirdocument/{id}','DemandeController@voirDocument')->name('voirdocument');
Route::resource('adresses','AdresseController');
Route::resource('users','UserController');
Route::resource('clients','UserController');
Route::resource('prestataires','UserController');
Route::resource('assistants','UserController');
Route::resource('communes','CommuneController');

Route::get('demande/confirmerpaiement/{id}','DemandeController@confirmerPaiement')->name('demande.confirmerpaiement');
Route::resource('interventions','InterventionController');
Route::get('interventions/createfordemande/{id}','InterventionController@create')->name('createfordemande');
//Route::post('demandes/payer','DemandeController@payer')->name('demande.payer');
//Route::post('demandes/payer','ChoixPaiementController@payer')->name('demande.payer');
Route::post('demande/messagelu','DemandeController@messagelu')->name('messagelu');

/*
 * Moyens de paiement
 */
Route::post('choixpaiement','ChoixPaiementController@choixMoyenPaiement')->name('choixpaiement');

//Uniskip QR Code
Route::post('paiementUniskipQR','ChoixPaiementController@uniskipQRPayment')->name('paiement.uniskipQR');
Route::get('uniskipQRVerifTransaction','ChoixPaiementController@uniskipQRVerifTransaction')->name('uniskipQRVerifTransaction');
Route::get('getQRCode','ChoixPaiementController@getQRCode')->name('getQRCode');
Route::get('uniskipQRVerif','ChoixPaiementController@uniskipQRVerif')->name('uniskipQRVerif');

//Uniskip CB
Route::post('paiementUniskipCB','ChoixPaiementController@uniskipCBPayment')->name('paiement.uniskipCB');
Route::get('uniskipCBVerifTransaction','ChoixPaiementController@uniskipCBVerifTransaction')->name('uniskipCBVerifTransaction');
Route::get('uniskipCBVerif/{usCBdemande_id}','ChoixPaiementController@uniskipCBVerif')->name('uniskipCBVerif');

//CB
Route::post('paiementCB','ChoixPaiementController@cbPayment')->name('paiement.CB');
Route::post('paiementCBsuccess','ChoixPaiementController@cbPaymentSuccess')->name('paiementCBsuccess');
Route::post('paiementCheque','ChoixPaiementController@paymentCheque')->name('paiement.cheque');


Route::get('paymentSuccess','ChoixPaiementController@paymentSuccess')->name('paymentSuccess');

Route::post('creerFactureAdmin','ChoixPaiementController@creerFactureAdmin')->name('creerFactureAdmin');
Route::post('enregistrerpaiementmanuel','ChoixPaiementController@enregistrerPaiementManuel')->name('enregistrerpaiementmanuel');

Route::post('receptionner','DemandeController@receptionner')->name('receptionner');

Route::get('demande/voirfacture/{id}','DemandeController@showFacture')->name('demande.voirfacture');
Route::get('demande/voirfactureartisan/{id}','DemandeController@showFactureArtisan')->name('demande.voirfactureartisan');

Route::get('admin/config','AdminController@editConfig')->name('config.edit');
Route::patch('admin/edit','AdminController@updateConfig')->name('config.update');
Route::get('demande/voirrapport/{id}','DemandeController@showRapport')->name('demande.voirrapport');
Route::post('changebanniere','AdminController@changeBanniere')->name('changebanniere');


