<?php

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

$router->get('/products','Product_Controller@index');
$router->get('/products/{id}','Product_Controller@show');
$router->post('/products/create','Product_Controller@store');
$router->put('/products/update/{id}','Product_Controller@update');
$router->delete('/products/delete/{id}','Product_Controller@destroy');

$router->get('/test', 'AuthController@test');
$router->post('/register', 'AuthController@register');
$router->post('/update', 'AuthController@update');
$router->post('/login', 'AuthController@login');
$router->post('/login_web', 'AuthController@login_web');
$router->post('/logout', 'AuthController@logout');
$router->get('/profile', 'UserController@profile');
$router->get('/users/{id}', 'UserController@singleUser');
$router->get('/users', 'UserController@allUsers'); 
$router->get('/update_pw/{id}', 'UserController@update_user');

$router->get('/get_inv', 'InvController@get_data');
$router->get('/get_sin_inv/{id}', 'InvController@get_sin_data');
$router->get('/get_last_id', 'InvController@get_last_id');
$router->post('/get_ref_list', 'InvController@ref_list');
$router->post('/get_cust_det', 'InvController@get_sin_cust');

$router->post('/get_cust_byid', 'InvController@get_cust_byid');
$router->post('/get_pro_byref', 'InvController@get_prod_byref');
$router->post('/check_depo_stock', 'InvController@chk_depo_stock');
$router->post('/get_item_data', 'InvController@get_sin_item');
$router->post('/chk_item_price', 'InvController@check_item_price');
$router->post('/add_temp_item', 'InvController@add_invoice_product');


$router->post('/temp_inv_item', 'InvController@get_temp_inv_data');
$router->post('/save_inv', 'InvController@create_new_invoice');
$router->post('/remove_inv_item', 'InvController@rem_inv_item');
$router->post('/request_sms', 'InvController@request_sms');
$router->post('/search_invoice', 'InvController@invoice_search');

$router->get('/summery', 'UserController@dashboard');

$router->get('/invoice_to_pay', 'PaymentController@inv_to_pay');
$router->get('/all_payment', 'PaymentController@all_pay');
$router->post('/inv_pay_detail', 'PaymentController@sin_inv_data');
$router->post('/new_payment', 'PaymentController@save_payment');
$router->post('/payment_auth', 'PaymentController@authpay');
$router->post('/cancel_payment', 'PaymentController@cancelpay');
$router->get('/get_bank_list', 'PaymentController@get_bank');
$router->get('/get_branch_list', 'PaymentController@get_bank_branch');


$router->get('/get_user_dt', 'UserController@get_user_dt');


$router->post('/invoices', 'ReturnController@get_invoice');
$router->post('/all_return_note', 'ReturnController@all_return');
$router->post('/get_inv_product', 'ReturnController@get_inv_product');
$router->post('/getBearerToken', 'AuthController@getBearerToken');
$router->post('/new_return', 'ReturnController@save_return');
$router->post('/authorize_return', 'ReturnController@grn_auth');


$router->get('/province', 'CustomerController@province');
$router->get('/district', 'CustomerController@districts');
$router->get('/city', 'CustomerController@cities');
$router->get('/all_customer', 'CustomerController@all_customer');
$router->post('/save_customer', 'CustomerController@cust_sav');
$router->post('/single_customer', 'CustomerController@get_sin_cust');
$router->post('/customer_update', 'CustomerController@update_customer');

$router->get('/summary_print', 'CustomerController@sales_summary');
$router->get('/get_period', 'CustomerController@summary_period');
$router->get('/customer_summery', 'CustomerController@cust_summary');


//$router->group(['prefix' => 'api'], function () use ($router) {
   // Matches "/api/register
 // $router->post('register', 'AuthController@register');
  // $router->post('login', 'AuthController@login');

//});

$router->get('/', function () use ($router) {
    return $router->app->version();
});
