<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });


## User
//use DB;
DB::setFetchMode(PDO::FETCH_ASSOC);
//DB::connection('mysql_wordpress')->setFetchMode(PDO::FETCH_ASSOC);


#Refresh Token Generation
Route::post('/user/refresh_token' , 'TokenController@refreshToken' );
#token Generation
Route::post('/user/token' , 'TokenController@token');

#get user's info
Route::get('/user' , 'UserController@showProfile');
Route::get('/testUser' , 'UserController@showTestProfile');
#create new user
Route::post('/user' , 'UserController@createProfile');
#Update user
Route::patch('/user/profileImg' , 'UserController@updateProfileImage');
Route::patch('/user' , 'UserController@updateProfile');
Route::patch('/testUser' , 'UserController@updateTestProfile');
#Delete user
Route::delete('/user' , 'UserController@deleteProfile');
#pasword change
Route::post('/user/changePass' , 'UserController@updatePassword');

Route::get('/user/activation/{activation_id}', 'UserController@mailActivation');

## For forget user
Route::post('/user/forget_password' , 'UserController@forgetPassword' );

## For user logout
Route::post('/user/logout' , 'UserController@logout' );

Route::get('/user/countrystate', 'UserController@statecountry');

Route::get('/user/listing', 'UserController@Listing') ;
Route::post('/user/portfolio_filter', 'UserController@PortfolioFilter') ;
Route::post('/user/update_portfolio_filter', 'UserController@updatePortfolioFilter') ;

### New user plan related


## Actions veersion 1
Route::post('/v1/action/{method}' , 'ActionController@call');

### Get user subscription plans
Route::post('/v2/action/getsubscriptionplan' , 'UserController@getSubscriptionPlan') ;

### Update user info before plan payment
Route::post('/v2/action/subscription/beforeplan' , 'UserController@UpdateUserPlanBeforePayemt') ;

### Update user info after plan payment
Route::post('/v2/action/subscription/afterplan' , 'UserController@UpdateUserPlanAfterPayemt') ;

# All news routes #
### To list all categories
//Route::get('/v2/action/news/category' , 'NewsController@getcategory') ;
Route::get('/v2/action/news/category' , 'NewsController@get_all_news_categories') ;

### To get all news
Route::post('/v2/action/news' , 'NewsController@get_all_news') ;
//Route::post('/v2/action/news' , 'NewsController@getallnews') ;
//Route::post('/v2/action/testGetAllNews' , 'newNEWSController@get_all_news') ;

### To get news according to news id
Route::post('/v2/action/news/{id}' , 'NewsController@get_news_by_id');
//Route::post('/v2/action/news/{id}' , 'NewsController@getnewsByid');
//Route::post('/v2/action/testGetNewsById/{id}' , 'newNEWSController@get_news_by_id');

### To get all filters of news
//Route::get('/v2/action/news/filters' , 'NewsController@getfilters');
Route::get('/v2/action/news/filters' , 'NewsController@get_news_filters');

## For tender ##
## To get category of tender
Route::get('/v2/action/tenders/category' , 'TendersController@getcategory') ;

### To list all tenders filters
Route::get('/v2/action/tenders/filters' , 'TendersController@getfilters') ;

Route::post('/v2/action/tenders/enquiry' , 'TendersController@tenderEnquiry' );

### To get all tenders
Route::post('/v2/action/tenders' , 'TendersController@getalltenders') ;
### To get tender according to tender id
Route::post('/v2/action/tenders/{id}' , 'TendersController@getcategoryByID');



# All price old route #
### to get price category
//Route::get('/v2/action/price/category' , 'PriceControllerstub@getfilters') ;
//### To get all prices
//Route::post('/v2/action/price' , 'PriceControllerstub@getallprice') ;
//### To get price according to tender id
//Route::post('/v2/action/price/{id}' , 'PriceControllerstub@getPriceById');
//
//# Logistics
//### Get all logistics
//Route::post('/v2/action/logistics' , 'PriceControllerstub@getallLogistics') ;

## All price new live ##
### To get all price category
Route::get('/v3/action/price/category' , 'PriceController@getfilters') ;
Route::get('/v3/action/price/filters/regions' , 'PriceController@getRegionsFilters') ;
### To get all prices
Route::post('/v3/action/price' , 'PriceController@getallprice') ;
### To get price according to tender id
Route::post('/v3/action/price/{id}' , 'PriceController@getPriceById');
Route::post('/v3/action/price/details/{id}' , 'PriceController@getPriceByPriceId');
//
//Route::post('/v3/action/logistics' , 'PriceController@getallLogistics') ;


Route::get('/v3/test/price/category' , 'PriceModuleController@getfilters') ;
Route::get('/v3/test/price/filters/regions' , 'PriceModuleController@getRegionsFilters') ;
### To get all prices
Route::post('/v3/test/price' , 'PriceModuleController@getPrices');
### To get price according to tender id
Route::post('/v3/test/price/{id}' , 'PriceModuleController@getPriceById');
Route::post('/v3/test/price/details/{id}' , 'PriceModuleController@getPriceByPriceId');


# Events old routes #
### Get all events
//Route::post('/v2/action/events' , 'EventsControllerstubs@getallEvents' ) ;
//
//### Get event by ID
//Route::post('/v2/action/events/{method}' , "EventsControllerstubs@eventByID" ) ;
//
//### Get price of event according to delegate number
//Route::get('/v2/action/events/delegate_price/{event_ID}' , 'EventsControllerstubs@getEventPackage');
//
//### Get events filters
//Route::get('/v2/action/events/filters/{event_ID}' , 'EventsControllerstubs@getFilters' ) ;


