<?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!
|
*/
require 'product_route.php';
require 'rate_entry_route.php';
require 'mr_route.php';
require 'reports_route.php';
require 'season_route.php';
require 'mr_sea_route.php';
require 'pr_sea_route.php';
require 'contract_sea_route.php';
require 'dmg_route.php';

Route::get('/', function () {
	if(Auth::user())
    {
        return redirect('home');
    }
    return view('auth/login');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');


 // Role //

 Route::get('role/index',['as'=>'role.index',
	'uses'=>'RoleController@index']);

 Route::get('role/create',['as'=>'role.create',
	'uses'=>'RoleController@create']);

 Route::post('role/store',['as'=>'role.store',
	'uses'=>'RoleController@store']);

  Route::get('role/edit/{id}',['as'=>'role.edit',
	'uses'=>'RoleController@edit']);

  Route::post('role/update',['as'=>'role.update',
	'uses'=>'RoleController@update']);


  // User // 

   Route::get('user/index',['as'=>'user.index',
	'uses'=>'UserController@index']);

   Route::get('user/create',['as'=>'user.create', 
	'uses'=>'UserController@create']);

   Route::get('customer/type/visible',['as'=>'customer.type.visible', 
	'uses'=>'UserController@visibleType']);

   Route::post('user/store',['as'=>'user.store',
	'uses'=>'UserController@store']);

   Route::get('user/edit/{id}',['as'=>'user.edit', 
	'uses'=>'UserController@edit']);

    Route::post('user/update',['as'=>'user.update',
	'uses'=>'UserController@update']);

	Route::get('customer/location/list','UserController@customerList');

	Route::get('customer/parent/list','UserController@customerParentList');


// Category Master //

 Route::get('category/master/index',['as'=>'category.master.index',
	'uses'=>'CategoryMasterController@index']);

 Route::post('category/master/store',['as'=>'category.master.store',
	'uses'=>'CategoryMasterController@store']);

 Route::get('category/master/edit',['as'=>'category.master.edit',
	'uses'=>'CategoryMasterController@edit']);

   // Manage Config // 

   Route::get('manage/config/index',['as'=>'manage.config.index',
	'uses'=>'ManageConfigController@index']);

   Route::post('manage/config/store',['as'=>'manage.config.store',
	'uses'=>'ManageConfigController@store']);

   Route::get('manage/config/edit',['as'=>'manage.config.edit',
	'uses'=>'ManageConfigController@edit']);


   ///////UNIT MASTER//////////

Route::get('unit_master/create',['as' => 'unit_master.create',
	'uses' => 'UnitMeasurementController@create']);

Route::post('unit_master/insert',['as' => 'unit_master.insert',
	'uses' => 'UnitMeasurementController@store']);

Route::get('edit/unit',['as' => 'edit.unit',
	'uses' => 'UnitMeasurementController@edit']);

///////TAG MASTER//////////

Route::get('tag_master/create',['as' => 'tag_master.create',
	'uses' => 'TagMasterController@create']);

Route::post('tag_master/insert',['as' => 'tag_master.insert',
	'uses' => 'TagMasterController@store']);

Route::get('edit/tag',['as' => 'edit.tag',
	'uses' => 'TagMasterController@edit']);

/////////CUSTOMER TYPE///////////

Route::get('customer_type/create',['as' => 'customer_type.create',
	'uses' => 'CustomerTypesController@create']);

Route::post('customer_type/insert',['as' => 'customer_type.insert',
	'uses' => 'CustomerTypesController@store']);

Route::get('edit/customer_type',['as' => 'edit.customer_type',
	'uses' => 'CustomerTypesController@edit']);

///////////GRADE MASTER///////////

Route::get('grade_master/create',['as' => 'grade_master.create',
	'uses' => 'GradeMasterController@create']);

Route::post('grade_master/insert',['as' => 'grade_master.insert',
	'uses' => 'GradeMasterController@store']);

Route::get('edit/grade',['as' => 'edit.grade',
	'uses' => 'GradeMasterController@edit']);

///////GROUP MASTER//////////

Route::get('group_master/index',['as' => 'group_master.index',
	'uses' => 'GroupMasterController@create']);

Route::post('group_master/insert',['as' => 'group_master.insert',
	'uses' => 'GroupMasterController@store']);

Route::get('edit/group',['as' => 'edit.group',
	'uses' => 'GroupMasterController@edit']);


///////SUB GROUP //////////

Route::get('subgroup/index',['as' => 'subgroup.index',
	'uses' => 'SubGroupController@index']);

Route::post('subgroup/store',['as' => 'subgroup.store',
	'uses' => 'SubGroupController@store']);

Route::get('manage/subgroup/edit', 'SubGroupController@edit');


/////////CUSTOMER/////////
Route::get('customer/list',['as' => 'customer.list',
	'uses' => 'CustomerController@viewList']);

Route::get('customer/create',['as' => 'customer.create',
	'uses' => 'CustomerController@create']);

Route::post('customer/insert',['as' => 'customer.insert',
	'uses' => 'CustomerController@store']);

Route::get('customer/edit/{id}',['as' => 'customer.edit',
	'uses' => 'CustomerController@edit']);

Route::post('customer/update',['as' => 'customer.update',
	'uses' => 'CustomerController@update']);

Route::get('customer/product/map/{id}',['as' => 'customer.product.map',
	'uses' => 'CustomerController@mapIndex']);

Route::get('customer/add/product',['as' => 'customer.add.product',
	'uses' => 'CustomerController@addProduct']);

Route::get('customer/delete/product',['as' => 'customer.product.show',
	'uses' => 'CustomerController@deleteProduct']);

Route::post('customer/product/show',['as' => 'customer.product.show',
	'uses' => 'CustomerController@mapShow']);

Route::get('new/mode/update', ['as' => 'new.mode.update',
	'uses' => 'CustomerController@newModeUpdate']);

Route::get('new/parent/update', ['as' => 'new.parent.update',
	'uses' => 'CustomerController@newParentUpdate']);


/////////SUPPLIER/////////
Route::get('supplier/list',['as' => 'supplier.list',
	'uses' => 'SupplierController@viewList']);

Route::get('supplier/create',['as' => 'supplier.create',
	'uses' => 'SupplierController@create']);

Route::post('supplier/insert',['as' => 'supplier.insert',
	'uses' => 'SupplierController@store']);

Route::get('supplier/edit/{id}',['as' => 'supplier.edit',
	'uses' => 'SupplierController@edit']);

Route::post('supplier/update',['as' => 'supplier.update',
	'uses' => 'SupplierController@update']);

Route::get('country/add',['as' => 'country/add',
	'uses' => 'SupplierController@addCountry']);

//////////SUPPLIER PRODUCTS MAPPING//////////

Route::get('supplier_products/map/{id}',['as' => 'supplier_products.map',
	'uses' => 'SupplierController@mapProduct']);

Route::get('add/product',['as' => 'add/product',
	'uses' => 'SupplierController@addProduct']);

Route::get('update/product',['as' => 'update/product',
	'uses' => 'SupplierController@updateProduct']);

Route::post('supplier_product/map',['as' => 'supplier_product.map',
	'uses' => 'SupplierController@mapCat_Product']);

Route::get('get/productStandrd','SupplierController@getStandrd');
Route::get('get/productGrades','SupplierController@getGrades');
Route::get('get/supplier/grades','SupplierController@getSupGrades');
Route::get('add/product/grade','SupplierController@addGrade');
Route::get('update/product/grade','SupplierController@updateGrade');



/////// Notification /////////

Route::get('notification/index',['as' => 'notification.index',
	'uses' => 'NotificationController@index']);

Route::get('notification/create',['as' => 'notification.create',
	'uses' => 'NotificationController@create']);

Route::get('notification/list/product',['as' => 'notification/list/product',
	'uses' => 'NotificationController@listProduct']);

Route::get('notification/list/unit',['as' => 'notification/list/unit',
	'uses' => 'NotificationController@listUnit']);


Route::get('notification/list/grade',['as' => 'notification/list/grade',
	'uses' => 'NotificationController@listGrade']);

Route::post('notification/store',['as' => 'notification.store',
	'uses' => 'NotificationController@store']);

Route::get('notification/edit/{id}',['as' => 'notification.edit',
	'uses' => 'NotificationController@edit']);

Route::post('notification/doUpdate',['as' => 'notification.doupdate',
	'uses' => 'NotificationController@updateData']);

Route::get('notification/show',['as' => 'notification.show',
	'uses' => 'NotificationController@showList']);

Route::get('notification/status/save/{id}',['as' => 'notification.status.save',
	'uses' => 'NotificationController@insertStatus']);

///////TAG MASTER//////////

Route::get('tag_master/index',['as' => 'tag_master.index',
	'uses' => 'TagMasterController@index']);

Route::post('tag_master/insert',['as' => 'tag_master.insert',
	'uses' => 'TagMasterController@store']);

Route::get('edit/tag',['as' => 'edit.tag',
	'uses' => 'TagMasterController@edit']);

Route::get('delete/tag','TagMasterController@delete');

Route::get('map/tag/index/{id}',['as' => 'map.tag.index',
	'uses' => 'TagMasterController@mapIndex']);

Route::post('map/tag/show',['as' => 'map.tag.show',
	'uses' => 'TagMasterController@mapShow']);

Route::get('tag/map/product','TagMasterController@addProduct');

Route::get('tag/product/delete','TagMasterController@deleteProduct');

Route::get('currect/mrapprove/en','SupplierRateEntryController@currectMRENTRY');

//// Standard Master ///

Route::get('standard_master/index',['as' => 'standard_master.index',
	'uses' => 'StandardMasterController@index']);

Route::post('standard_master/store',['as' => 'standard_master.store',
	'uses' => 'StandardMasterController@store']);

Route::get('edit/standard/master','StandardMasterController@edit');

// product rate entry //

Route::get('product_units_fetch','SupplierRateEntryController@getUnits');
Route::get('sup_rate_unit','SupplierRateEntryController@insertPdtUnits');

//pdt weight
Route::get('pdt/get/weight','SupplierPrController@getWeight');

//product upload
Route::get('upload/product/page','ProductController@uploadPage');
Route::post('upload/product/data','ProductController@uploadData');

////////////location///////////////

Route::get('location/master',['as' => 'location.master',
	'uses' => 'LocationMasterController@index']);

Route::get('location/create',['as'=>'location.create', 
	'uses'=>'LocationMasterController@createLocation']);


Route::post('location/update',['as'=>'location.update',
	'uses'=>'LocationMasterController@updateLocation']);

Route::get('location/edit/{id}',['as'=>'location.edit', 
	'uses'=>'LocationMasterController@editLocation']);

Route::post('location/store',['as' => 'location.store',
	'uses' => 'LocationMasterController@storeLocation']);



Route::post('location_master/insert',['as' => 'location_master.insert',
	'uses' => 'LocationMasterController@store']);

Route::get('edit/location', 'LocationMasterController@edit');

Route::get('location/product/{id}/map', ['as' => 'location.product.map',
	'uses' => 'LocationMasterController@mapProduct']);

Route::post('location/product/show', ['as' => 'location.product.show',
	'uses' => 'LocationMasterController@mapShow']);

Route::get('location/add/product', ['as' => 'location.add.product',
	'uses' => 'LocationMasterController@locationAddProduct']);

Route::get('location/delete/product', ['as' => 'location.delete.product',
	'uses' => 'LocationMasterController@locationDeleteProduct']);


Route::get('location/product/{id}/report', ['as' => 'location.product.report',
	'uses' => 'LocationMasterController@productinLocation']);

Route::get('get/location/productStandrd','LocationMasterController@getStandrd');
Route::get('get/location/grades','LocationMasterController@getLocGrades');
Route::get('add/location/product/grade','LocationMasterController@addGrade');
Route::get('update/location/product/grade','LocationMasterController@updateGrade');

/////////////////////sub locations////////////////////////////////
Route::get('sub/locations/{id}',['as' => 'sub.locations',
	'uses' => 'LocationMasterController@subLoactions']);

Route::post('sub/location/{id}/insert', ['as' => 'sub.location.insert',
	'uses' => 'LocationMasterController@subLocationInsert']);

Route::get('edit/sub/location', ['as' => 'edit.sub.location',
	'uses' => 'LocationMasterController@editSubLocation']);


Route::get('location/wise/product/zip/{id}',['as' => 'location.wise.product.zip',
	'uses' => 'LocationMasterController@generateZip']);

Route::get('customer/wise/product/zip/{id}',['as' => 'customer.wise.product.zip',
	'uses' => 'LocationMasterController@generateCustomerZip']);
