zou 0.20.82__py3-none-any.whl → 0.20.84__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zou/__init__.py +1 -1
- zou/app/blueprints/assets/resources.py +1060 -153
- zou/app/blueprints/auth/resources.py +368 -238
- zou/app/blueprints/breakdown/resources.py +584 -94
- zou/app/blueprints/chats/resources.py +176 -37
- zou/app/blueprints/comments/resources.py +409 -150
- zou/app/blueprints/concepts/resources.py +443 -63
- zou/app/blueprints/crud/asset_instance.py +272 -0
- zou/app/blueprints/crud/attachment_file.py +263 -0
- zou/app/blueprints/crud/base.py +176 -69
- zou/app/blueprints/crud/budget.py +278 -0
- zou/app/blueprints/crud/budget_entry.py +269 -0
- zou/app/blueprints/crud/chat.py +282 -0
- zou/app/blueprints/crud/chat_message.py +286 -0
- zou/app/blueprints/crud/comments.py +312 -1
- zou/app/blueprints/crud/custom_action.py +268 -0
- zou/app/blueprints/crud/day_off.py +298 -0
- zou/app/blueprints/crud/department.py +268 -0
- zou/app/blueprints/crud/entity.py +297 -3
- zou/app/blueprints/crud/entity_link.py +303 -0
- zou/app/blueprints/crud/entity_type.py +269 -0
- zou/app/blueprints/crud/event.py +197 -0
- zou/app/blueprints/crud/file_status.py +268 -0
- zou/app/blueprints/crud/hardware_item.py +268 -0
- zou/app/blueprints/crud/metadata_descriptor.py +312 -0
- zou/app/blueprints/crud/milestone.py +302 -1
- zou/app/blueprints/crud/news.py +285 -0
- zou/app/blueprints/crud/notification.py +287 -0
- zou/app/blueprints/crud/organisation.py +269 -0
- zou/app/blueprints/crud/output_file.py +34 -10
- zou/app/blueprints/crud/output_type.py +30 -10
- zou/app/blueprints/crud/person.py +407 -2
- zou/app/blueprints/crud/playlist.py +322 -4
- zou/app/blueprints/crud/plugin.py +269 -0
- zou/app/blueprints/crud/preview_background_file.py +272 -0
- zou/app/blueprints/crud/preview_file.py +280 -9
- zou/app/blueprints/crud/production_schedule_version.py +569 -0
- zou/app/blueprints/crud/project.py +440 -0
- zou/app/blueprints/crud/project_status.py +268 -0
- zou/app/blueprints/crud/salary_scale.py +185 -5
- zou/app/blueprints/crud/schedule_item.py +305 -0
- zou/app/blueprints/crud/search_filter.py +302 -0
- zou/app/blueprints/crud/search_filter_group.py +270 -0
- zou/app/blueprints/crud/software.py +30 -10
- zou/app/blueprints/crud/status_automation.py +296 -2
- zou/app/blueprints/crud/studio.py +268 -0
- zou/app/blueprints/crud/subscription.py +279 -0
- zou/app/blueprints/crud/task.py +325 -5
- zou/app/blueprints/crud/task_status.py +301 -0
- zou/app/blueprints/crud/task_type.py +283 -0
- zou/app/blueprints/crud/time_spent.py +327 -0
- zou/app/blueprints/crud/working_file.py +273 -10
- zou/app/blueprints/departments/resources.py +302 -68
- zou/app/blueprints/edits/resources.py +651 -81
- zou/app/blueprints/entities/resources.py +104 -39
- zou/app/blueprints/events/resources.py +96 -8
- zou/app/blueprints/export/csv/assets.py +15 -5
- zou/app/blueprints/export/csv/base.py +12 -3
- zou/app/blueprints/export/csv/casting.py +32 -5
- zou/app/blueprints/export/csv/edits.py +15 -5
- zou/app/blueprints/export/csv/persons.py +24 -0
- zou/app/blueprints/export/csv/playlists.py +16 -5
- zou/app/blueprints/export/csv/projects.py +23 -0
- zou/app/blueprints/export/csv/shots.py +15 -5
- zou/app/blueprints/export/csv/task_types.py +23 -0
- zou/app/blueprints/export/csv/tasks.py +24 -0
- zou/app/blueprints/export/csv/time_spents.py +24 -0
- zou/app/blueprints/files/resources.py +928 -377
- zou/app/blueprints/index/resources.py +49 -42
- zou/app/blueprints/news/resources.py +47 -27
- zou/app/blueprints/persons/resources.py +644 -271
- zou/app/blueprints/playlists/resources.py +154 -72
- zou/app/blueprints/previews/resources.py +473 -228
- zou/app/blueprints/projects/__init__.py +5 -0
- zou/app/blueprints/projects/resources.py +987 -420
- zou/app/blueprints/search/resources.py +44 -32
- zou/app/blueprints/shots/resources.py +1338 -88
- zou/app/blueprints/source/csv/assets.py +44 -6
- zou/app/blueprints/source/csv/casting.py +43 -6
- zou/app/blueprints/source/csv/edits.py +47 -9
- zou/app/blueprints/source/csv/persons.py +43 -4
- zou/app/blueprints/source/csv/shots.py +47 -6
- zou/app/blueprints/source/csv/task_type_estimations.py +95 -35
- zou/app/blueprints/source/kitsu.py +433 -11
- zou/app/blueprints/source/otio.py +215 -20
- zou/app/blueprints/source/shotgun/assets.py +146 -0
- zou/app/blueprints/source/shotgun/base.py +85 -14
- zou/app/blueprints/source/shotgun/episode.py +124 -0
- zou/app/blueprints/source/shotgun/import_errors.py +105 -14
- zou/app/blueprints/source/shotgun/notes.py +132 -0
- zou/app/blueprints/source/shotgun/person.py +163 -0
- zou/app/blueprints/source/shotgun/project.py +120 -0
- zou/app/blueprints/source/shotgun/scene.py +120 -0
- zou/app/blueprints/source/shotgun/sequence.py +134 -0
- zou/app/blueprints/source/shotgun/shot.py +166 -0
- zou/app/blueprints/source/shotgun/status.py +129 -0
- zou/app/blueprints/source/shotgun/steps.py +138 -0
- zou/app/blueprints/source/shotgun/tasks.py +199 -0
- zou/app/blueprints/source/shotgun/team.py +132 -0
- zou/app/blueprints/source/shotgun/versions.py +155 -0
- zou/app/blueprints/tasks/resources.py +1197 -308
- zou/app/blueprints/user/resources.py +1808 -215
- zou/app/models/metadata_descriptor.py +1 -0
- zou/app/services/persons_service.py +1 -1
- zou/app/services/projects_service.py +45 -1
- zou/app/services/time_spents_service.py +1 -1
- zou/app/swagger.py +100 -27
- zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/METADATA +18 -18
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/RECORD +114 -113
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/WHEEL +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/entry_points.txt +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.custom_action import CustomAction
|
|
2
4
|
|
|
3
5
|
from zou.app.blueprints.crud.base import BaseModelsResource, BaseModelResource
|
|
@@ -13,6 +15,130 @@ class CustomActionsResource(BaseModelsResource):
|
|
|
13
15
|
user_service.block_access_to_vendor()
|
|
14
16
|
return True
|
|
15
17
|
|
|
18
|
+
@jwt_required()
|
|
19
|
+
def get(self):
|
|
20
|
+
"""
|
|
21
|
+
Get custom actions
|
|
22
|
+
---
|
|
23
|
+
tags:
|
|
24
|
+
- Crud
|
|
25
|
+
description: Retrieve all custom actions. Supports filtering via
|
|
26
|
+
query parameters and pagination. Vendor access is blocked.
|
|
27
|
+
parameters:
|
|
28
|
+
- in: query
|
|
29
|
+
name: page
|
|
30
|
+
required: false
|
|
31
|
+
schema:
|
|
32
|
+
type: integer
|
|
33
|
+
example: 1
|
|
34
|
+
description: Page number for pagination
|
|
35
|
+
- in: query
|
|
36
|
+
name: limit
|
|
37
|
+
required: false
|
|
38
|
+
schema:
|
|
39
|
+
type: integer
|
|
40
|
+
example: 50
|
|
41
|
+
description: Number of results per page
|
|
42
|
+
- in: query
|
|
43
|
+
name: relations
|
|
44
|
+
required: false
|
|
45
|
+
schema:
|
|
46
|
+
type: boolean
|
|
47
|
+
default: false
|
|
48
|
+
example: false
|
|
49
|
+
description: Whether to include relations
|
|
50
|
+
responses:
|
|
51
|
+
200:
|
|
52
|
+
description: Custom actions retrieved successfully
|
|
53
|
+
content:
|
|
54
|
+
application/json:
|
|
55
|
+
schema:
|
|
56
|
+
oneOf:
|
|
57
|
+
- type: array
|
|
58
|
+
items:
|
|
59
|
+
type: object
|
|
60
|
+
- type: object
|
|
61
|
+
properties:
|
|
62
|
+
data:
|
|
63
|
+
type: array
|
|
64
|
+
items:
|
|
65
|
+
type: object
|
|
66
|
+
example: []
|
|
67
|
+
total:
|
|
68
|
+
type: integer
|
|
69
|
+
example: 100
|
|
70
|
+
nb_pages:
|
|
71
|
+
type: integer
|
|
72
|
+
example: 2
|
|
73
|
+
limit:
|
|
74
|
+
type: integer
|
|
75
|
+
example: 50
|
|
76
|
+
offset:
|
|
77
|
+
type: integer
|
|
78
|
+
example: 0
|
|
79
|
+
page:
|
|
80
|
+
type: integer
|
|
81
|
+
example: 1
|
|
82
|
+
400:
|
|
83
|
+
description: Invalid filter format or query error
|
|
84
|
+
"""
|
|
85
|
+
return super().get()
|
|
86
|
+
|
|
87
|
+
@jwt_required()
|
|
88
|
+
def post(self):
|
|
89
|
+
"""
|
|
90
|
+
Create custom action
|
|
91
|
+
---
|
|
92
|
+
tags:
|
|
93
|
+
- Crud
|
|
94
|
+
description: Create a new custom action with data provided in the
|
|
95
|
+
request body. JSON format is expected.
|
|
96
|
+
requestBody:
|
|
97
|
+
required: true
|
|
98
|
+
content:
|
|
99
|
+
application/json:
|
|
100
|
+
schema:
|
|
101
|
+
type: object
|
|
102
|
+
required:
|
|
103
|
+
- name
|
|
104
|
+
properties:
|
|
105
|
+
name:
|
|
106
|
+
type: string
|
|
107
|
+
example: Custom Action Name
|
|
108
|
+
url_pattern:
|
|
109
|
+
type: string
|
|
110
|
+
example: "/api/actions/{id}"
|
|
111
|
+
responses:
|
|
112
|
+
201:
|
|
113
|
+
description: Custom action created successfully
|
|
114
|
+
content:
|
|
115
|
+
application/json:
|
|
116
|
+
schema:
|
|
117
|
+
type: object
|
|
118
|
+
properties:
|
|
119
|
+
id:
|
|
120
|
+
type: string
|
|
121
|
+
format: uuid
|
|
122
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
123
|
+
name:
|
|
124
|
+
type: string
|
|
125
|
+
example: Custom Action Name
|
|
126
|
+
url_pattern:
|
|
127
|
+
type: string
|
|
128
|
+
example: "/api/actions/{id}"
|
|
129
|
+
created_at:
|
|
130
|
+
type: string
|
|
131
|
+
format: date-time
|
|
132
|
+
example: "2024-01-15T10:30:00Z"
|
|
133
|
+
updated_at:
|
|
134
|
+
type: string
|
|
135
|
+
format: date-time
|
|
136
|
+
example: "2024-01-15T10:30:00Z"
|
|
137
|
+
400:
|
|
138
|
+
description: Invalid data format or validation error
|
|
139
|
+
"""
|
|
140
|
+
return super().post()
|
|
141
|
+
|
|
16
142
|
def post_creation(self, custom_action):
|
|
17
143
|
custom_actions_service.clear_custom_action_cache()
|
|
18
144
|
return custom_action.serialize()
|
|
@@ -22,6 +148,148 @@ class CustomActionResource(BaseModelResource):
|
|
|
22
148
|
def __init__(self):
|
|
23
149
|
BaseModelResource.__init__(self, CustomAction)
|
|
24
150
|
|
|
151
|
+
@jwt_required()
|
|
152
|
+
def get(self, instance_id):
|
|
153
|
+
"""
|
|
154
|
+
Get custom action
|
|
155
|
+
---
|
|
156
|
+
tags:
|
|
157
|
+
- Crud
|
|
158
|
+
description: Retrieve a custom action by its ID and return it as a
|
|
159
|
+
JSON object. Supports including relations.
|
|
160
|
+
parameters:
|
|
161
|
+
- in: path
|
|
162
|
+
name: instance_id
|
|
163
|
+
required: true
|
|
164
|
+
schema:
|
|
165
|
+
type: string
|
|
166
|
+
format: uuid
|
|
167
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
168
|
+
- in: query
|
|
169
|
+
name: relations
|
|
170
|
+
required: false
|
|
171
|
+
schema:
|
|
172
|
+
type: boolean
|
|
173
|
+
default: true
|
|
174
|
+
example: true
|
|
175
|
+
description: Whether to include relations
|
|
176
|
+
responses:
|
|
177
|
+
200:
|
|
178
|
+
description: Custom action retrieved successfully
|
|
179
|
+
content:
|
|
180
|
+
application/json:
|
|
181
|
+
schema:
|
|
182
|
+
type: object
|
|
183
|
+
properties:
|
|
184
|
+
id:
|
|
185
|
+
type: string
|
|
186
|
+
format: uuid
|
|
187
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
188
|
+
name:
|
|
189
|
+
type: string
|
|
190
|
+
example: Custom Action Name
|
|
191
|
+
url_pattern:
|
|
192
|
+
type: string
|
|
193
|
+
example: "/api/actions/{id}"
|
|
194
|
+
created_at:
|
|
195
|
+
type: string
|
|
196
|
+
format: date-time
|
|
197
|
+
example: "2024-01-15T10:30:00Z"
|
|
198
|
+
updated_at:
|
|
199
|
+
type: string
|
|
200
|
+
format: date-time
|
|
201
|
+
example: "2024-01-15T10:30:00Z"
|
|
202
|
+
400:
|
|
203
|
+
description: Invalid ID format or query error
|
|
204
|
+
"""
|
|
205
|
+
return super().get(instance_id)
|
|
206
|
+
|
|
207
|
+
@jwt_required()
|
|
208
|
+
def put(self, instance_id):
|
|
209
|
+
"""
|
|
210
|
+
Update custom action
|
|
211
|
+
---
|
|
212
|
+
tags:
|
|
213
|
+
- Crud
|
|
214
|
+
description: Update a custom action with data provided in the
|
|
215
|
+
request body. JSON format is expected.
|
|
216
|
+
parameters:
|
|
217
|
+
- in: path
|
|
218
|
+
name: instance_id
|
|
219
|
+
required: true
|
|
220
|
+
schema:
|
|
221
|
+
type: string
|
|
222
|
+
format: uuid
|
|
223
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
224
|
+
requestBody:
|
|
225
|
+
required: true
|
|
226
|
+
content:
|
|
227
|
+
application/json:
|
|
228
|
+
schema:
|
|
229
|
+
type: object
|
|
230
|
+
properties:
|
|
231
|
+
name:
|
|
232
|
+
type: string
|
|
233
|
+
example: Updated Custom Action Name
|
|
234
|
+
url_pattern:
|
|
235
|
+
type: string
|
|
236
|
+
example: "/api/actions/{id}"
|
|
237
|
+
responses:
|
|
238
|
+
200:
|
|
239
|
+
description: Custom action updated successfully
|
|
240
|
+
content:
|
|
241
|
+
application/json:
|
|
242
|
+
schema:
|
|
243
|
+
type: object
|
|
244
|
+
properties:
|
|
245
|
+
id:
|
|
246
|
+
type: string
|
|
247
|
+
format: uuid
|
|
248
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
249
|
+
name:
|
|
250
|
+
type: string
|
|
251
|
+
example: Updated Custom Action Name
|
|
252
|
+
url_pattern:
|
|
253
|
+
type: string
|
|
254
|
+
example: "/api/actions/{id}"
|
|
255
|
+
created_at:
|
|
256
|
+
type: string
|
|
257
|
+
format: date-time
|
|
258
|
+
example: "2024-01-15T10:30:00Z"
|
|
259
|
+
updated_at:
|
|
260
|
+
type: string
|
|
261
|
+
format: date-time
|
|
262
|
+
example: "2024-01-15T11:00:00Z"
|
|
263
|
+
400:
|
|
264
|
+
description: Invalid data format or validation error
|
|
265
|
+
"""
|
|
266
|
+
return super().put(instance_id)
|
|
267
|
+
|
|
268
|
+
@jwt_required()
|
|
269
|
+
def delete(self, instance_id):
|
|
270
|
+
"""
|
|
271
|
+
Delete custom action
|
|
272
|
+
---
|
|
273
|
+
tags:
|
|
274
|
+
- Crud
|
|
275
|
+
description: Delete a custom action by its ID. Returns empty
|
|
276
|
+
response on success.
|
|
277
|
+
parameters:
|
|
278
|
+
- in: path
|
|
279
|
+
name: instance_id
|
|
280
|
+
required: true
|
|
281
|
+
schema:
|
|
282
|
+
type: string
|
|
283
|
+
format: uuid
|
|
284
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
285
|
+
responses:
|
|
286
|
+
204:
|
|
287
|
+
description: Custom action deleted successfully
|
|
288
|
+
400:
|
|
289
|
+
description: Integrity error or cannot delete
|
|
290
|
+
"""
|
|
291
|
+
return super().delete(instance_id)
|
|
292
|
+
|
|
25
293
|
def post_update(self, custom_action, data):
|
|
26
294
|
custom_actions_service.clear_custom_action_cache()
|
|
27
295
|
return custom_action
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.day_off import DayOff
|
|
2
4
|
from zou.app.models.time_spent import TimeSpent
|
|
3
5
|
|
|
@@ -17,6 +19,145 @@ class DayOffsResource(BaseModelsResource):
|
|
|
17
19
|
def check_create_permissions(self, data):
|
|
18
20
|
return user_service.check_day_off_access(data)
|
|
19
21
|
|
|
22
|
+
@jwt_required()
|
|
23
|
+
def get(self):
|
|
24
|
+
"""
|
|
25
|
+
Get day offs
|
|
26
|
+
---
|
|
27
|
+
tags:
|
|
28
|
+
- Crud
|
|
29
|
+
description: Retrieve all day offs. Supports filtering via query
|
|
30
|
+
parameters and pagination.
|
|
31
|
+
parameters:
|
|
32
|
+
- in: query
|
|
33
|
+
name: page
|
|
34
|
+
required: false
|
|
35
|
+
schema:
|
|
36
|
+
type: integer
|
|
37
|
+
example: 1
|
|
38
|
+
description: Page number for pagination
|
|
39
|
+
- in: query
|
|
40
|
+
name: limit
|
|
41
|
+
required: false
|
|
42
|
+
schema:
|
|
43
|
+
type: integer
|
|
44
|
+
example: 50
|
|
45
|
+
description: Number of results per page
|
|
46
|
+
- in: query
|
|
47
|
+
name: relations
|
|
48
|
+
required: false
|
|
49
|
+
schema:
|
|
50
|
+
type: boolean
|
|
51
|
+
default: false
|
|
52
|
+
example: false
|
|
53
|
+
description: Whether to include relations
|
|
54
|
+
responses:
|
|
55
|
+
200:
|
|
56
|
+
description: Day offs retrieved successfully
|
|
57
|
+
content:
|
|
58
|
+
application/json:
|
|
59
|
+
schema:
|
|
60
|
+
oneOf:
|
|
61
|
+
- type: array
|
|
62
|
+
items:
|
|
63
|
+
type: object
|
|
64
|
+
- type: object
|
|
65
|
+
properties:
|
|
66
|
+
data:
|
|
67
|
+
type: array
|
|
68
|
+
items:
|
|
69
|
+
type: object
|
|
70
|
+
example: []
|
|
71
|
+
total:
|
|
72
|
+
type: integer
|
|
73
|
+
example: 100
|
|
74
|
+
nb_pages:
|
|
75
|
+
type: integer
|
|
76
|
+
example: 2
|
|
77
|
+
limit:
|
|
78
|
+
type: integer
|
|
79
|
+
example: 50
|
|
80
|
+
offset:
|
|
81
|
+
type: integer
|
|
82
|
+
example: 0
|
|
83
|
+
page:
|
|
84
|
+
type: integer
|
|
85
|
+
example: 1
|
|
86
|
+
400:
|
|
87
|
+
description: Invalid filter format or query error
|
|
88
|
+
"""
|
|
89
|
+
return super().get()
|
|
90
|
+
|
|
91
|
+
@jwt_required()
|
|
92
|
+
def post(self):
|
|
93
|
+
"""
|
|
94
|
+
Create day off
|
|
95
|
+
---
|
|
96
|
+
tags:
|
|
97
|
+
- Crud
|
|
98
|
+
description: Create a new day off with data provided in the
|
|
99
|
+
request body. JSON format is expected. Deletes overlapping
|
|
100
|
+
time spent entries.
|
|
101
|
+
requestBody:
|
|
102
|
+
required: true
|
|
103
|
+
content:
|
|
104
|
+
application/json:
|
|
105
|
+
schema:
|
|
106
|
+
type: object
|
|
107
|
+
required:
|
|
108
|
+
- date
|
|
109
|
+
- end_date
|
|
110
|
+
- person_id
|
|
111
|
+
properties:
|
|
112
|
+
date:
|
|
113
|
+
type: string
|
|
114
|
+
format: date
|
|
115
|
+
example: "2024-01-15"
|
|
116
|
+
end_date:
|
|
117
|
+
type: string
|
|
118
|
+
format: date
|
|
119
|
+
example: "2024-01-20"
|
|
120
|
+
person_id:
|
|
121
|
+
type: string
|
|
122
|
+
format: uuid
|
|
123
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
124
|
+
responses:
|
|
125
|
+
201:
|
|
126
|
+
description: Day off created successfully
|
|
127
|
+
content:
|
|
128
|
+
application/json:
|
|
129
|
+
schema:
|
|
130
|
+
type: object
|
|
131
|
+
properties:
|
|
132
|
+
id:
|
|
133
|
+
type: string
|
|
134
|
+
format: uuid
|
|
135
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
136
|
+
date:
|
|
137
|
+
type: string
|
|
138
|
+
format: date
|
|
139
|
+
example: "2024-01-15"
|
|
140
|
+
end_date:
|
|
141
|
+
type: string
|
|
142
|
+
format: date
|
|
143
|
+
example: "2024-01-20"
|
|
144
|
+
person_id:
|
|
145
|
+
type: string
|
|
146
|
+
format: uuid
|
|
147
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
148
|
+
created_at:
|
|
149
|
+
type: string
|
|
150
|
+
format: date-time
|
|
151
|
+
example: "2024-01-15T10:30:00Z"
|
|
152
|
+
updated_at:
|
|
153
|
+
type: string
|
|
154
|
+
format: date-time
|
|
155
|
+
example: "2024-01-15T10:30:00Z"
|
|
156
|
+
400:
|
|
157
|
+
description: Invalid data format or day off already exists
|
|
158
|
+
"""
|
|
159
|
+
return super().post()
|
|
160
|
+
|
|
20
161
|
def check_creation_integrity(self, data):
|
|
21
162
|
if time_spents_service.get_day_offs_between(
|
|
22
163
|
data["date"], data["end_date"], data["person_id"]
|
|
@@ -39,6 +180,163 @@ class DayOffResource(BaseModelResource):
|
|
|
39
180
|
def __init__(self):
|
|
40
181
|
BaseModelResource.__init__(self, DayOff)
|
|
41
182
|
|
|
183
|
+
@jwt_required()
|
|
184
|
+
def get(self, instance_id):
|
|
185
|
+
"""
|
|
186
|
+
Get day off
|
|
187
|
+
---
|
|
188
|
+
tags:
|
|
189
|
+
- Crud
|
|
190
|
+
description: Retrieve a day off by its ID and return it as a JSON
|
|
191
|
+
object. Supports including relations.
|
|
192
|
+
parameters:
|
|
193
|
+
- in: path
|
|
194
|
+
name: instance_id
|
|
195
|
+
required: true
|
|
196
|
+
schema:
|
|
197
|
+
type: string
|
|
198
|
+
format: uuid
|
|
199
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
200
|
+
- in: query
|
|
201
|
+
name: relations
|
|
202
|
+
required: false
|
|
203
|
+
schema:
|
|
204
|
+
type: boolean
|
|
205
|
+
default: true
|
|
206
|
+
example: true
|
|
207
|
+
description: Whether to include relations
|
|
208
|
+
responses:
|
|
209
|
+
200:
|
|
210
|
+
description: Day off retrieved successfully
|
|
211
|
+
content:
|
|
212
|
+
application/json:
|
|
213
|
+
schema:
|
|
214
|
+
type: object
|
|
215
|
+
properties:
|
|
216
|
+
id:
|
|
217
|
+
type: string
|
|
218
|
+
format: uuid
|
|
219
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
220
|
+
date:
|
|
221
|
+
type: string
|
|
222
|
+
format: date
|
|
223
|
+
example: "2024-01-15"
|
|
224
|
+
end_date:
|
|
225
|
+
type: string
|
|
226
|
+
format: date
|
|
227
|
+
example: "2024-01-20"
|
|
228
|
+
person_id:
|
|
229
|
+
type: string
|
|
230
|
+
format: uuid
|
|
231
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
232
|
+
created_at:
|
|
233
|
+
type: string
|
|
234
|
+
format: date-time
|
|
235
|
+
example: "2024-01-15T10:30:00Z"
|
|
236
|
+
updated_at:
|
|
237
|
+
type: string
|
|
238
|
+
format: date-time
|
|
239
|
+
example: "2024-01-15T10:30:00Z"
|
|
240
|
+
400:
|
|
241
|
+
description: Invalid ID format or query error
|
|
242
|
+
"""
|
|
243
|
+
return super().get(instance_id)
|
|
244
|
+
|
|
245
|
+
@jwt_required()
|
|
246
|
+
def put(self, instance_id):
|
|
247
|
+
"""
|
|
248
|
+
Update day off
|
|
249
|
+
---
|
|
250
|
+
tags:
|
|
251
|
+
- Crud
|
|
252
|
+
description: Update a day off with data provided in the request
|
|
253
|
+
body. JSON format is expected. Deletes overlapping time spent
|
|
254
|
+
entries.
|
|
255
|
+
parameters:
|
|
256
|
+
- in: path
|
|
257
|
+
name: instance_id
|
|
258
|
+
required: true
|
|
259
|
+
schema:
|
|
260
|
+
type: string
|
|
261
|
+
format: uuid
|
|
262
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
263
|
+
requestBody:
|
|
264
|
+
required: true
|
|
265
|
+
content:
|
|
266
|
+
application/json:
|
|
267
|
+
schema:
|
|
268
|
+
type: object
|
|
269
|
+
properties:
|
|
270
|
+
date:
|
|
271
|
+
type: string
|
|
272
|
+
format: date
|
|
273
|
+
example: "2024-01-16"
|
|
274
|
+
end_date:
|
|
275
|
+
type: string
|
|
276
|
+
format: date
|
|
277
|
+
example: "2024-01-21"
|
|
278
|
+
responses:
|
|
279
|
+
200:
|
|
280
|
+
description: Day off updated successfully
|
|
281
|
+
content:
|
|
282
|
+
application/json:
|
|
283
|
+
schema:
|
|
284
|
+
type: object
|
|
285
|
+
properties:
|
|
286
|
+
id:
|
|
287
|
+
type: string
|
|
288
|
+
format: uuid
|
|
289
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
290
|
+
date:
|
|
291
|
+
type: string
|
|
292
|
+
format: date
|
|
293
|
+
example: "2024-01-16"
|
|
294
|
+
end_date:
|
|
295
|
+
type: string
|
|
296
|
+
format: date
|
|
297
|
+
example: "2024-01-21"
|
|
298
|
+
person_id:
|
|
299
|
+
type: string
|
|
300
|
+
format: uuid
|
|
301
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
302
|
+
created_at:
|
|
303
|
+
type: string
|
|
304
|
+
format: date-time
|
|
305
|
+
example: "2024-01-15T10:30:00Z"
|
|
306
|
+
updated_at:
|
|
307
|
+
type: string
|
|
308
|
+
format: date-time
|
|
309
|
+
example: "2024-01-15T11:00:00Z"
|
|
310
|
+
400:
|
|
311
|
+
description: Invalid data format or day off already exists
|
|
312
|
+
"""
|
|
313
|
+
return super().put(instance_id)
|
|
314
|
+
|
|
315
|
+
@jwt_required()
|
|
316
|
+
def delete(self, instance_id):
|
|
317
|
+
"""
|
|
318
|
+
Delete day off
|
|
319
|
+
---
|
|
320
|
+
tags:
|
|
321
|
+
- Crud
|
|
322
|
+
description: Delete a day off by its ID. Returns empty response
|
|
323
|
+
on success.
|
|
324
|
+
parameters:
|
|
325
|
+
- in: path
|
|
326
|
+
name: instance_id
|
|
327
|
+
required: true
|
|
328
|
+
schema:
|
|
329
|
+
type: string
|
|
330
|
+
format: uuid
|
|
331
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
332
|
+
responses:
|
|
333
|
+
204:
|
|
334
|
+
description: Day off deleted successfully
|
|
335
|
+
400:
|
|
336
|
+
description: Integrity error or cannot delete
|
|
337
|
+
"""
|
|
338
|
+
return super().delete(instance_id)
|
|
339
|
+
|
|
42
340
|
def check_delete_permissions(self, instance_dict):
|
|
43
341
|
return user_service.check_day_off_access(instance_dict)
|
|
44
342
|
|