46 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| use Illuminate\Support\Facades\Route;
 | |
| 
 | |
| /*
 | |
| |--------------------------------------------------------------------------
 | |
| | API Routes
 | |
| |--------------------------------------------------------------------------
 | |
| |
 | |
| | Here is where you can register API routes for your application. These
 | |
| | routes are loaded by the RouteServiceProvider within a group which
 | |
| | is assigned the "api" middleware group. Enjoy building your API!
 | |
| |
 | |
| */
 | |
| 
 | |
| Route::middleware('api')->group(function() {
 | |
|     Route::get('/regiones', 'Api\GrupoDeCompraController@regiones');
 | |
|     Route::get('/regiones/{region}', 'Api\GrupoDeCompraController@region');
 | |
| 
 | |
|     Route::prefix('grupos-de-compra')->group(function() {
 | |
|         Route::get('/{grupoDeCompra}', 'Api\GrupoDeCompraController@show');
 | |
|         Route::post('/{gdc}/devoluciones', 'Api\GrupoDeCompraController@toggleDevoluciones');
 | |
|     });
 | |
| 
 | |
|     Route::prefix('subpedidos')->group(function () {
 | |
|         Route::get('/','Api\SubpedidoController@index');
 | |
|         Route::get('{subpedido}','Api\SubpedidoController@show');
 | |
|         Route::post('/','Api\SubpedidoController@store');
 | |
|         Route::post('/{subpedido}/sync', 'Api\SubpedidoController@syncProductos');
 | |
|         Route::post('/{subpedido}/sync_devoluciones', 'Api\SubpedidoController@syncDevoluciones');
 | |
|     });
 | |
| 
 | |
|     Route::prefix('admin')->group(function () {
 | |
|         Route::prefix('subpedidos')->group(function() {
 | |
|             Route::post('/{subpedido}/aprobacion', 'Api\SubpedidoController@toggleAprobacion');
 | |
|         });
 | |
|     });
 | |
| 
 | |
|     //@TO DO -> esta ruta debe estar en middleware de auth y/o subpedido
 | |
|     Route::get('/categorias', 'Api\ProductoController@categorias');
 | |
| 
 | |
|     //@TO DO -> esta ruta debe estar en middleware de auth y/o subpedido
 | |
| 	Route::prefix('productos')->group(function () {
 | |
|         Route::get('/','Api\ProductoController@index');
 | |
| 	});
 | |
| });
 |