From b14bba70a05e7d77fe41ac79222aba84325ccab9 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 31 Jul 2018 11:48:58 +0200 Subject: [PATCH] routes: add sections --- config/routes.rb | 55 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index d71a33f56..ce2bf183c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,8 @@ Rails.application.routes.draw do + # + # Manager + # + get 'manager/sign_in' => 'administrations/sessions#new' delete 'manager/sign_out' => 'administrations/sessions#destroy' namespace :manager do @@ -38,8 +42,16 @@ Rails.application.routes.draw do root to: "administrateurs#index" end + # + # Monitoring + # + get "/ping" => "ping#index", :constraints => { :ip => /127.0.0.1/ } + # + # Authentication + # + devise_for :administrations, skip: [:password, :registrations, :sessions], controllers: { @@ -77,6 +89,10 @@ Rails.application.routes.draw do get '/administrateurs/sign_in/demo' => redirect("/users/sign_in") end + # + # Main routes + # + root 'root#index' get 'users' => 'users#index' @@ -95,6 +111,17 @@ Rails.application.routes.draw do get ':champ_id/siret' => 'siret#index', as: 'siret' end + namespace :commencer do + get '/test/:procedure_path' => '/users/dossiers#commencer_test', as: :test + get '/:procedure_path' => '/users/dossiers#commencer' + end + + get "patron" => "root#patron" + + # + # Deprecated UI + # + namespace :users do namespace :dossiers do resources :invites, only: [:index, :show] @@ -206,6 +233,10 @@ Rails.application.routes.draw do resources :gestionnaires, only: [:index, :create, :destroy] end + # + # Addresses + # + namespace :ban do get 'search' => 'search#get' get 'address_point' => 'search#get_address_point' @@ -215,6 +246,10 @@ Rails.application.routes.draw do post 'dossier/:dossier_id' => '/invites#create', as: 'dossier' end + # + # API + # + namespace :api do namespace :v1 do resources :procedures, only: [:index, :show] do @@ -227,12 +262,9 @@ Rails.application.routes.draw do end end - namespace :commencer do - get '/test/:procedure_path' => '/users/dossiers#commencer_test', as: :test - get '/:procedure_path' => '/users/dossiers#commencer' - end - - get "patron" => "root#patron" + # + # User + # scope module: 'new_user' do resources :dossiers, only: [:index, :update] do @@ -252,6 +284,10 @@ Rails.application.routes.draw do end end + # + # Gestionnaire + # + scope module: 'new_gestionnaire', as: 'gestionnaire' do resources :procedures, only: [:index, :show], param: :procedure_id do member do @@ -301,6 +337,10 @@ Rails.application.routes.draw do get "recherche" => "recherche#index" end + # + # Administrateur + # + scope module: 'new_administrateur' do resources :procedures, only: [] do member do @@ -317,7 +357,10 @@ Rails.application.routes.draw do apipie + # # Legacy routes + # + get 'backoffice' => redirect('/procedures') get 'backoffice/sign_in' => redirect('/users/sign_in') get 'backoffice/dossiers/procedure/:procedure_id' => redirect('/procedures/%{procedure_id}')