-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathroutes.rb
238 lines (179 loc) · 6.53 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# frozen_string_literal: true
# Copyright (c) 2006-2023, Puzzle ITC GmbH. This file is part of
# PuzzleTime and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
# https://github.com/puzzle/puzzletime.
Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
devise_for :employees,
controllers: { sessions: 'employees/sessions', omniauth_callbacks: 'employees/omniauth_callbacks' }, skip: [:registrations]
as :employee do
get 'employees/edit' => 'devise/registrations#edit', :as => 'edit_employee_registration'
patch 'employees' => 'devise/registrations#update', :as => 'employee_registration'
end
root to: 'worktimes#index'
# mount DryCrudJsonapiSwagger::Engine => '/apidocs'
namespace :api do
defaults format: :jsonapi do
namespace :v1 do
resources :employees, only: %i[index show]
end
end
mount Rswag::Ui::Engine => 'docs'
get '/docs/:api_version', to: 'apidocs#show', constraints: { api_version: /v\d+/ }
end
resources :absences, except: [:show]
resources :clients, except: [:show] do
collection do
get :categories
get :contacts_with_crm, to: 'contacts#with_crm'
end
resources :billing_addresses
resources :contacts
end
get 'configurations', to: 'configurations#index'
resources :departments, except: [:show]
resources :employees do
collection do
get :settings
patch :settings, to: 'employees#update_settings'
end
member do
get :log, to: 'employees/log#index'
end
resources :expenses
resources :employments, except: [:show]
resources :overtime_vacations, except: [:show]
resource :worktimes_commit, only: %i[edit update], controller: 'employees/worktimes_commit'
resource :worktimes_review, only: %i[edit update], controller: 'employees/worktimes_review'
end
resources :expenses
resources :expenses_reviews, only: %i[show create update index]
resources :employment_roles, except: [:show]
resources :employment_role_levels, except: [:show]
resources :employment_role_categories, except: [:show]
resources :holidays, except: [:show]
resources :orders do
collection do
get :search
post :crm_load
end
member do
get :employees
end
resources :accounting_posts, except: [:show]
resource :order_controlling, only: [:show], controller: 'order_controlling'
resource :contract, only: %i[show edit update]
resource :multi_worktimes, only: [:update] do
post :edit
get :edit, to: redirect('/orders/%{order_id}/order_services')
end
resources :order_comments, only: %i[index create edit update]
resource :order_targets, only: %i[show update]
resources :order_uncertainties, only: [:index]
resources :order_risks, except: %i[index show],
defaults: { type: 'OrderRisk' },
controller: 'order_uncertainties'
resources :order_chances, except: %i[index show],
defaults: { type: 'OrderChance' },
controller: 'order_uncertainties'
resource :order_services, only: %i[show edit update] do
get :export_worktimes_csv
get :compose_report
get :report
end
resources :invoices do
collection do
get :preview_total
get :billing_addresses
get :filter_fields
end
member do
put :sync
end
end
resource :order_plannings, only: %i[index show update destroy] do
get 'new', on: :member, as: 'new'
end
resource :completed, only: %i[edit update], controller: 'orders/completed'
resource :committed, only: %i[edit update], controller: 'orders/committed'
end
resources :order_statuses, except: [:show]
resources :order_kinds, except: [:show]
resources :portfolio_items, except: [:show]
resources :sectors, except: [:show]
resources :services, except: [:show]
resources :target_scopes, except: [:show]
resources :user_notifications, except: [:show]
resources :work_items, only: %i[new create] do
collection do
get :search
end
end
resources :working_conditions, except: [:show]
resources :worktimes, only: [:index]
resources :workplaces
resources :ordertimes do
collection do
get :existing
get :split
match :create_part, via: %i[post patch]
match :delete_part, via: %i[post delete]
end
end
resources :absencetimes do
collection do
get :existing
end
end
resources :employee_master_data, only: %i[index show]
scope '/evaluator', controller: 'evaluator' do
get :index
get :overview
get :details
get :compose_report
get :report
get :export_csv
get ':evaluation', to: 'evaluator#overview'
end
resource :periods, only: %i[show update destroy]
namespace :plannings do
resources :orders, only: %i[index show update destroy] do
get 'new', on: :member, as: 'new'
end
resources :employees, only: %i[index show update destroy] do
get 'new', on: :member, as: 'new'
end
resources :departments, only: [:index] do
resource :multi_orders, only: %i[show new update destroy]
resource :multi_employees, only: %i[show new update destroy]
end
resources :custom_lists do
resource :multi_orders, only: %i[show new update destroy]
resource :multi_employees, only: %i[show new update destroy]
end
resource :company, only: :show
end
resources :meal_compensations, only: %i[index show] do
member do
get :details
end
end
get :vacations, to: 'vacations#show'
get 'weekly_graph/:employee_id', to: 'weekly_graph#show', as: :weekly_graph
scope '/reports' do
get :orders, to: 'order_reports#index', as: :reports_orders
get :workload, to: 'workload_report#index', as: :reports_workload
get :revenue, to: 'revenue_reports#index', as: :reports_revenue
get :capacity, to: 'capacity_report#index', as: :reports_capacity
get :export, to: 'export_report#index', as: :reports_export
end
get '/login', to: redirect('/employees/sign_in')
get '/login/login', to: redirect('/employees/sign_in')
get 'status/health', to: 'status#health'
get 'status/readiness', to: 'status#readiness'
match '/404', to: 'errors#not_found', via: :all
match '/500', to: 'errors#internal_server_error', via: :all
match '/503', to: 'errors#service_unavailable', via: :all
get 'design_guide', to: 'design_guide#index'
end