zou 0.20.72__py3-none-any.whl → 0.20.74__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/comments/resources.py +5 -2
- zou/app/blueprints/entities/resources.py +142 -21
- zou/app/blueprints/files/resources.py +876 -380
- zou/app/blueprints/index/resources.py +205 -20
- zou/app/blueprints/news/resources.py +187 -51
- zou/app/blueprints/persons/resources.py +301 -166
- zou/app/blueprints/playlists/resources.py +313 -147
- zou/app/blueprints/projects/__init__.py +7 -0
- zou/app/blueprints/projects/resources.py +597 -152
- zou/app/blueprints/search/resources.py +61 -19
- zou/app/blueprints/source/csv/assets.py +4 -0
- zou/app/blueprints/source/csv/shots.py +4 -0
- zou/app/blueprints/tasks/resources.py +477 -215
- zou/app/blueprints/user/resources.py +667 -343
- zou/app/services/comments_service.py +8 -5
- zou/app/services/time_spents_service.py +61 -1
- {zou-0.20.72.dist-info → zou-0.20.74.dist-info}/METADATA +13 -13
- {zou-0.20.72.dist-info → zou-0.20.74.dist-info}/RECORD +23 -23
- {zou-0.20.72.dist-info → zou-0.20.74.dist-info}/WHEEL +0 -0
- {zou-0.20.72.dist-info → zou-0.20.74.dist-info}/entry_points.txt +0 -0
- {zou-0.20.72.dist-info → zou-0.20.74.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.72.dist-info → zou-0.20.74.dist-info}/top_level.txt +0 -0
|
@@ -17,9 +17,6 @@ from zou.app.services.exception import WrongDateFormatException
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class AssetTasksResource(Resource):
|
|
20
|
-
"""
|
|
21
|
-
Return tasks related to given asset for current user.
|
|
22
|
-
"""
|
|
23
20
|
|
|
24
21
|
def get(self, asset_id):
|
|
25
22
|
"""
|
|
@@ -30,22 +27,28 @@ class AssetTasksResource(Resource):
|
|
|
30
27
|
parameters:
|
|
31
28
|
- in: path
|
|
32
29
|
name: asset_id
|
|
33
|
-
required:
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
required: true
|
|
31
|
+
schema:
|
|
32
|
+
type: string
|
|
33
|
+
format: uuid
|
|
36
34
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
37
35
|
responses:
|
|
38
36
|
200:
|
|
39
|
-
|
|
37
|
+
description: Tasks related to given asset for current user
|
|
38
|
+
content:
|
|
39
|
+
application/json:
|
|
40
|
+
schema:
|
|
41
|
+
type: array
|
|
42
|
+
items:
|
|
43
|
+
type: object
|
|
44
|
+
404:
|
|
45
|
+
description: Asset not found
|
|
40
46
|
"""
|
|
41
47
|
assets_service.get_asset(asset_id)
|
|
42
48
|
return user_service.get_tasks_for_entity(asset_id)
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
class AssetTaskTypesResource(Resource):
|
|
46
|
-
"""
|
|
47
|
-
Return task types related to given asset for current user.
|
|
48
|
-
"""
|
|
49
52
|
|
|
50
53
|
def get(self, asset_id):
|
|
51
54
|
"""
|
|
@@ -56,22 +59,28 @@ class AssetTaskTypesResource(Resource):
|
|
|
56
59
|
parameters:
|
|
57
60
|
- in: path
|
|
58
61
|
name: asset_id
|
|
59
|
-
required:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
required: true
|
|
63
|
+
schema:
|
|
64
|
+
type: string
|
|
65
|
+
format: uuid
|
|
62
66
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
63
67
|
responses:
|
|
64
68
|
200:
|
|
65
|
-
|
|
69
|
+
description: Task types related to given asset for current user
|
|
70
|
+
content:
|
|
71
|
+
application/json:
|
|
72
|
+
schema:
|
|
73
|
+
type: array
|
|
74
|
+
items:
|
|
75
|
+
type: object
|
|
76
|
+
404:
|
|
77
|
+
description: Asset not found
|
|
66
78
|
"""
|
|
67
79
|
assets_service.get_asset(asset_id)
|
|
68
80
|
return user_service.get_task_types_for_entity(asset_id)
|
|
69
81
|
|
|
70
82
|
|
|
71
83
|
class ShotTaskTypesResource(Resource):
|
|
72
|
-
"""
|
|
73
|
-
Return tasks related to given shot for current user.
|
|
74
|
-
"""
|
|
75
84
|
|
|
76
85
|
def get(self, shot_id):
|
|
77
86
|
"""
|
|
@@ -82,13 +91,22 @@ class ShotTaskTypesResource(Resource):
|
|
|
82
91
|
parameters:
|
|
83
92
|
- in: path
|
|
84
93
|
name: shot_id
|
|
85
|
-
required:
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
required: true
|
|
95
|
+
schema:
|
|
96
|
+
type: string
|
|
97
|
+
format: uuid
|
|
88
98
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
89
99
|
responses:
|
|
90
100
|
200:
|
|
91
|
-
|
|
101
|
+
description: Tasks related to given shot for current user
|
|
102
|
+
content:
|
|
103
|
+
application/json:
|
|
104
|
+
schema:
|
|
105
|
+
type: array
|
|
106
|
+
items:
|
|
107
|
+
type: object
|
|
108
|
+
404:
|
|
109
|
+
description: Shot not found
|
|
92
110
|
"""
|
|
93
111
|
shots_service.get_shot(shot_id)
|
|
94
112
|
return user_service.get_task_types_for_entity(shot_id)
|
|
@@ -108,13 +126,22 @@ class SceneTaskTypesResource(Resource):
|
|
|
108
126
|
parameters:
|
|
109
127
|
- in: path
|
|
110
128
|
name: scene_id
|
|
111
|
-
required:
|
|
112
|
-
|
|
113
|
-
|
|
129
|
+
required: true
|
|
130
|
+
schema:
|
|
131
|
+
type: string
|
|
132
|
+
format: uuid
|
|
114
133
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
115
134
|
responses:
|
|
116
135
|
200:
|
|
117
|
-
|
|
136
|
+
description: Tasks related to given scene for current user
|
|
137
|
+
content:
|
|
138
|
+
application/json:
|
|
139
|
+
schema:
|
|
140
|
+
type: array
|
|
141
|
+
items:
|
|
142
|
+
type: object
|
|
143
|
+
404:
|
|
144
|
+
description: Scene not found
|
|
118
145
|
"""
|
|
119
146
|
shots_service.get_scene(scene_id)
|
|
120
147
|
return user_service.get_task_types_for_entity(scene_id)
|
|
@@ -134,23 +161,28 @@ class SequenceTaskTypesResource(Resource):
|
|
|
134
161
|
parameters:
|
|
135
162
|
- in: path
|
|
136
163
|
name: sequence_id
|
|
137
|
-
required:
|
|
138
|
-
|
|
139
|
-
|
|
164
|
+
required: true
|
|
165
|
+
schema:
|
|
166
|
+
type: string
|
|
167
|
+
format: uuid
|
|
140
168
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
141
169
|
responses:
|
|
142
170
|
200:
|
|
143
|
-
|
|
171
|
+
description: Tasks related to given sequence for current user
|
|
172
|
+
content:
|
|
173
|
+
application/json:
|
|
174
|
+
schema:
|
|
175
|
+
type: array
|
|
176
|
+
items:
|
|
177
|
+
type: object
|
|
178
|
+
404:
|
|
179
|
+
description: Sequence not found
|
|
144
180
|
"""
|
|
145
181
|
shots_service.get_sequence(sequence_id)
|
|
146
182
|
return user_service.get_task_types_for_entity(sequence_id)
|
|
147
183
|
|
|
148
184
|
|
|
149
185
|
class AssetTypeAssetsResource(Resource):
|
|
150
|
-
"""
|
|
151
|
-
Return assets of which type is given asset type and are listed in given
|
|
152
|
-
project if user has access to this project.
|
|
153
|
-
"""
|
|
154
186
|
|
|
155
187
|
def get(self, project_id, asset_type_id):
|
|
156
188
|
"""
|
|
@@ -162,20 +194,29 @@ class AssetTypeAssetsResource(Resource):
|
|
|
162
194
|
parameters:
|
|
163
195
|
- in: path
|
|
164
196
|
name: project_id
|
|
165
|
-
required:
|
|
166
|
-
|
|
167
|
-
|
|
197
|
+
required: true
|
|
198
|
+
schema:
|
|
199
|
+
type: string
|
|
200
|
+
format: uuid
|
|
168
201
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
169
202
|
- in: path
|
|
170
203
|
name: asset_type_id
|
|
171
|
-
required:
|
|
172
|
-
|
|
173
|
-
|
|
204
|
+
required: true
|
|
205
|
+
schema:
|
|
206
|
+
type: string
|
|
207
|
+
format: uuid
|
|
174
208
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
175
209
|
responses:
|
|
176
210
|
200:
|
|
177
|
-
|
|
178
|
-
|
|
211
|
+
description: Assets of which type is given asset type and are listed in given project
|
|
212
|
+
content:
|
|
213
|
+
application/json:
|
|
214
|
+
schema:
|
|
215
|
+
type: array
|
|
216
|
+
items:
|
|
217
|
+
type: object
|
|
218
|
+
404:
|
|
219
|
+
description: Project or asset type not found
|
|
179
220
|
"""
|
|
180
221
|
projects_service.get_project(project_id)
|
|
181
222
|
assets_service.get_asset_type(asset_type_id)
|
|
@@ -185,9 +226,6 @@ class AssetTypeAssetsResource(Resource):
|
|
|
185
226
|
|
|
186
227
|
|
|
187
228
|
class OpenProjectsResource(Resource, ArgsMixin):
|
|
188
|
-
"""
|
|
189
|
-
Return open projects for which the user has at least one task assigned.
|
|
190
|
-
"""
|
|
191
229
|
|
|
192
230
|
def get(self):
|
|
193
231
|
"""
|
|
@@ -195,20 +233,28 @@ class OpenProjectsResource(Resource, ArgsMixin):
|
|
|
195
233
|
---
|
|
196
234
|
tags:
|
|
197
235
|
- User
|
|
236
|
+
parameters:
|
|
237
|
+
- in: query
|
|
238
|
+
name: name
|
|
239
|
+
required: false
|
|
240
|
+
schema:
|
|
241
|
+
type: string
|
|
242
|
+
description: Filter projects by name
|
|
198
243
|
responses:
|
|
199
244
|
200:
|
|
200
|
-
|
|
201
|
-
|
|
245
|
+
description: Open projects for which the user has at least one task assigned
|
|
246
|
+
content:
|
|
247
|
+
application/json:
|
|
248
|
+
schema:
|
|
249
|
+
type: array
|
|
250
|
+
items:
|
|
251
|
+
type: object
|
|
202
252
|
"""
|
|
203
253
|
name = self.get_text_parameter("name")
|
|
204
254
|
return user_service.get_open_projects(name=name)
|
|
205
255
|
|
|
206
256
|
|
|
207
257
|
class ProjectSequencesResource(Resource):
|
|
208
|
-
"""
|
|
209
|
-
Return sequences related to given project if the current user has access
|
|
210
|
-
to it.
|
|
211
|
-
"""
|
|
212
258
|
|
|
213
259
|
def get(self, project_id):
|
|
214
260
|
"""
|
|
@@ -220,23 +266,28 @@ class ProjectSequencesResource(Resource):
|
|
|
220
266
|
parameters:
|
|
221
267
|
- in: path
|
|
222
268
|
name: project_id
|
|
223
|
-
required:
|
|
224
|
-
|
|
225
|
-
|
|
269
|
+
required: true
|
|
270
|
+
schema:
|
|
271
|
+
type: string
|
|
272
|
+
format: uuid
|
|
226
273
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
227
274
|
responses:
|
|
228
275
|
200:
|
|
229
|
-
|
|
276
|
+
description: Sequences related to given project
|
|
277
|
+
content:
|
|
278
|
+
application/json:
|
|
279
|
+
schema:
|
|
280
|
+
type: array
|
|
281
|
+
items:
|
|
282
|
+
type: object
|
|
283
|
+
404:
|
|
284
|
+
description: Project not found
|
|
230
285
|
"""
|
|
231
286
|
projects_service.get_project(project_id)
|
|
232
287
|
return user_service.get_sequences_for_project(project_id)
|
|
233
288
|
|
|
234
289
|
|
|
235
290
|
class ProjectEpisodesResource(Resource):
|
|
236
|
-
"""
|
|
237
|
-
Return episodes related to given project if the current user has access to
|
|
238
|
-
it.
|
|
239
|
-
"""
|
|
240
291
|
|
|
241
292
|
def get(self, project_id):
|
|
242
293
|
"""
|
|
@@ -248,23 +299,28 @@ class ProjectEpisodesResource(Resource):
|
|
|
248
299
|
parameters:
|
|
249
300
|
- in: path
|
|
250
301
|
name: project_id
|
|
251
|
-
required:
|
|
252
|
-
|
|
253
|
-
|
|
302
|
+
required: true
|
|
303
|
+
schema:
|
|
304
|
+
type: string
|
|
305
|
+
format: uuid
|
|
254
306
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
255
307
|
responses:
|
|
256
308
|
200:
|
|
257
|
-
|
|
309
|
+
description: Episodes related to given project
|
|
310
|
+
content:
|
|
311
|
+
application/json:
|
|
312
|
+
schema:
|
|
313
|
+
type: array
|
|
314
|
+
items:
|
|
315
|
+
type: object
|
|
316
|
+
404:
|
|
317
|
+
description: Project not found
|
|
258
318
|
"""
|
|
259
319
|
projects_service.get_project(project_id)
|
|
260
320
|
return user_service.get_project_episodes(project_id)
|
|
261
321
|
|
|
262
322
|
|
|
263
323
|
class ProjectAssetTypesResource(Resource):
|
|
264
|
-
"""
|
|
265
|
-
Return asset types related to given project if the current user has access
|
|
266
|
-
to it.
|
|
267
|
-
"""
|
|
268
324
|
|
|
269
325
|
def get(self, project_id):
|
|
270
326
|
"""
|
|
@@ -276,23 +332,28 @@ class ProjectAssetTypesResource(Resource):
|
|
|
276
332
|
parameters:
|
|
277
333
|
- in: path
|
|
278
334
|
name: project_id
|
|
279
|
-
required:
|
|
280
|
-
|
|
281
|
-
|
|
335
|
+
required: true
|
|
336
|
+
schema:
|
|
337
|
+
type: string
|
|
338
|
+
format: uuid
|
|
282
339
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
283
340
|
responses:
|
|
284
341
|
200:
|
|
285
|
-
|
|
342
|
+
description: Asset types related to given project
|
|
343
|
+
content:
|
|
344
|
+
application/json:
|
|
345
|
+
schema:
|
|
346
|
+
type: array
|
|
347
|
+
items:
|
|
348
|
+
type: object
|
|
349
|
+
404:
|
|
350
|
+
description: Project not found
|
|
286
351
|
"""
|
|
287
352
|
projects_service.get_project(project_id)
|
|
288
353
|
return user_service.get_asset_types_for_project(project_id)
|
|
289
354
|
|
|
290
355
|
|
|
291
356
|
class SequenceShotsResource(Resource):
|
|
292
|
-
"""
|
|
293
|
-
Return shots related to given sequence if the current user has access
|
|
294
|
-
to it.
|
|
295
|
-
"""
|
|
296
357
|
|
|
297
358
|
def get(self, sequence_id):
|
|
298
359
|
"""
|
|
@@ -304,23 +365,28 @@ class SequenceShotsResource(Resource):
|
|
|
304
365
|
parameters:
|
|
305
366
|
- in: path
|
|
306
367
|
name: sequence_id
|
|
307
|
-
required:
|
|
308
|
-
|
|
309
|
-
|
|
368
|
+
required: true
|
|
369
|
+
schema:
|
|
370
|
+
type: string
|
|
371
|
+
format: uuid
|
|
310
372
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
311
373
|
responses:
|
|
312
374
|
200:
|
|
313
|
-
|
|
375
|
+
description: Shots related to given sequence
|
|
376
|
+
content:
|
|
377
|
+
application/json:
|
|
378
|
+
schema:
|
|
379
|
+
type: array
|
|
380
|
+
items:
|
|
381
|
+
type: object
|
|
382
|
+
404:
|
|
383
|
+
description: Sequence not found
|
|
314
384
|
"""
|
|
315
385
|
shots_service.get_sequence(sequence_id)
|
|
316
386
|
return user_service.get_shots_for_sequence(sequence_id)
|
|
317
387
|
|
|
318
388
|
|
|
319
389
|
class SequenceScenesResource(Resource):
|
|
320
|
-
"""
|
|
321
|
-
Return scenes related to given sequence if the current user has access
|
|
322
|
-
to it.
|
|
323
|
-
"""
|
|
324
390
|
|
|
325
391
|
def get(self, sequence_id):
|
|
326
392
|
"""
|
|
@@ -332,22 +398,28 @@ class SequenceScenesResource(Resource):
|
|
|
332
398
|
parameters:
|
|
333
399
|
- in: path
|
|
334
400
|
name: sequence_id
|
|
335
|
-
required:
|
|
336
|
-
|
|
337
|
-
|
|
401
|
+
required: true
|
|
402
|
+
schema:
|
|
403
|
+
type: string
|
|
404
|
+
format: uuid
|
|
338
405
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
339
406
|
responses:
|
|
340
407
|
200:
|
|
341
|
-
|
|
408
|
+
description: Scenes related to given sequence
|
|
409
|
+
content:
|
|
410
|
+
application/json:
|
|
411
|
+
schema:
|
|
412
|
+
type: array
|
|
413
|
+
items:
|
|
414
|
+
type: object
|
|
415
|
+
404:
|
|
416
|
+
description: Sequence not found
|
|
342
417
|
"""
|
|
343
418
|
shots_service.get_sequence(sequence_id)
|
|
344
419
|
return user_service.get_scenes_for_sequence(sequence_id)
|
|
345
420
|
|
|
346
421
|
|
|
347
422
|
class ShotTasksResource(Resource):
|
|
348
|
-
"""
|
|
349
|
-
Return tasks related to given shot for current user.
|
|
350
|
-
"""
|
|
351
423
|
|
|
352
424
|
def get(self, shot_id):
|
|
353
425
|
"""
|
|
@@ -358,22 +430,28 @@ class ShotTasksResource(Resource):
|
|
|
358
430
|
parameters:
|
|
359
431
|
- in: path
|
|
360
432
|
name: shot_id
|
|
361
|
-
required:
|
|
362
|
-
|
|
363
|
-
|
|
433
|
+
required: true
|
|
434
|
+
schema:
|
|
435
|
+
type: string
|
|
436
|
+
format: uuid
|
|
364
437
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
365
438
|
responses:
|
|
366
439
|
200:
|
|
367
|
-
|
|
440
|
+
description: Tasks related to given shot
|
|
441
|
+
content:
|
|
442
|
+
application/json:
|
|
443
|
+
schema:
|
|
444
|
+
type: array
|
|
445
|
+
items:
|
|
446
|
+
type: object
|
|
447
|
+
404:
|
|
448
|
+
description: Shot not found
|
|
368
449
|
"""
|
|
369
450
|
shots_service.get_shot(shot_id)
|
|
370
451
|
return user_service.get_tasks_for_entity(shot_id)
|
|
371
452
|
|
|
372
453
|
|
|
373
454
|
class SceneTasksResource(Resource):
|
|
374
|
-
"""
|
|
375
|
-
Return tasks related to given scene for current user.
|
|
376
|
-
"""
|
|
377
455
|
|
|
378
456
|
def get(self, scene_id):
|
|
379
457
|
"""
|
|
@@ -384,22 +462,28 @@ class SceneTasksResource(Resource):
|
|
|
384
462
|
parameters:
|
|
385
463
|
- in: path
|
|
386
464
|
name: scene_id
|
|
387
|
-
required:
|
|
388
|
-
|
|
389
|
-
|
|
465
|
+
required: true
|
|
466
|
+
schema:
|
|
467
|
+
type: string
|
|
468
|
+
format: uuid
|
|
390
469
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
391
470
|
responses:
|
|
392
471
|
200:
|
|
393
|
-
|
|
472
|
+
description: Tasks related to given scene
|
|
473
|
+
content:
|
|
474
|
+
application/json:
|
|
475
|
+
schema:
|
|
476
|
+
type: array
|
|
477
|
+
items:
|
|
478
|
+
type: object
|
|
479
|
+
404:
|
|
480
|
+
description: Scene not found
|
|
394
481
|
"""
|
|
395
482
|
shots_service.get_scene(scene_id)
|
|
396
483
|
return user_service.get_tasks_for_entity(scene_id)
|
|
397
484
|
|
|
398
485
|
|
|
399
486
|
class SequenceTasksResource(Resource):
|
|
400
|
-
"""
|
|
401
|
-
Return tasks related to given sequence for current user.
|
|
402
|
-
"""
|
|
403
487
|
|
|
404
488
|
def get(self, sequence_id):
|
|
405
489
|
"""
|
|
@@ -410,13 +494,22 @@ class SequenceTasksResource(Resource):
|
|
|
410
494
|
parameters:
|
|
411
495
|
- in: path
|
|
412
496
|
name: sequence_id
|
|
413
|
-
required:
|
|
414
|
-
|
|
415
|
-
|
|
497
|
+
required: true
|
|
498
|
+
schema:
|
|
499
|
+
type: string
|
|
500
|
+
format: uuid
|
|
416
501
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
417
502
|
responses:
|
|
418
503
|
200:
|
|
419
|
-
|
|
504
|
+
description: Tasks related to given sequence
|
|
505
|
+
content:
|
|
506
|
+
application/json:
|
|
507
|
+
schema:
|
|
508
|
+
type: array
|
|
509
|
+
items:
|
|
510
|
+
type: object
|
|
511
|
+
404:
|
|
512
|
+
description: Sequence not found
|
|
420
513
|
"""
|
|
421
514
|
shots_service.get_sequence(sequence_id)
|
|
422
515
|
return user_service.get_tasks_for_entity(sequence_id)
|
|
@@ -437,12 +530,19 @@ class TodosResource(Resource):
|
|
|
437
530
|
- User
|
|
438
531
|
responses:
|
|
439
532
|
200:
|
|
440
|
-
|
|
533
|
+
description: Unfinished tasks currently assigned to current user
|
|
534
|
+
content:
|
|
535
|
+
application/json:
|
|
536
|
+
schema:
|
|
537
|
+
type: array
|
|
538
|
+
items:
|
|
539
|
+
type: object
|
|
441
540
|
"""
|
|
442
541
|
return user_service.get_todos()
|
|
443
542
|
|
|
444
543
|
|
|
445
544
|
class ToChecksResource(Resource):
|
|
545
|
+
|
|
446
546
|
def get(self):
|
|
447
547
|
"""
|
|
448
548
|
Return tasks requiring feedback for current user departments.
|
|
@@ -453,48 +553,58 @@ class ToChecksResource(Resource):
|
|
|
453
553
|
- User
|
|
454
554
|
responses:
|
|
455
555
|
200:
|
|
456
|
-
|
|
457
|
-
|
|
556
|
+
description: Tasks requiring feedback in current user departments
|
|
557
|
+
content:
|
|
558
|
+
application/json:
|
|
559
|
+
schema:
|
|
560
|
+
type: array
|
|
561
|
+
items:
|
|
562
|
+
type: object
|
|
458
563
|
"""
|
|
459
564
|
return user_service.get_tasks_to_check()
|
|
460
565
|
|
|
461
566
|
|
|
462
567
|
class DoneResource(Resource):
|
|
463
|
-
"""
|
|
464
|
-
Return tasks currently assigned to current user and of which status
|
|
465
|
-
has is_done attribute set to true. It returns only tasks of open projects.
|
|
466
|
-
"""
|
|
467
568
|
|
|
468
569
|
def get(self):
|
|
469
570
|
"""
|
|
470
571
|
Return tasks currently assigned to current user and of which status has
|
|
471
|
-
is_done attribute set to true.
|
|
572
|
+
is_done attribute set to true. It returns only tasks of open projects.
|
|
472
573
|
---
|
|
473
574
|
tags:
|
|
474
575
|
- User
|
|
475
|
-
description: It returns only tasks of open projects.
|
|
476
576
|
responses:
|
|
477
577
|
200:
|
|
478
|
-
|
|
578
|
+
description: Finished tasks currently assigned to current user
|
|
579
|
+
content:
|
|
580
|
+
application/json:
|
|
581
|
+
schema:
|
|
582
|
+
type: array
|
|
583
|
+
items:
|
|
584
|
+
type: object
|
|
479
585
|
"""
|
|
480
586
|
return user_service.get_done_tasks()
|
|
481
587
|
|
|
482
588
|
|
|
483
589
|
class FiltersResource(Resource, ArgsMixin):
|
|
484
|
-
|
|
485
|
-
Allow to create and retrieve filters for current user and only for
|
|
486
|
-
open projects.
|
|
487
|
-
"""
|
|
590
|
+
|
|
488
591
|
|
|
489
592
|
def get(self):
|
|
490
593
|
"""
|
|
491
|
-
|
|
594
|
+
Allow to create and retrieve filters for current user and only for
|
|
595
|
+
open projects.
|
|
492
596
|
---
|
|
493
597
|
tags:
|
|
494
598
|
- User
|
|
495
599
|
responses:
|
|
496
600
|
200:
|
|
497
|
-
|
|
601
|
+
description: Filters for current user and only for open projects
|
|
602
|
+
content:
|
|
603
|
+
application/json:
|
|
604
|
+
schema:
|
|
605
|
+
type: array
|
|
606
|
+
items:
|
|
607
|
+
type: object
|
|
498
608
|
"""
|
|
499
609
|
return user_service.get_filters()
|
|
500
610
|
|
|
@@ -504,34 +614,52 @@ class FiltersResource(Resource, ArgsMixin):
|
|
|
504
614
|
---
|
|
505
615
|
tags:
|
|
506
616
|
- User
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
617
|
+
requestBody:
|
|
618
|
+
required: true
|
|
619
|
+
content:
|
|
620
|
+
application/json:
|
|
621
|
+
schema:
|
|
622
|
+
type: object
|
|
623
|
+
required:
|
|
624
|
+
- name
|
|
625
|
+
- query
|
|
626
|
+
- list_type
|
|
627
|
+
- project_id
|
|
628
|
+
properties:
|
|
629
|
+
name:
|
|
630
|
+
type: string
|
|
631
|
+
example: Name of filter
|
|
632
|
+
query:
|
|
633
|
+
type: string
|
|
634
|
+
example: '{"project_id": "uuid"}'
|
|
635
|
+
list_type:
|
|
636
|
+
type: string
|
|
637
|
+
example: todo
|
|
638
|
+
entity_type:
|
|
639
|
+
type: string
|
|
640
|
+
example: Asset
|
|
641
|
+
project_id:
|
|
642
|
+
type: string
|
|
643
|
+
format: uuid
|
|
644
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
645
|
+
is_shared:
|
|
646
|
+
type: boolean
|
|
647
|
+
default: false
|
|
648
|
+
search_filter_group_id:
|
|
649
|
+
type: string
|
|
650
|
+
format: uuid
|
|
651
|
+
department_id:
|
|
652
|
+
type: string
|
|
653
|
+
format: uuid
|
|
531
654
|
responses:
|
|
532
655
|
201:
|
|
533
|
-
|
|
534
|
-
|
|
656
|
+
description: Filter for current user and only for open projects created
|
|
657
|
+
content:
|
|
658
|
+
application/json:
|
|
659
|
+
schema:
|
|
660
|
+
type: object
|
|
661
|
+
400:
|
|
662
|
+
description: Bad request
|
|
535
663
|
"""
|
|
536
664
|
arguments = self.get_arguments()
|
|
537
665
|
|
|
@@ -565,9 +693,7 @@ class FiltersResource(Resource, ArgsMixin):
|
|
|
565
693
|
|
|
566
694
|
|
|
567
695
|
class FilterResource(Resource, ArgsMixin):
|
|
568
|
-
|
|
569
|
-
Allow to remove or update given filter if it's owned by current user.
|
|
570
|
-
"""
|
|
696
|
+
|
|
571
697
|
|
|
572
698
|
def put(self, filter_id):
|
|
573
699
|
"""
|
|
@@ -611,23 +737,22 @@ class FilterResource(Resource, ArgsMixin):
|
|
|
611
737
|
parameters:
|
|
612
738
|
- in: path
|
|
613
739
|
name: filter_id
|
|
614
|
-
required:
|
|
615
|
-
|
|
616
|
-
|
|
740
|
+
required: true
|
|
741
|
+
schema:
|
|
742
|
+
type: string
|
|
743
|
+
format: uuid
|
|
617
744
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
618
745
|
responses:
|
|
619
746
|
204:
|
|
620
|
-
|
|
747
|
+
description: Filter deleted successfully
|
|
748
|
+
404:
|
|
749
|
+
description: Filter not found
|
|
621
750
|
"""
|
|
622
751
|
user_service.remove_filter(filter_id)
|
|
623
752
|
return "", 204
|
|
624
753
|
|
|
625
754
|
|
|
626
755
|
class FilterGroupsResource(Resource, ArgsMixin):
|
|
627
|
-
"""
|
|
628
|
-
Allow to create and retrieve filter groups for current user and only for
|
|
629
|
-
open projects.
|
|
630
|
-
"""
|
|
631
756
|
|
|
632
757
|
def get(self):
|
|
633
758
|
"""
|
|
@@ -637,8 +762,13 @@ class FilterGroupsResource(Resource, ArgsMixin):
|
|
|
637
762
|
- User
|
|
638
763
|
responses:
|
|
639
764
|
200:
|
|
640
|
-
|
|
641
|
-
|
|
765
|
+
description: Filter groups for current user and only for open projects
|
|
766
|
+
content:
|
|
767
|
+
application/json:
|
|
768
|
+
schema:
|
|
769
|
+
type: array
|
|
770
|
+
items:
|
|
771
|
+
type: object
|
|
642
772
|
"""
|
|
643
773
|
return user_service.get_filter_groups()
|
|
644
774
|
|
|
@@ -648,43 +778,50 @@ class FilterGroupsResource(Resource, ArgsMixin):
|
|
|
648
778
|
---
|
|
649
779
|
tags:
|
|
650
780
|
- User
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
781
|
+
requestBody:
|
|
782
|
+
required: true
|
|
783
|
+
content:
|
|
784
|
+
application/json:
|
|
785
|
+
schema:
|
|
786
|
+
type: object
|
|
787
|
+
required:
|
|
788
|
+
- name
|
|
789
|
+
- color
|
|
790
|
+
- list_type
|
|
791
|
+
- project_id
|
|
792
|
+
properties:
|
|
793
|
+
name:
|
|
794
|
+
type: string
|
|
795
|
+
example: Name of filter group
|
|
796
|
+
color:
|
|
797
|
+
type: string
|
|
798
|
+
example: #FF0000
|
|
799
|
+
list_type:
|
|
800
|
+
type: string
|
|
801
|
+
example: todo
|
|
802
|
+
entity_type:
|
|
803
|
+
type: string
|
|
804
|
+
example: Asset
|
|
805
|
+
is_shared:
|
|
806
|
+
type: boolean
|
|
807
|
+
default: false
|
|
808
|
+
project_id:
|
|
809
|
+
type: string
|
|
810
|
+
format: uuid
|
|
811
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
812
|
+
department_id:
|
|
813
|
+
type: string
|
|
814
|
+
format: uuid
|
|
815
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
684
816
|
responses:
|
|
685
817
|
201:
|
|
686
|
-
|
|
687
|
-
|
|
818
|
+
description: Filter group for the current user and only for open projects created
|
|
819
|
+
content:
|
|
820
|
+
application/json:
|
|
821
|
+
schema:
|
|
822
|
+
type: object
|
|
823
|
+
400:
|
|
824
|
+
description: Bad request
|
|
688
825
|
"""
|
|
689
826
|
arguments = self.get_arguments()
|
|
690
827
|
return (
|
|
@@ -715,10 +852,6 @@ class FilterGroupsResource(Resource, ArgsMixin):
|
|
|
715
852
|
|
|
716
853
|
|
|
717
854
|
class FilterGroupResource(Resource, ArgsMixin):
|
|
718
|
-
"""
|
|
719
|
-
Allow to remove or update given filter group if it's owned by
|
|
720
|
-
the current user.
|
|
721
|
-
"""
|
|
722
855
|
|
|
723
856
|
def get(self, search_filter_group_id):
|
|
724
857
|
"""
|
|
@@ -808,10 +941,6 @@ class FilterGroupResource(Resource, ArgsMixin):
|
|
|
808
941
|
|
|
809
942
|
|
|
810
943
|
class DesktopLoginLogsResource(Resource, ArgsMixin):
|
|
811
|
-
"""
|
|
812
|
-
Allow to create and retrieve desktop login logs. Desktop login logs can
|
|
813
|
-
only be created by the current user.
|
|
814
|
-
"""
|
|
815
944
|
|
|
816
945
|
def get(self):
|
|
817
946
|
"""
|
|
@@ -821,7 +950,13 @@ class DesktopLoginLogsResource(Resource, ArgsMixin):
|
|
|
821
950
|
- User
|
|
822
951
|
responses:
|
|
823
952
|
200:
|
|
824
|
-
|
|
953
|
+
description: Desktop login logs
|
|
954
|
+
content:
|
|
955
|
+
application/json:
|
|
956
|
+
schema:
|
|
957
|
+
type: array
|
|
958
|
+
items:
|
|
959
|
+
type: object
|
|
825
960
|
"""
|
|
826
961
|
current_user = persons_service.get_current_user()
|
|
827
962
|
return persons_service.get_desktop_login_logs(current_user["id"])
|
|
@@ -834,15 +969,26 @@ class DesktopLoginLogsResource(Resource, ArgsMixin):
|
|
|
834
969
|
- User
|
|
835
970
|
description: The desktop login log can only be created by
|
|
836
971
|
the current user.
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
972
|
+
requestBody:
|
|
973
|
+
required: true
|
|
974
|
+
content:
|
|
975
|
+
application/json:
|
|
976
|
+
schema:
|
|
977
|
+
type: object
|
|
978
|
+
properties:
|
|
979
|
+
date:
|
|
980
|
+
type: string
|
|
981
|
+
format: date
|
|
982
|
+
example: "2022-07-12"
|
|
843
983
|
responses:
|
|
844
984
|
201:
|
|
845
|
-
|
|
985
|
+
description: Desktop login log created
|
|
986
|
+
content:
|
|
987
|
+
application/json:
|
|
988
|
+
schema:
|
|
989
|
+
type: object
|
|
990
|
+
400:
|
|
991
|
+
description: Bad request
|
|
846
992
|
"""
|
|
847
993
|
arguments = self.get_args(
|
|
848
994
|
["date", date_helpers.get_utc_now_datetime()]
|
|
@@ -855,6 +1001,7 @@ class DesktopLoginLogsResource(Resource, ArgsMixin):
|
|
|
855
1001
|
|
|
856
1002
|
|
|
857
1003
|
class NotificationsResource(Resource, ArgsMixin):
|
|
1004
|
+
|
|
858
1005
|
def get(self):
|
|
859
1006
|
"""
|
|
860
1007
|
Return last 100 user notifications filtered by given parameters.
|
|
@@ -862,19 +1009,63 @@ class NotificationsResource(Resource, ArgsMixin):
|
|
|
862
1009
|
tags:
|
|
863
1010
|
- User
|
|
864
1011
|
parameters:
|
|
865
|
-
- in:
|
|
1012
|
+
- in: query
|
|
866
1013
|
name: after
|
|
867
|
-
|
|
868
|
-
|
|
1014
|
+
required: false
|
|
1015
|
+
schema:
|
|
1016
|
+
type: string
|
|
1017
|
+
format: date
|
|
869
1018
|
example: "2022-07-12"
|
|
870
|
-
|
|
1019
|
+
description: Filter notifications after this date
|
|
1020
|
+
- in: query
|
|
871
1021
|
name: before
|
|
872
|
-
|
|
873
|
-
|
|
1022
|
+
required: false
|
|
1023
|
+
schema:
|
|
1024
|
+
type: string
|
|
1025
|
+
format: date
|
|
874
1026
|
example: "2022-07-12"
|
|
1027
|
+
description: Filter notifications before this date
|
|
1028
|
+
- in: query
|
|
1029
|
+
name: task_type_id
|
|
1030
|
+
required: false
|
|
1031
|
+
schema:
|
|
1032
|
+
type: string
|
|
1033
|
+
format: uuid
|
|
1034
|
+
description: Filter by task type ID
|
|
1035
|
+
- in: query
|
|
1036
|
+
name: task_status_id
|
|
1037
|
+
required: false
|
|
1038
|
+
schema:
|
|
1039
|
+
type: string
|
|
1040
|
+
format: uuid
|
|
1041
|
+
description: Filter by task status ID
|
|
1042
|
+
- in: query
|
|
1043
|
+
name: type
|
|
1044
|
+
required: false
|
|
1045
|
+
schema:
|
|
1046
|
+
type: string
|
|
1047
|
+
description: Filter by notification type
|
|
1048
|
+
- in: query
|
|
1049
|
+
name: read
|
|
1050
|
+
required: false
|
|
1051
|
+
schema:
|
|
1052
|
+
type: boolean
|
|
1053
|
+
description: Filter by read status
|
|
1054
|
+
- in: query
|
|
1055
|
+
name: watching
|
|
1056
|
+
required: false
|
|
1057
|
+
schema:
|
|
1058
|
+
type: boolean
|
|
1059
|
+
description: Filter by watching status
|
|
875
1060
|
responses:
|
|
876
1061
|
200:
|
|
877
|
-
|
|
1062
|
+
description: 100 last user notifications
|
|
1063
|
+
content:
|
|
1064
|
+
application/json:
|
|
1065
|
+
schema:
|
|
1066
|
+
type: array
|
|
1067
|
+
items:
|
|
1068
|
+
type: object
|
|
878
1069
|
"""
|
|
879
1070
|
(
|
|
880
1071
|
after,
|
|
@@ -912,10 +1103,6 @@ class NotificationsResource(Resource, ArgsMixin):
|
|
|
912
1103
|
|
|
913
1104
|
|
|
914
1105
|
class NotificationResource(Resource, ArgsMixin):
|
|
915
|
-
"""
|
|
916
|
-
Return notification matching given id, only if it's a notification that
|
|
917
|
-
belongs to current user.
|
|
918
|
-
"""
|
|
919
1106
|
|
|
920
1107
|
def get(self, notification_id):
|
|
921
1108
|
"""
|
|
@@ -927,14 +1114,20 @@ class NotificationResource(Resource, ArgsMixin):
|
|
|
927
1114
|
parameters:
|
|
928
1115
|
- in: path
|
|
929
1116
|
name: notification_id
|
|
930
|
-
required:
|
|
931
|
-
|
|
932
|
-
|
|
1117
|
+
required: true
|
|
1118
|
+
schema:
|
|
1119
|
+
type: string
|
|
1120
|
+
format: uuid
|
|
933
1121
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
934
|
-
|
|
935
1122
|
responses:
|
|
936
1123
|
200:
|
|
937
|
-
|
|
1124
|
+
description: Notification matching given ID
|
|
1125
|
+
content:
|
|
1126
|
+
application/json:
|
|
1127
|
+
schema:
|
|
1128
|
+
type: object
|
|
1129
|
+
404:
|
|
1130
|
+
description: Notification not found
|
|
938
1131
|
"""
|
|
939
1132
|
return user_service.get_notification(notification_id)
|
|
940
1133
|
|
|
@@ -947,13 +1140,30 @@ class NotificationResource(Resource, ArgsMixin):
|
|
|
947
1140
|
parameters:
|
|
948
1141
|
- in: path
|
|
949
1142
|
name: notification_id
|
|
950
|
-
required:
|
|
951
|
-
|
|
952
|
-
|
|
1143
|
+
required: true
|
|
1144
|
+
schema:
|
|
1145
|
+
type: string
|
|
1146
|
+
format: uuid
|
|
953
1147
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1148
|
+
requestBody:
|
|
1149
|
+
required: true
|
|
1150
|
+
content:
|
|
1151
|
+
application/json:
|
|
1152
|
+
schema:
|
|
1153
|
+
type: object
|
|
1154
|
+
properties:
|
|
1155
|
+
read:
|
|
1156
|
+
type: boolean
|
|
1157
|
+
description: Mark notification as read/unread
|
|
954
1158
|
responses:
|
|
955
1159
|
200:
|
|
956
|
-
|
|
1160
|
+
description: Updated notification
|
|
1161
|
+
content:
|
|
1162
|
+
application/json:
|
|
1163
|
+
schema:
|
|
1164
|
+
type: object
|
|
1165
|
+
404:
|
|
1166
|
+
description: Notification not found
|
|
957
1167
|
"""
|
|
958
1168
|
data = self.get_args([("read", None, False, inputs.boolean)])
|
|
959
1169
|
return user_service.update_notification(notification_id, data["read"])
|
|
@@ -963,82 +1173,95 @@ class MarkAllNotificationsAsReadResource(Resource):
|
|
|
963
1173
|
|
|
964
1174
|
def post(self):
|
|
965
1175
|
"""
|
|
966
|
-
Mark all notifications as read
|
|
1176
|
+
Mark all notifications as read.
|
|
967
1177
|
---
|
|
1178
|
+
description: It applies to all notifications of the current user.
|
|
968
1179
|
tags:
|
|
969
1180
|
- User
|
|
970
1181
|
responses:
|
|
971
1182
|
200:
|
|
972
|
-
|
|
1183
|
+
content:
|
|
1184
|
+
application/json:
|
|
1185
|
+
schema:
|
|
1186
|
+
type: object
|
|
1187
|
+
properties:
|
|
1188
|
+
success:
|
|
1189
|
+
type: boolean
|
|
1190
|
+
example: true
|
|
973
1191
|
"""
|
|
974
1192
|
user_service.mark_notifications_as_read()
|
|
975
1193
|
return {"success": True}
|
|
976
1194
|
|
|
977
1195
|
|
|
978
1196
|
class HasTaskSubscribedResource(Resource):
|
|
979
|
-
"""
|
|
980
|
-
Return true if current user has subscribed to given task.
|
|
981
|
-
"""
|
|
982
1197
|
|
|
983
1198
|
def get(self, task_id):
|
|
984
1199
|
"""
|
|
985
|
-
|
|
1200
|
+
Check task subscription
|
|
986
1201
|
---
|
|
1202
|
+
description: Return true if current user has subscribed to given task.
|
|
987
1203
|
tags:
|
|
988
1204
|
- User
|
|
989
1205
|
parameters:
|
|
990
1206
|
- in: path
|
|
991
1207
|
name: task_id
|
|
992
|
-
required:
|
|
993
|
-
|
|
994
|
-
|
|
1208
|
+
required: true
|
|
1209
|
+
schema:
|
|
1210
|
+
type: string
|
|
1211
|
+
format: uuid
|
|
995
1212
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
996
1213
|
responses:
|
|
997
1214
|
200:
|
|
998
|
-
|
|
999
|
-
|
|
1215
|
+
description: True if current user has subscribed to given task, False otherwise
|
|
1216
|
+
content:
|
|
1217
|
+
application/json:
|
|
1218
|
+
schema:
|
|
1219
|
+
type: boolean
|
|
1220
|
+
404:
|
|
1221
|
+
description: Task not found
|
|
1000
1222
|
"""
|
|
1001
1223
|
return user_service.has_task_subscription(task_id)
|
|
1002
1224
|
|
|
1003
1225
|
|
|
1004
1226
|
class TaskSubscribeResource(Resource):
|
|
1005
|
-
"""
|
|
1006
|
-
Create a subscription entry for given task and current user.
|
|
1007
|
-
When a user subscribes, he gets notified everytime a comment is posted on
|
|
1008
|
-
the task.
|
|
1009
|
-
"""
|
|
1010
1227
|
|
|
1011
1228
|
def post(self, task_id):
|
|
1012
1229
|
"""
|
|
1013
|
-
Create a subscription entry
|
|
1230
|
+
Create a subscription entry
|
|
1014
1231
|
---
|
|
1015
1232
|
tags:
|
|
1016
1233
|
- User
|
|
1017
|
-
description:
|
|
1234
|
+
description: It applies to given task and current user. When a user
|
|
1235
|
+
subscribed, he gets notified everytime a comment is posted on the task.
|
|
1236
|
+
When a user subscribes, he gets notified everytime a
|
|
1018
1237
|
comment is posted on the task.
|
|
1019
1238
|
parameters:
|
|
1020
1239
|
- in: path
|
|
1021
1240
|
name: task_id
|
|
1022
|
-
required:
|
|
1023
|
-
|
|
1024
|
-
|
|
1241
|
+
required: true
|
|
1242
|
+
schema:
|
|
1243
|
+
type: string
|
|
1244
|
+
format: uuid
|
|
1025
1245
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1026
1246
|
responses:
|
|
1027
1247
|
201:
|
|
1028
|
-
|
|
1248
|
+
description: Subscription entry created
|
|
1249
|
+
content:
|
|
1250
|
+
application/json:
|
|
1251
|
+
schema:
|
|
1252
|
+
type: object
|
|
1253
|
+
404:
|
|
1254
|
+
description: Task not found
|
|
1029
1255
|
"""
|
|
1030
1256
|
return user_service.subscribe_to_task(task_id), 201
|
|
1031
1257
|
|
|
1032
1258
|
|
|
1033
1259
|
class TaskUnsubscribeResource(Resource):
|
|
1034
|
-
"""
|
|
1035
|
-
Remove the subscription entry matching given task and current user.
|
|
1036
|
-
The user will no longer receive notifications for this task.
|
|
1037
|
-
"""
|
|
1038
1260
|
|
|
1039
1261
|
def delete(self, task_id):
|
|
1040
1262
|
"""
|
|
1041
1263
|
Remove the subscription entry matching given task and current user.
|
|
1264
|
+
The user will no longer receive notifications for this task.
|
|
1042
1265
|
---
|
|
1043
1266
|
tags:
|
|
1044
1267
|
- User
|
|
@@ -1047,22 +1270,22 @@ class TaskUnsubscribeResource(Resource):
|
|
|
1047
1270
|
parameters:
|
|
1048
1271
|
- in: path
|
|
1049
1272
|
name: task_id
|
|
1050
|
-
required:
|
|
1051
|
-
|
|
1052
|
-
|
|
1273
|
+
required: true
|
|
1274
|
+
schema:
|
|
1275
|
+
type: string
|
|
1276
|
+
format: uuid
|
|
1053
1277
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1054
1278
|
responses:
|
|
1055
1279
|
204:
|
|
1056
|
-
|
|
1280
|
+
description: Subscription entry removed
|
|
1281
|
+
404:
|
|
1282
|
+
description: Task not found
|
|
1057
1283
|
"""
|
|
1058
1284
|
user_service.unsubscribe_from_task(task_id)
|
|
1059
1285
|
return "", 204
|
|
1060
1286
|
|
|
1061
1287
|
|
|
1062
1288
|
class HasSequenceSubscribedResource(Resource):
|
|
1063
|
-
"""
|
|
1064
|
-
Return true if current user has subscribed to given sequence and task type.
|
|
1065
|
-
"""
|
|
1066
1289
|
|
|
1067
1290
|
def get(self, sequence_id, task_type_id):
|
|
1068
1291
|
"""
|
|
@@ -1074,20 +1297,27 @@ class HasSequenceSubscribedResource(Resource):
|
|
|
1074
1297
|
parameters:
|
|
1075
1298
|
- in: path
|
|
1076
1299
|
name: sequence_id
|
|
1077
|
-
required:
|
|
1078
|
-
|
|
1079
|
-
|
|
1300
|
+
required: true
|
|
1301
|
+
schema:
|
|
1302
|
+
type: string
|
|
1303
|
+
format: uuid
|
|
1080
1304
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1081
1305
|
- in: path
|
|
1082
1306
|
name: task_type_id
|
|
1083
|
-
required:
|
|
1084
|
-
|
|
1085
|
-
|
|
1307
|
+
required: true
|
|
1308
|
+
schema:
|
|
1309
|
+
type: string
|
|
1310
|
+
format: uuid
|
|
1086
1311
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1087
1312
|
responses:
|
|
1088
1313
|
200:
|
|
1089
|
-
|
|
1090
|
-
|
|
1314
|
+
description: True if current user has subscribed to given sequence and task type, False otherwise
|
|
1315
|
+
content:
|
|
1316
|
+
application/json:
|
|
1317
|
+
schema:
|
|
1318
|
+
type: boolean
|
|
1319
|
+
404:
|
|
1320
|
+
description: Sequence or task type not found
|
|
1091
1321
|
"""
|
|
1092
1322
|
return user_service.has_sequence_subscription(
|
|
1093
1323
|
sequence_id, task_type_id
|
|
@@ -1095,11 +1325,6 @@ class HasSequenceSubscribedResource(Resource):
|
|
|
1095
1325
|
|
|
1096
1326
|
|
|
1097
1327
|
class SequenceSubscribeResource(Resource):
|
|
1098
|
-
"""
|
|
1099
|
-
Create a subscription entry for given sequence, task type and current user.
|
|
1100
|
-
When a user subscribes, he gets notified every time a comment is posted
|
|
1101
|
-
on tasks related to the sequence.
|
|
1102
|
-
"""
|
|
1103
1328
|
|
|
1104
1329
|
def post(self, sequence_id, task_type_id):
|
|
1105
1330
|
"""
|
|
@@ -1113,19 +1338,27 @@ class SequenceSubscribeResource(Resource):
|
|
|
1113
1338
|
parameters:
|
|
1114
1339
|
- in: path
|
|
1115
1340
|
name: sequence_id
|
|
1116
|
-
required:
|
|
1117
|
-
|
|
1118
|
-
|
|
1341
|
+
required: true
|
|
1342
|
+
schema:
|
|
1343
|
+
type: string
|
|
1344
|
+
format: uuid
|
|
1119
1345
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1120
1346
|
- in: path
|
|
1121
1347
|
name: task_type_id
|
|
1122
|
-
required:
|
|
1123
|
-
|
|
1124
|
-
|
|
1348
|
+
required: true
|
|
1349
|
+
schema:
|
|
1350
|
+
type: string
|
|
1351
|
+
format: uuid
|
|
1125
1352
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1126
1353
|
responses:
|
|
1127
1354
|
201:
|
|
1128
|
-
|
|
1355
|
+
description: Subscription entry created
|
|
1356
|
+
content:
|
|
1357
|
+
application/json:
|
|
1358
|
+
schema:
|
|
1359
|
+
type: object
|
|
1360
|
+
404:
|
|
1361
|
+
description: Sequence or task type not found
|
|
1129
1362
|
"""
|
|
1130
1363
|
subscription = user_service.subscribe_to_sequence(
|
|
1131
1364
|
sequence_id, task_type_id
|
|
@@ -1134,9 +1367,6 @@ class SequenceSubscribeResource(Resource):
|
|
|
1134
1367
|
|
|
1135
1368
|
|
|
1136
1369
|
class SequenceUnsubscribeResource(Resource):
|
|
1137
|
-
"""
|
|
1138
|
-
Remove a subscription entry for given sequence, task type and current user.
|
|
1139
|
-
"""
|
|
1140
1370
|
|
|
1141
1371
|
def delete(self, sequence_id, task_type_id):
|
|
1142
1372
|
"""
|
|
@@ -1148,29 +1378,29 @@ class SequenceUnsubscribeResource(Resource):
|
|
|
1148
1378
|
parameters:
|
|
1149
1379
|
- in: path
|
|
1150
1380
|
name: sequence_id
|
|
1151
|
-
required:
|
|
1152
|
-
|
|
1153
|
-
|
|
1381
|
+
required: true
|
|
1382
|
+
schema:
|
|
1383
|
+
type: string
|
|
1384
|
+
format: uuid
|
|
1154
1385
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1155
1386
|
- in: path
|
|
1156
1387
|
name: task_type_id
|
|
1157
|
-
required:
|
|
1158
|
-
|
|
1159
|
-
|
|
1388
|
+
required: true
|
|
1389
|
+
schema:
|
|
1390
|
+
type: string
|
|
1391
|
+
format: uuid
|
|
1160
1392
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1161
1393
|
responses:
|
|
1162
1394
|
204:
|
|
1163
|
-
|
|
1395
|
+
description: Subscription entry removed
|
|
1396
|
+
404:
|
|
1397
|
+
description: Sequence or task type not found
|
|
1164
1398
|
"""
|
|
1165
1399
|
user_service.unsubscribe_from_sequence(sequence_id, task_type_id)
|
|
1166
1400
|
return "", 204
|
|
1167
1401
|
|
|
1168
1402
|
|
|
1169
1403
|
class SequenceSubscriptionsResource(Resource):
|
|
1170
|
-
"""
|
|
1171
|
-
Return the list of sequence ids to which the current user has subscribed
|
|
1172
|
-
for given task type.
|
|
1173
|
-
"""
|
|
1174
1404
|
|
|
1175
1405
|
def get(self, project_id, task_type_id):
|
|
1176
1406
|
"""
|
|
@@ -1182,20 +1412,30 @@ class SequenceSubscriptionsResource(Resource):
|
|
|
1182
1412
|
parameters:
|
|
1183
1413
|
- in: path
|
|
1184
1414
|
name: project_id
|
|
1185
|
-
required:
|
|
1186
|
-
|
|
1187
|
-
|
|
1415
|
+
required: true
|
|
1416
|
+
schema:
|
|
1417
|
+
type: string
|
|
1418
|
+
format: uuid
|
|
1188
1419
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1189
1420
|
- in: path
|
|
1190
1421
|
name: task_type_id
|
|
1191
|
-
required:
|
|
1192
|
-
|
|
1193
|
-
|
|
1422
|
+
required: true
|
|
1423
|
+
schema:
|
|
1424
|
+
type: string
|
|
1425
|
+
format: uuid
|
|
1194
1426
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1195
1427
|
responses:
|
|
1196
1428
|
200:
|
|
1197
|
-
|
|
1198
|
-
|
|
1429
|
+
description: List of sequence ids to which the current user has subscribed for given task type
|
|
1430
|
+
content:
|
|
1431
|
+
application/json:
|
|
1432
|
+
schema:
|
|
1433
|
+
type: array
|
|
1434
|
+
items:
|
|
1435
|
+
type: string
|
|
1436
|
+
format: uuid
|
|
1437
|
+
404:
|
|
1438
|
+
description: Project or task type not found
|
|
1199
1439
|
"""
|
|
1200
1440
|
return user_service.get_sequence_subscriptions(
|
|
1201
1441
|
project_id, task_type_id
|
|
@@ -1209,6 +1449,41 @@ class TimeSpentsResource(Resource):
|
|
|
1209
1449
|
"""
|
|
1210
1450
|
|
|
1211
1451
|
def get(self):
|
|
1452
|
+
"""
|
|
1453
|
+
Get all time spents for the current user.
|
|
1454
|
+
Optionnaly can accept date range parameters.
|
|
1455
|
+
---
|
|
1456
|
+
tags:
|
|
1457
|
+
- User
|
|
1458
|
+
parameters:
|
|
1459
|
+
- in: query
|
|
1460
|
+
name: start_date
|
|
1461
|
+
required: false
|
|
1462
|
+
schema:
|
|
1463
|
+
type: string
|
|
1464
|
+
format: date
|
|
1465
|
+
example: "2022-07-12"
|
|
1466
|
+
description: Start date for filtering time spents
|
|
1467
|
+
- in: query
|
|
1468
|
+
name: end_date
|
|
1469
|
+
required: false
|
|
1470
|
+
schema:
|
|
1471
|
+
type: string
|
|
1472
|
+
format: date
|
|
1473
|
+
example: "2022-07-12"
|
|
1474
|
+
description: End date for filtering time spents
|
|
1475
|
+
responses:
|
|
1476
|
+
200:
|
|
1477
|
+
description: All time spents for the current user
|
|
1478
|
+
content:
|
|
1479
|
+
application/json:
|
|
1480
|
+
schema:
|
|
1481
|
+
type: array
|
|
1482
|
+
items:
|
|
1483
|
+
type: object
|
|
1484
|
+
400:
|
|
1485
|
+
description: Wrong date format
|
|
1486
|
+
"""
|
|
1212
1487
|
arguments = self.get_args(["start_date", "end_date"])
|
|
1213
1488
|
start_date, end_date = arguments["start_date"], arguments["end_date"]
|
|
1214
1489
|
current_user = persons_service.get_current_user()
|
|
@@ -1234,24 +1509,42 @@ class TimeSpentsResource(Resource):
|
|
|
1234
1509
|
|
|
1235
1510
|
|
|
1236
1511
|
class DateTimeSpentsResource(Resource):
|
|
1237
|
-
"""
|
|
1238
|
-
Get time spents on for current user and given date.
|
|
1239
|
-
"""
|
|
1240
1512
|
|
|
1241
1513
|
def get(self, date):
|
|
1514
|
+
"""
|
|
1515
|
+
Get time spents on for current user and given date.
|
|
1516
|
+
---
|
|
1517
|
+
tags:
|
|
1518
|
+
- User
|
|
1519
|
+
parameters:
|
|
1520
|
+
- in: path
|
|
1521
|
+
name: date
|
|
1522
|
+
required: true
|
|
1523
|
+
schema:
|
|
1524
|
+
type: string
|
|
1525
|
+
format: date
|
|
1526
|
+
example: "2022-07-12"
|
|
1527
|
+
description: Date to get time spents for
|
|
1528
|
+
responses:
|
|
1529
|
+
200:
|
|
1530
|
+
description: Time spents on for current user and given date
|
|
1531
|
+
content:
|
|
1532
|
+
application/json:
|
|
1533
|
+
schema:
|
|
1534
|
+
type: object
|
|
1535
|
+
400:
|
|
1536
|
+
description: Wrong date format
|
|
1537
|
+
"""
|
|
1242
1538
|
try:
|
|
1243
1539
|
current_user = persons_service.get_current_user()
|
|
1244
1540
|
return time_spents_service.get_time_spents(
|
|
1245
1541
|
current_user["id"], date
|
|
1246
1542
|
)
|
|
1247
1543
|
except WrongDateFormatException:
|
|
1248
|
-
abort(
|
|
1544
|
+
abort(400)
|
|
1249
1545
|
|
|
1250
1546
|
|
|
1251
1547
|
class TaskTimeSpentResource(Resource):
|
|
1252
|
-
"""
|
|
1253
|
-
Get time spents for current user and given date.
|
|
1254
|
-
"""
|
|
1255
1548
|
|
|
1256
1549
|
def get(self, task_id, date):
|
|
1257
1550
|
"""
|
|
@@ -1262,21 +1555,27 @@ class TaskTimeSpentResource(Resource):
|
|
|
1262
1555
|
parameters:
|
|
1263
1556
|
- in: path
|
|
1264
1557
|
name: task_id
|
|
1265
|
-
required:
|
|
1266
|
-
|
|
1267
|
-
|
|
1558
|
+
required: true
|
|
1559
|
+
schema:
|
|
1560
|
+
type: string
|
|
1561
|
+
format: uuid
|
|
1268
1562
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1269
1563
|
- in: path
|
|
1270
1564
|
name: date
|
|
1271
|
-
required:
|
|
1272
|
-
|
|
1273
|
-
|
|
1565
|
+
required: true
|
|
1566
|
+
schema:
|
|
1567
|
+
type: string
|
|
1568
|
+
format: date
|
|
1274
1569
|
example: "2022-07-12"
|
|
1275
1570
|
responses:
|
|
1276
1571
|
200:
|
|
1277
|
-
|
|
1572
|
+
description: Time spents for current user and given date
|
|
1573
|
+
content:
|
|
1574
|
+
application/json:
|
|
1575
|
+
schema:
|
|
1576
|
+
type: object
|
|
1278
1577
|
404:
|
|
1279
|
-
|
|
1578
|
+
description: Wrong date format or task not found
|
|
1280
1579
|
"""
|
|
1281
1580
|
try:
|
|
1282
1581
|
current_user = persons_service.get_current_user()
|
|
@@ -1288,9 +1587,6 @@ class TaskTimeSpentResource(Resource):
|
|
|
1288
1587
|
|
|
1289
1588
|
|
|
1290
1589
|
class DayOffResource(Resource):
|
|
1291
|
-
"""
|
|
1292
|
-
Get day off object for current user and given date.
|
|
1293
|
-
"""
|
|
1294
1590
|
|
|
1295
1591
|
def get(self, date):
|
|
1296
1592
|
"""
|
|
@@ -1301,15 +1597,20 @@ class DayOffResource(Resource):
|
|
|
1301
1597
|
parameters:
|
|
1302
1598
|
- in: path
|
|
1303
1599
|
name: date
|
|
1304
|
-
required:
|
|
1305
|
-
|
|
1306
|
-
|
|
1600
|
+
required: true
|
|
1601
|
+
schema:
|
|
1602
|
+
type: string
|
|
1603
|
+
format: date
|
|
1307
1604
|
example: "2022-07-12"
|
|
1308
1605
|
responses:
|
|
1309
1606
|
200:
|
|
1310
|
-
|
|
1607
|
+
description: Day off object for current user and given date
|
|
1608
|
+
content:
|
|
1609
|
+
application/json:
|
|
1610
|
+
schema:
|
|
1611
|
+
type: object
|
|
1311
1612
|
404:
|
|
1312
|
-
|
|
1613
|
+
description: Wrong date format
|
|
1313
1614
|
"""
|
|
1314
1615
|
try:
|
|
1315
1616
|
current_user = persons_service.get_current_user()
|
|
@@ -1319,6 +1620,7 @@ class DayOffResource(Resource):
|
|
|
1319
1620
|
|
|
1320
1621
|
|
|
1321
1622
|
class ContextResource(Resource):
|
|
1623
|
+
|
|
1322
1624
|
def get(self):
|
|
1323
1625
|
"""
|
|
1324
1626
|
Return context required to properly run a full app connected to the API
|
|
@@ -1328,13 +1630,17 @@ class ContextResource(Resource):
|
|
|
1328
1630
|
- User
|
|
1329
1631
|
responses:
|
|
1330
1632
|
200:
|
|
1331
|
-
|
|
1332
|
-
|
|
1633
|
+
description: Context to properly run a full app connected to the API
|
|
1634
|
+
content:
|
|
1635
|
+
application/json:
|
|
1636
|
+
schema:
|
|
1637
|
+
type: object
|
|
1333
1638
|
"""
|
|
1334
1639
|
return user_service.get_context()
|
|
1335
1640
|
|
|
1336
1641
|
|
|
1337
1642
|
class ClearAvatarResource(Resource):
|
|
1643
|
+
|
|
1338
1644
|
def delete(self):
|
|
1339
1645
|
"""
|
|
1340
1646
|
Set `has_avatar` flag to False for current user and remove its avatar
|
|
@@ -1344,7 +1650,9 @@ class ClearAvatarResource(Resource):
|
|
|
1344
1650
|
- User
|
|
1345
1651
|
responses:
|
|
1346
1652
|
204:
|
|
1347
|
-
|
|
1653
|
+
description: Avatar file deleted
|
|
1654
|
+
404:
|
|
1655
|
+
description: User not found
|
|
1348
1656
|
"""
|
|
1349
1657
|
user = persons_service.get_current_user()
|
|
1350
1658
|
persons_service.clear_avatar(user["id"])
|
|
@@ -1361,7 +1669,13 @@ class ChatsResource(Resource):
|
|
|
1361
1669
|
- User
|
|
1362
1670
|
responses:
|
|
1363
1671
|
200:
|
|
1364
|
-
|
|
1672
|
+
description: Chats where user is participant
|
|
1673
|
+
content:
|
|
1674
|
+
application/json:
|
|
1675
|
+
schema:
|
|
1676
|
+
type: array
|
|
1677
|
+
items:
|
|
1678
|
+
type: object
|
|
1365
1679
|
"""
|
|
1366
1680
|
user = persons_service.get_current_user()
|
|
1367
1681
|
return chats_service.get_chats_for_person(user["id"])
|
|
@@ -1378,13 +1692,20 @@ class JoinChatResource(Resource):
|
|
|
1378
1692
|
parameters:
|
|
1379
1693
|
- in: path
|
|
1380
1694
|
name: entity_id
|
|
1381
|
-
required:
|
|
1382
|
-
|
|
1383
|
-
|
|
1695
|
+
required: true
|
|
1696
|
+
schema:
|
|
1697
|
+
type: string
|
|
1698
|
+
format: uuid
|
|
1384
1699
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1385
1700
|
responses:
|
|
1386
1701
|
201:
|
|
1387
|
-
|
|
1702
|
+
description: Chat joined
|
|
1703
|
+
content:
|
|
1704
|
+
application/json:
|
|
1705
|
+
schema:
|
|
1706
|
+
type: object
|
|
1707
|
+
404:
|
|
1708
|
+
description: Entity not found
|
|
1388
1709
|
"""
|
|
1389
1710
|
entity = entities_service.get_entity(entity_id)
|
|
1390
1711
|
user_service.check_project_access(entity["project_id"])
|
|
@@ -1401,13 +1722,16 @@ class JoinChatResource(Resource):
|
|
|
1401
1722
|
parameters:
|
|
1402
1723
|
- in: path
|
|
1403
1724
|
name: entity_id
|
|
1404
|
-
required:
|
|
1405
|
-
|
|
1406
|
-
|
|
1725
|
+
required: true
|
|
1726
|
+
schema:
|
|
1727
|
+
type: string
|
|
1728
|
+
format: uuid
|
|
1407
1729
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1408
1730
|
responses:
|
|
1409
1731
|
204:
|
|
1410
|
-
|
|
1732
|
+
description: Chat left successfully
|
|
1733
|
+
404:
|
|
1734
|
+
description: Entity not found
|
|
1411
1735
|
"""
|
|
1412
1736
|
entity = entities_service.get_entity(entity_id)
|
|
1413
1737
|
user_service.check_project_access(entity["project_id"])
|