You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

165 lines
8.5 KiB

<?php
/** @var \Laravel\Lumen\Routing\Router $router */
$router->group(['prefix' => 'actions'], function () use ($router) {
$router->group(['prefix' => 'businesses'], function () use ($router) {
$router->group(['prefix' => '{business}', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/info', 'BusinessController@info');
});
});
});
$router->group(['prefix' => 'auth'], function () use ($router) {
$router->get('/', 'AuthController@auth');
$router->delete('/', 'AuthController@delete');
$router->get('/info', 'AuthController@authWithInfo');
$router->post('login', 'AuthController@login');
$router->post('logout', 'AuthController@logout');
$router->post('register', 'AuthController@register');
$router->post('revoke/{token}', 'AuthController@revoke');
$router->post('forget-password', 'AuthController@forgetPassword');
$router->post('update-password', 'AuthController@updatePassword');
$router->post('verification', 'AuthController@verification');
$router->get('google/redirect', 'AuthController@redirectToGoogle');
$router->get('google/callback', 'AuthController@handleGoogleCallback');
});
$router->group(['prefix' => 'businesses'], function () use ($router) {
$router->get('/', 'BusinessController@index');
$router->post('/', 'BusinessController@store');
$router->group(['prefix' => '{business}', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->put('/avatar', 'BusinessController@setAvatar');
$router->delete('/avatar', 'BusinessController@unSetAvatar');
$router->get('/', 'BusinessController@show');
$router->put('/', 'BusinessController@update');
$router->delete('/', 'BusinessController@delete');
$router->get('/restore', 'BusinessController@restore');
$router->get('/files', 'FileController@index');
$router->get('/info', 'BusinessController@info');
$router->get('/invoices', 'InvoiceController@index');
$router->get('/invoices/{date}', 'InvoiceController@show');
$router->get('/pay', 'CreditController@pay');
$router->get('/payments', 'CreditController@payments');
$router->group(['prefix' => 'projects'], function () use ($router) {
$router->get('/', 'ProjectController@index');
$router->post('/', 'ProjectController@store');
$router->group(['prefix' => '{project}'], function () use ($router) {
$router->put('/avatar', 'ProjectController@setAvatar');
$router->delete('/avatar', 'ProjectController@unSetAvatar');
$router->get('/', 'ProjectController@show');
$router->put('/', 'ProjectController@update');
$router->delete('/', 'ProjectController@delete');
$router->group(['prefix' => 'files', 'as' => 'file.', 'middleware' => 'bindBusiness'], function () use ($router) {
// $router->get('/', ['as' => 'index', 'uses' => 'FileController@index']);
$router->post('/', ['as' => 'store', 'uses' => 'FileController@store']);
$router->group(['prefix' => '{file}'], function () use ($router) {
$router->get('/', ['as' => 'download', 'uses' => 'FileController@download']);
$router->put('/', ['as' => 'rename', 'uses' => 'FileController@rename']);
$router->delete('/', ['as' => 'delete', 'uses' => 'FileController@delete']);
});
});
$router->get('/restore', 'ProjectController@restore');
$router->group(['prefix' => 'sprints', 'as' => 'sprint.', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/', ['as' => 'index', 'uses' => 'SprintController@index']);
$router->post('/', ['as' => 'store', 'uses' => 'SprintController@store']);
$router->group(['prefix' => '{sprint}'], function () use ($router) {
$router->get('/', ['as' => 'show', 'uses' => 'SprintController@show']);
$router->put('/', ['as' => 'update', 'uses' => 'SprintController@update']);
$router->delete('/', ['as' => 'delete', 'uses' => 'SprintController@delete']);
});
});
$router->group(['prefix' => 'systems', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/', 'SystemController@index');
$router->post('/', 'SystemController@store');
$router->group(['prefix' => '{system}'], function () use ($router) {
$router->get('/', 'SystemController@show');
$router->put('/', 'SystemController@update');
$router->delete('/', 'SystemController@delete');
});
});
$router->group(['prefix' => 'tasks/{task}/files', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/', ['uses' => 'TaskFileController@index']);
$router->post('/', ['uses' => 'TaskFileController@sync']);
$router->get('/{file}', ['uses' => 'TaskFileController@download']);
});
$router->group(['prefix' => 'users'], function () use ($router){
$router->post('/', 'ProjectController@storeOrUpdateUser');
$router->group(['prefix' => '{user}'], function () use ($router) {
$router->delete('/', 'ProjectController@deleteUser');
});
});
});
});
$router->group(['prefix' => 'tags', 'as' => 'tag.', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/', ['as' => 'index', 'uses' => 'TagController@index']);
$router->post('/', ['as' => 'store', 'uses' => 'TagController@store']);
$router->group(['prefix' => '{tag}'], function () use ($router) {
$router->get('/', ['as' => 'show', 'uses' => 'TagController@show']);
$router->put('/', ['as' => 'update', 'uses' => 'TagController@update']);
$router->delete('/', ['as' => 'delete', 'uses' => 'TagController@delete']);
});
});
$router->group(['prefix' => 'workflows', 'as' => 'workflow.', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/', ['as' => 'index', 'uses' => 'WorkflowController@index']);
$router->post('/', ['as' => 'store', 'uses' => 'WorkflowController@store']);
$router->group(['prefix' => '{workflow}'], function () use ($router) {
$router->get('/', ['as' => 'show', 'uses' => 'WorkflowController@show']);
$router->put('/', ['as' => 'update', 'uses' => 'WorkflowController@update']);
$router->delete('/', ['as' => 'delete', 'uses' => 'WorkflowController@delete']);
$router->group(['prefix' => 'statuses', 'middleware' => 'bindBusiness'], function () use ($router) {
$router->get('/', 'StatusController@index');
$router->post('/', 'StatusController@store');
$router->group(['prefix' => '{status}'], function () use ($router) {
$router->get('/', 'StatusController@show');
$router->put('/', 'StatusController@update');
$router->delete('/', ['as' => 'delete', 'uses' => 'StatusController@delete']);
});
});
});
});
$router->group(['prefix' => 'users'], function () use ($router){
$router->post('/', 'BusinessController@storeOrUpdateUser');
$router->group(['prefix' => '{user}'], function () use ($router) {
$router->delete('/', 'BusinessController@deleteUser');
});
});
});
});
$router->get('/callback', 'CreditController@callback');
$router->get('/{transaction}/redirection', 'CreditController@redirection');
$router->group(['prefix' => 'users'], function () use ($router) {
$router->get('/', 'UserController@index');
$router->get('/search', 'UserController@search');
$router->group(['prefix' => '{user}'], function () use ($router) {
$router->get('/', 'UserController@show');
$router->put('/', 'UserController@update');
$router->put('/avatar', 'UserController@setAvatar');
$router->delete('/avatar', 'UserController@unSetAvatar');
});
});