## Events new routes live ##

### related to QR code contacts
Route::post('/v3/action/events/getContacts' , 'EventsController@getEventContacts');
Route::post('/v3/action/events/saveContacts' , 'EventsController@storeEventContacts');
Route::post('/v3/action/events/deleteContact' , 'EventsController@deleteEventContact');
Route::post('/v3/action/events/updateContactRemark' , 'EventsController@updateEventContactRemark');

### Get all events
Route::post('/v3/action/events' , 'EventsController@getallEvents' ) ;

Route::post('/v3/action/events/payment' , 'EventsController@after_payment') ;

### Get event by ID
Route::post('/v3/action/events/{event_ID}' , "EventsController@eventByID" ) ;

### Get events filters
Route::get('/v3/action/events/filters/{event_ID}' , 'EventsController@getFilters' ) ;

### Get participants list according to filters
Route::post('/v3/action/events/participants/{event_ID}' , 'EventsController@getparticipants') ;
Route::post('/v3/action/events/accomodation/{event_ID}' , 'EventsController@getAccomodations') ;

### Get price for deligate events
Route::get('/v3/action/events/delegate_price/{event_ID}' , 'EventsController@getEventPackage' ) ;

### Get complete payment details for deligate events
Route::post('/v3/action/events/delegate_price/{event_ID}' , 'EventsController@getPriceDetail' ) ;

### Get complete payment details for deligate events
Route::post('/v3/action/events/delegate_registration/{event_ID}' , 'EventsController@delegateSubmitForm' ) ;

## Delegate contact us
Route::post('/v3/action/events/delegate/contactus/{event_ID}' , 'EventsController@delegateContactus' ) ;

## post services version 1
Route::post('/v1/plantbee/{method}' , 'PostController@call');

## Get all plants type of plantbee
Route::get('/v1/plantbee/plantype/{dealtype}' , 'PostController@getallplanttype');

## Get all search criteria
Route::get('/v1/plantbee/searchfilers' , 'PostController@searchfilers');

## Get home page images
Route::get('/v1/plantbee/homepageimage' , 'PostController@homePageImage' ) ;

Route::get('/v1/plantbee/faqs' , 'PostController@getfaqs' ) ;

## Generate lead impression
Route::get('/v1/plantbee/leadimpression/{lead_id}' , 'PostController@LeadImpression');


## Get faqs
Route::get('/v2/action/faqs' , 'getCommonInfo@getfaqs');

## Get terms and conditions
Route::get('/v2/action/termsandconditions' , 'getCommonInfo@termsAndConditions') ;


## For payment gateway
Route::post('/v2/payment/ccavenue/getrsa' , 'PaymentCcavenueController@getRSA');

//Route::post('/v2/payment/ccavenue/verification' , 'PaymentCcavenueController@verification') ;

Route::post('/v2/payment/paypal/verify', 'PaymentPaypalController@verifyPayment') ;

## For notification
Route::post('/notification/readlog', 'notificationController@read_error_log_entry') ;
Route::post('/notification/emptylog', 'notificationController@empty_error_log_entry') ;

Route::post('/v2/notification/register', 'notificationController@registerDevice') ;
Route::post('/v2/notification/deregister', 'notificationController@deregisterDevice') ;


## For notification admin
Route::post('/v2/notification/create', 'notificationController@create_notification') ;
Route::get('/v2/notification/type', 'notificationController@get_all_notification_type') ;
Route::get('/v2/notification/device', 'notificationController@get_all_device') ;

Route::post('/v2/notification/send', 'notificationController@post_notification') ;

#To enable/disable notification
Route::post('/v2/notification/status', 'notificationController@notification_set');

Route::post('/v2/notification/device' , 'notificationController@getdeviceID') ;



## For OTP
Route::post('/v2/otp/verify', 'OTPverification@verifyOTP') ;

Route::get('document.html' , 'MarkdownRender@apiDocument') ;



## For testing ##
## for new testing
Route::get('/test/news/category' , 'NewsControllerTest@getcategory') ;

### To get all news
Route::post('/test/news' , 'NewsControllerTest@getallnews') ;

### To get news according to news id
Route::post('/test/news/{id}' , 'NewsControllerTest@getnewsByid');

### To get all filters of news
Route::get('/test/news/filters' , 'NewsControllerTest@getfilters');


## All price new live ##
### To get all price category
Route::get('/test/price/category' , 'PriceControllerTest@getfilters') ;
### To get all prices
Route::post('/test/price' , 'PriceControllerTest@getallprice') ;
### To get price according to tender id
Route::post('/test/price/{id}' , 'PriceControllerTest@getPriceById');

Route::post('/test/logistics' , 'PriceControllerTest@getallLogistics') ;


# To get category of tender
Route::get('/test/tenders/category' , 'TendersControllerTest@getcategory') ;

### To list all tenders filters
Route::get('/test/tenders/filters' , 'TendersControllerTest@getfilters') ;

Route::post('/test/tenders/enquiry' , 'TendersControllerTest@tenderEnquiry' );

### To get all tenders
Route::post('/test/tenders' , 'TendersControllerTest@getalltenders') ;
### To get tender according to tender id
Route::post('/test/tenders/{id}' , 'TendersControllerTest@getcategoryByID');
Route::post('/v2/notification/notificationSend', 'notificationController@post_notificationSend');