zou 0.20.71__py3-none-any.whl → 0.20.73__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 +1 -1
- zou/app/blueprints/search/resources.py +61 -19
- zou/app/blueprints/tasks/resources.py +482 -215
- zou/app/blueprints/user/resources.py +664 -341
- zou/app/services/comments_service.py +6 -7
- {zou-0.20.71.dist-info → zou-0.20.73.dist-info}/METADATA +1 -1
- {zou-0.20.71.dist-info → zou-0.20.73.dist-info}/RECORD +12 -12
- {zou-0.20.71.dist-info → zou-0.20.73.dist-info}/WHEEL +0 -0
- {zou-0.20.71.dist-info → zou-0.20.73.dist-info}/entry_points.txt +0 -0
- {zou-0.20.71.dist-info → zou-0.20.73.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.71.dist-info → zou-0.20.73.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/x-www-form-urlencoded:
|
|
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/x-www-form-urlencoded:
|
|
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,28 +950,46 @@ 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"])
|
|
828
963
|
|
|
829
964
|
def post(self):
|
|
830
965
|
"""
|
|
831
|
-
Create a desktop login log.
|
|
966
|
+
Create a desktop login log. Desktop login logs can
|
|
967
|
+
only be created by the current user.
|
|
832
968
|
---
|
|
833
969
|
tags:
|
|
834
970
|
- User
|
|
835
971
|
description: The desktop login log can only be created by
|
|
836
972
|
the current user.
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
973
|
+
requestBody:
|
|
974
|
+
required: true
|
|
975
|
+
content:
|
|
976
|
+
application/x-www-form-urlencoded:
|
|
977
|
+
schema:
|
|
978
|
+
type: object
|
|
979
|
+
properties:
|
|
980
|
+
date:
|
|
981
|
+
type: string
|
|
982
|
+
format: date
|
|
983
|
+
example: "2022-07-12"
|
|
843
984
|
responses:
|
|
844
985
|
201:
|
|
845
|
-
|
|
986
|
+
description: Desktop login log created
|
|
987
|
+
content:
|
|
988
|
+
application/json:
|
|
989
|
+
schema:
|
|
990
|
+
type: object
|
|
991
|
+
400:
|
|
992
|
+
description: Bad request
|
|
846
993
|
"""
|
|
847
994
|
arguments = self.get_args(
|
|
848
995
|
["date", date_helpers.get_utc_now_datetime()]
|
|
@@ -855,6 +1002,7 @@ class DesktopLoginLogsResource(Resource, ArgsMixin):
|
|
|
855
1002
|
|
|
856
1003
|
|
|
857
1004
|
class NotificationsResource(Resource, ArgsMixin):
|
|
1005
|
+
|
|
858
1006
|
def get(self):
|
|
859
1007
|
"""
|
|
860
1008
|
Return last 100 user notifications filtered by given parameters.
|
|
@@ -862,19 +1010,63 @@ class NotificationsResource(Resource, ArgsMixin):
|
|
|
862
1010
|
tags:
|
|
863
1011
|
- User
|
|
864
1012
|
parameters:
|
|
865
|
-
- in:
|
|
1013
|
+
- in: query
|
|
866
1014
|
name: after
|
|
867
|
-
|
|
868
|
-
|
|
1015
|
+
required: false
|
|
1016
|
+
schema:
|
|
1017
|
+
type: string
|
|
1018
|
+
format: date
|
|
869
1019
|
example: "2022-07-12"
|
|
870
|
-
|
|
1020
|
+
description: Filter notifications after this date
|
|
1021
|
+
- in: query
|
|
871
1022
|
name: before
|
|
872
|
-
|
|
873
|
-
|
|
1023
|
+
required: false
|
|
1024
|
+
schema:
|
|
1025
|
+
type: string
|
|
1026
|
+
format: date
|
|
874
1027
|
example: "2022-07-12"
|
|
1028
|
+
description: Filter notifications before this date
|
|
1029
|
+
- in: query
|
|
1030
|
+
name: task_type_id
|
|
1031
|
+
required: false
|
|
1032
|
+
schema:
|
|
1033
|
+
type: string
|
|
1034
|
+
format: uuid
|
|
1035
|
+
description: Filter by task type ID
|
|
1036
|
+
- in: query
|
|
1037
|
+
name: task_status_id
|
|
1038
|
+
required: false
|
|
1039
|
+
schema:
|
|
1040
|
+
type: string
|
|
1041
|
+
format: uuid
|
|
1042
|
+
description: Filter by task status ID
|
|
1043
|
+
- in: query
|
|
1044
|
+
name: type
|
|
1045
|
+
required: false
|
|
1046
|
+
schema:
|
|
1047
|
+
type: string
|
|
1048
|
+
description: Filter by notification type
|
|
1049
|
+
- in: query
|
|
1050
|
+
name: read
|
|
1051
|
+
required: false
|
|
1052
|
+
schema:
|
|
1053
|
+
type: boolean
|
|
1054
|
+
description: Filter by read status
|
|
1055
|
+
- in: query
|
|
1056
|
+
name: watching
|
|
1057
|
+
required: false
|
|
1058
|
+
schema:
|
|
1059
|
+
type: boolean
|
|
1060
|
+
description: Filter by watching status
|
|
875
1061
|
responses:
|
|
876
1062
|
200:
|
|
877
|
-
|
|
1063
|
+
description: 100 last user notifications
|
|
1064
|
+
content:
|
|
1065
|
+
application/json:
|
|
1066
|
+
schema:
|
|
1067
|
+
type: array
|
|
1068
|
+
items:
|
|
1069
|
+
type: object
|
|
878
1070
|
"""
|
|
879
1071
|
(
|
|
880
1072
|
after,
|
|
@@ -912,10 +1104,6 @@ class NotificationsResource(Resource, ArgsMixin):
|
|
|
912
1104
|
|
|
913
1105
|
|
|
914
1106
|
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
1107
|
|
|
920
1108
|
def get(self, notification_id):
|
|
921
1109
|
"""
|
|
@@ -927,14 +1115,20 @@ class NotificationResource(Resource, ArgsMixin):
|
|
|
927
1115
|
parameters:
|
|
928
1116
|
- in: path
|
|
929
1117
|
name: notification_id
|
|
930
|
-
required:
|
|
931
|
-
|
|
932
|
-
|
|
1118
|
+
required: true
|
|
1119
|
+
schema:
|
|
1120
|
+
type: string
|
|
1121
|
+
format: uuid
|
|
933
1122
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
934
|
-
|
|
935
1123
|
responses:
|
|
936
1124
|
200:
|
|
937
|
-
|
|
1125
|
+
description: Notification matching given ID
|
|
1126
|
+
content:
|
|
1127
|
+
application/json:
|
|
1128
|
+
schema:
|
|
1129
|
+
type: object
|
|
1130
|
+
404:
|
|
1131
|
+
description: Notification not found
|
|
938
1132
|
"""
|
|
939
1133
|
return user_service.get_notification(notification_id)
|
|
940
1134
|
|
|
@@ -947,13 +1141,30 @@ class NotificationResource(Resource, ArgsMixin):
|
|
|
947
1141
|
parameters:
|
|
948
1142
|
- in: path
|
|
949
1143
|
name: notification_id
|
|
950
|
-
required:
|
|
951
|
-
|
|
952
|
-
|
|
1144
|
+
required: true
|
|
1145
|
+
schema:
|
|
1146
|
+
type: string
|
|
1147
|
+
format: uuid
|
|
953
1148
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1149
|
+
requestBody:
|
|
1150
|
+
required: true
|
|
1151
|
+
content:
|
|
1152
|
+
application/x-www-form-urlencoded:
|
|
1153
|
+
schema:
|
|
1154
|
+
type: object
|
|
1155
|
+
properties:
|
|
1156
|
+
read:
|
|
1157
|
+
type: boolean
|
|
1158
|
+
description: Mark notification as read/unread
|
|
954
1159
|
responses:
|
|
955
1160
|
200:
|
|
956
|
-
|
|
1161
|
+
description: Updated notification
|
|
1162
|
+
content:
|
|
1163
|
+
application/json:
|
|
1164
|
+
schema:
|
|
1165
|
+
type: object
|
|
1166
|
+
404:
|
|
1167
|
+
description: Notification not found
|
|
957
1168
|
"""
|
|
958
1169
|
data = self.get_args([("read", None, False, inputs.boolean)])
|
|
959
1170
|
return user_service.update_notification(notification_id, data["read"])
|
|
@@ -969,16 +1180,21 @@ class MarkAllNotificationsAsReadResource(Resource):
|
|
|
969
1180
|
- User
|
|
970
1181
|
responses:
|
|
971
1182
|
200:
|
|
972
|
-
|
|
1183
|
+
description: All notifications marked as read
|
|
1184
|
+
content:
|
|
1185
|
+
application/json:
|
|
1186
|
+
schema:
|
|
1187
|
+
type: object
|
|
1188
|
+
properties:
|
|
1189
|
+
success:
|
|
1190
|
+
type: boolean
|
|
1191
|
+
example: true
|
|
973
1192
|
"""
|
|
974
1193
|
user_service.mark_notifications_as_read()
|
|
975
1194
|
return {"success": True}
|
|
976
1195
|
|
|
977
1196
|
|
|
978
1197
|
class HasTaskSubscribedResource(Resource):
|
|
979
|
-
"""
|
|
980
|
-
Return true if current user has subscribed to given task.
|
|
981
|
-
"""
|
|
982
1198
|
|
|
983
1199
|
def get(self, task_id):
|
|
984
1200
|
"""
|
|
@@ -989,28 +1205,30 @@ class HasTaskSubscribedResource(Resource):
|
|
|
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 for given task and current user.
|
|
1230
|
+
Create a subscription entry for given task and current user. When a user
|
|
1231
|
+
subscribes, he gets notified everytime a comment is posted on the task.
|
|
1014
1232
|
---
|
|
1015
1233
|
tags:
|
|
1016
1234
|
- User
|
|
@@ -1019,26 +1237,30 @@ class TaskSubscribeResource(Resource):
|
|
|
1019
1237
|
parameters:
|
|
1020
1238
|
- in: path
|
|
1021
1239
|
name: task_id
|
|
1022
|
-
required:
|
|
1023
|
-
|
|
1024
|
-
|
|
1240
|
+
required: true
|
|
1241
|
+
schema:
|
|
1242
|
+
type: string
|
|
1243
|
+
format: uuid
|
|
1025
1244
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1026
1245
|
responses:
|
|
1027
1246
|
201:
|
|
1028
|
-
|
|
1247
|
+
description: Subscription entry created
|
|
1248
|
+
content:
|
|
1249
|
+
application/json:
|
|
1250
|
+
schema:
|
|
1251
|
+
type: object
|
|
1252
|
+
404:
|
|
1253
|
+
description: Task not found
|
|
1029
1254
|
"""
|
|
1030
1255
|
return user_service.subscribe_to_task(task_id), 201
|
|
1031
1256
|
|
|
1032
1257
|
|
|
1033
1258
|
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
1259
|
|
|
1039
1260
|
def delete(self, task_id):
|
|
1040
1261
|
"""
|
|
1041
1262
|
Remove the subscription entry matching given task and current user.
|
|
1263
|
+
The user will no longer receive notifications for this task.
|
|
1042
1264
|
---
|
|
1043
1265
|
tags:
|
|
1044
1266
|
- User
|
|
@@ -1047,22 +1269,22 @@ class TaskUnsubscribeResource(Resource):
|
|
|
1047
1269
|
parameters:
|
|
1048
1270
|
- in: path
|
|
1049
1271
|
name: task_id
|
|
1050
|
-
required:
|
|
1051
|
-
|
|
1052
|
-
|
|
1272
|
+
required: true
|
|
1273
|
+
schema:
|
|
1274
|
+
type: string
|
|
1275
|
+
format: uuid
|
|
1053
1276
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1054
1277
|
responses:
|
|
1055
1278
|
204:
|
|
1056
|
-
|
|
1279
|
+
description: Subscription entry removed
|
|
1280
|
+
404:
|
|
1281
|
+
description: Task not found
|
|
1057
1282
|
"""
|
|
1058
1283
|
user_service.unsubscribe_from_task(task_id)
|
|
1059
1284
|
return "", 204
|
|
1060
1285
|
|
|
1061
1286
|
|
|
1062
1287
|
class HasSequenceSubscribedResource(Resource):
|
|
1063
|
-
"""
|
|
1064
|
-
Return true if current user has subscribed to given sequence and task type.
|
|
1065
|
-
"""
|
|
1066
1288
|
|
|
1067
1289
|
def get(self, sequence_id, task_type_id):
|
|
1068
1290
|
"""
|
|
@@ -1074,20 +1296,27 @@ class HasSequenceSubscribedResource(Resource):
|
|
|
1074
1296
|
parameters:
|
|
1075
1297
|
- in: path
|
|
1076
1298
|
name: sequence_id
|
|
1077
|
-
required:
|
|
1078
|
-
|
|
1079
|
-
|
|
1299
|
+
required: true
|
|
1300
|
+
schema:
|
|
1301
|
+
type: string
|
|
1302
|
+
format: uuid
|
|
1080
1303
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1081
1304
|
- in: path
|
|
1082
1305
|
name: task_type_id
|
|
1083
|
-
required:
|
|
1084
|
-
|
|
1085
|
-
|
|
1306
|
+
required: true
|
|
1307
|
+
schema:
|
|
1308
|
+
type: string
|
|
1309
|
+
format: uuid
|
|
1086
1310
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1087
1311
|
responses:
|
|
1088
1312
|
200:
|
|
1089
|
-
|
|
1090
|
-
|
|
1313
|
+
description: True if current user has subscribed to given sequence and task type, False otherwise
|
|
1314
|
+
content:
|
|
1315
|
+
application/json:
|
|
1316
|
+
schema:
|
|
1317
|
+
type: boolean
|
|
1318
|
+
404:
|
|
1319
|
+
description: Sequence or task type not found
|
|
1091
1320
|
"""
|
|
1092
1321
|
return user_service.has_sequence_subscription(
|
|
1093
1322
|
sequence_id, task_type_id
|
|
@@ -1095,11 +1324,6 @@ class HasSequenceSubscribedResource(Resource):
|
|
|
1095
1324
|
|
|
1096
1325
|
|
|
1097
1326
|
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
1327
|
|
|
1104
1328
|
def post(self, sequence_id, task_type_id):
|
|
1105
1329
|
"""
|
|
@@ -1113,19 +1337,27 @@ class SequenceSubscribeResource(Resource):
|
|
|
1113
1337
|
parameters:
|
|
1114
1338
|
- in: path
|
|
1115
1339
|
name: sequence_id
|
|
1116
|
-
required:
|
|
1117
|
-
|
|
1118
|
-
|
|
1340
|
+
required: true
|
|
1341
|
+
schema:
|
|
1342
|
+
type: string
|
|
1343
|
+
format: uuid
|
|
1119
1344
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1120
1345
|
- in: path
|
|
1121
1346
|
name: task_type_id
|
|
1122
|
-
required:
|
|
1123
|
-
|
|
1124
|
-
|
|
1347
|
+
required: true
|
|
1348
|
+
schema:
|
|
1349
|
+
type: string
|
|
1350
|
+
format: uuid
|
|
1125
1351
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1126
1352
|
responses:
|
|
1127
1353
|
201:
|
|
1128
|
-
|
|
1354
|
+
description: Subscription entry created
|
|
1355
|
+
content:
|
|
1356
|
+
application/json:
|
|
1357
|
+
schema:
|
|
1358
|
+
type: object
|
|
1359
|
+
404:
|
|
1360
|
+
description: Sequence or task type not found
|
|
1129
1361
|
"""
|
|
1130
1362
|
subscription = user_service.subscribe_to_sequence(
|
|
1131
1363
|
sequence_id, task_type_id
|
|
@@ -1134,9 +1366,6 @@ class SequenceSubscribeResource(Resource):
|
|
|
1134
1366
|
|
|
1135
1367
|
|
|
1136
1368
|
class SequenceUnsubscribeResource(Resource):
|
|
1137
|
-
"""
|
|
1138
|
-
Remove a subscription entry for given sequence, task type and current user.
|
|
1139
|
-
"""
|
|
1140
1369
|
|
|
1141
1370
|
def delete(self, sequence_id, task_type_id):
|
|
1142
1371
|
"""
|
|
@@ -1148,29 +1377,29 @@ class SequenceUnsubscribeResource(Resource):
|
|
|
1148
1377
|
parameters:
|
|
1149
1378
|
- in: path
|
|
1150
1379
|
name: sequence_id
|
|
1151
|
-
required:
|
|
1152
|
-
|
|
1153
|
-
|
|
1380
|
+
required: true
|
|
1381
|
+
schema:
|
|
1382
|
+
type: string
|
|
1383
|
+
format: uuid
|
|
1154
1384
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1155
1385
|
- in: path
|
|
1156
1386
|
name: task_type_id
|
|
1157
|
-
required:
|
|
1158
|
-
|
|
1159
|
-
|
|
1387
|
+
required: true
|
|
1388
|
+
schema:
|
|
1389
|
+
type: string
|
|
1390
|
+
format: uuid
|
|
1160
1391
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1161
1392
|
responses:
|
|
1162
1393
|
204:
|
|
1163
|
-
|
|
1394
|
+
description: Subscription entry removed
|
|
1395
|
+
404:
|
|
1396
|
+
description: Sequence or task type not found
|
|
1164
1397
|
"""
|
|
1165
1398
|
user_service.unsubscribe_from_sequence(sequence_id, task_type_id)
|
|
1166
1399
|
return "", 204
|
|
1167
1400
|
|
|
1168
1401
|
|
|
1169
1402
|
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
1403
|
|
|
1175
1404
|
def get(self, project_id, task_type_id):
|
|
1176
1405
|
"""
|
|
@@ -1182,20 +1411,30 @@ class SequenceSubscriptionsResource(Resource):
|
|
|
1182
1411
|
parameters:
|
|
1183
1412
|
- in: path
|
|
1184
1413
|
name: project_id
|
|
1185
|
-
required:
|
|
1186
|
-
|
|
1187
|
-
|
|
1414
|
+
required: true
|
|
1415
|
+
schema:
|
|
1416
|
+
type: string
|
|
1417
|
+
format: uuid
|
|
1188
1418
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1189
1419
|
- in: path
|
|
1190
1420
|
name: task_type_id
|
|
1191
|
-
required:
|
|
1192
|
-
|
|
1193
|
-
|
|
1421
|
+
required: true
|
|
1422
|
+
schema:
|
|
1423
|
+
type: string
|
|
1424
|
+
format: uuid
|
|
1194
1425
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1195
1426
|
responses:
|
|
1196
1427
|
200:
|
|
1197
|
-
|
|
1198
|
-
|
|
1428
|
+
description: List of sequence ids to which the current user has subscribed for given task type
|
|
1429
|
+
content:
|
|
1430
|
+
application/json:
|
|
1431
|
+
schema:
|
|
1432
|
+
type: array
|
|
1433
|
+
items:
|
|
1434
|
+
type: string
|
|
1435
|
+
format: uuid
|
|
1436
|
+
404:
|
|
1437
|
+
description: Project or task type not found
|
|
1199
1438
|
"""
|
|
1200
1439
|
return user_service.get_sequence_subscriptions(
|
|
1201
1440
|
project_id, task_type_id
|
|
@@ -1209,6 +1448,41 @@ class TimeSpentsResource(Resource):
|
|
|
1209
1448
|
"""
|
|
1210
1449
|
|
|
1211
1450
|
def get(self):
|
|
1451
|
+
"""
|
|
1452
|
+
Get all time spents for the current user.
|
|
1453
|
+
Optionnaly can accept date range parameters.
|
|
1454
|
+
---
|
|
1455
|
+
tags:
|
|
1456
|
+
- User
|
|
1457
|
+
parameters:
|
|
1458
|
+
- in: query
|
|
1459
|
+
name: start_date
|
|
1460
|
+
required: false
|
|
1461
|
+
schema:
|
|
1462
|
+
type: string
|
|
1463
|
+
format: date
|
|
1464
|
+
example: "2022-07-12"
|
|
1465
|
+
description: Start date for filtering time spents
|
|
1466
|
+
- in: query
|
|
1467
|
+
name: end_date
|
|
1468
|
+
required: false
|
|
1469
|
+
schema:
|
|
1470
|
+
type: string
|
|
1471
|
+
format: date
|
|
1472
|
+
example: "2022-07-12"
|
|
1473
|
+
description: End date for filtering time spents
|
|
1474
|
+
responses:
|
|
1475
|
+
200:
|
|
1476
|
+
description: All time spents for the current user
|
|
1477
|
+
content:
|
|
1478
|
+
application/json:
|
|
1479
|
+
schema:
|
|
1480
|
+
type: array
|
|
1481
|
+
items:
|
|
1482
|
+
type: object
|
|
1483
|
+
400:
|
|
1484
|
+
description: Wrong date format
|
|
1485
|
+
"""
|
|
1212
1486
|
arguments = self.get_args(["start_date", "end_date"])
|
|
1213
1487
|
start_date, end_date = arguments["start_date"], arguments["end_date"]
|
|
1214
1488
|
current_user = persons_service.get_current_user()
|
|
@@ -1234,24 +1508,42 @@ class TimeSpentsResource(Resource):
|
|
|
1234
1508
|
|
|
1235
1509
|
|
|
1236
1510
|
class DateTimeSpentsResource(Resource):
|
|
1237
|
-
"""
|
|
1238
|
-
Get time spents on for current user and given date.
|
|
1239
|
-
"""
|
|
1240
1511
|
|
|
1241
1512
|
def get(self, date):
|
|
1513
|
+
"""
|
|
1514
|
+
Get time spents on for current user and given date.
|
|
1515
|
+
---
|
|
1516
|
+
tags:
|
|
1517
|
+
- User
|
|
1518
|
+
parameters:
|
|
1519
|
+
- in: path
|
|
1520
|
+
name: date
|
|
1521
|
+
required: true
|
|
1522
|
+
schema:
|
|
1523
|
+
type: string
|
|
1524
|
+
format: date
|
|
1525
|
+
example: "2022-07-12"
|
|
1526
|
+
description: Date to get time spents for
|
|
1527
|
+
responses:
|
|
1528
|
+
200:
|
|
1529
|
+
description: Time spents on for current user and given date
|
|
1530
|
+
content:
|
|
1531
|
+
application/json:
|
|
1532
|
+
schema:
|
|
1533
|
+
type: object
|
|
1534
|
+
400:
|
|
1535
|
+
description: Wrong date format
|
|
1536
|
+
"""
|
|
1242
1537
|
try:
|
|
1243
1538
|
current_user = persons_service.get_current_user()
|
|
1244
1539
|
return time_spents_service.get_time_spents(
|
|
1245
1540
|
current_user["id"], date
|
|
1246
1541
|
)
|
|
1247
1542
|
except WrongDateFormatException:
|
|
1248
|
-
abort(
|
|
1543
|
+
abort(400)
|
|
1249
1544
|
|
|
1250
1545
|
|
|
1251
1546
|
class TaskTimeSpentResource(Resource):
|
|
1252
|
-
"""
|
|
1253
|
-
Get time spents for current user and given date.
|
|
1254
|
-
"""
|
|
1255
1547
|
|
|
1256
1548
|
def get(self, task_id, date):
|
|
1257
1549
|
"""
|
|
@@ -1262,21 +1554,27 @@ class TaskTimeSpentResource(Resource):
|
|
|
1262
1554
|
parameters:
|
|
1263
1555
|
- in: path
|
|
1264
1556
|
name: task_id
|
|
1265
|
-
required:
|
|
1266
|
-
|
|
1267
|
-
|
|
1557
|
+
required: true
|
|
1558
|
+
schema:
|
|
1559
|
+
type: string
|
|
1560
|
+
format: uuid
|
|
1268
1561
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1269
1562
|
- in: path
|
|
1270
1563
|
name: date
|
|
1271
|
-
required:
|
|
1272
|
-
|
|
1273
|
-
|
|
1564
|
+
required: true
|
|
1565
|
+
schema:
|
|
1566
|
+
type: string
|
|
1567
|
+
format: date
|
|
1274
1568
|
example: "2022-07-12"
|
|
1275
1569
|
responses:
|
|
1276
1570
|
200:
|
|
1277
|
-
|
|
1571
|
+
description: Time spents for current user and given date
|
|
1572
|
+
content:
|
|
1573
|
+
application/json:
|
|
1574
|
+
schema:
|
|
1575
|
+
type: object
|
|
1278
1576
|
404:
|
|
1279
|
-
|
|
1577
|
+
description: Wrong date format or task not found
|
|
1280
1578
|
"""
|
|
1281
1579
|
try:
|
|
1282
1580
|
current_user = persons_service.get_current_user()
|
|
@@ -1288,9 +1586,6 @@ class TaskTimeSpentResource(Resource):
|
|
|
1288
1586
|
|
|
1289
1587
|
|
|
1290
1588
|
class DayOffResource(Resource):
|
|
1291
|
-
"""
|
|
1292
|
-
Get day off object for current user and given date.
|
|
1293
|
-
"""
|
|
1294
1589
|
|
|
1295
1590
|
def get(self, date):
|
|
1296
1591
|
"""
|
|
@@ -1301,15 +1596,20 @@ class DayOffResource(Resource):
|
|
|
1301
1596
|
parameters:
|
|
1302
1597
|
- in: path
|
|
1303
1598
|
name: date
|
|
1304
|
-
required:
|
|
1305
|
-
|
|
1306
|
-
|
|
1599
|
+
required: true
|
|
1600
|
+
schema:
|
|
1601
|
+
type: string
|
|
1602
|
+
format: date
|
|
1307
1603
|
example: "2022-07-12"
|
|
1308
1604
|
responses:
|
|
1309
1605
|
200:
|
|
1310
|
-
|
|
1606
|
+
description: Day off object for current user and given date
|
|
1607
|
+
content:
|
|
1608
|
+
application/json:
|
|
1609
|
+
schema:
|
|
1610
|
+
type: object
|
|
1311
1611
|
404:
|
|
1312
|
-
|
|
1612
|
+
description: Wrong date format
|
|
1313
1613
|
"""
|
|
1314
1614
|
try:
|
|
1315
1615
|
current_user = persons_service.get_current_user()
|
|
@@ -1319,6 +1619,7 @@ class DayOffResource(Resource):
|
|
|
1319
1619
|
|
|
1320
1620
|
|
|
1321
1621
|
class ContextResource(Resource):
|
|
1622
|
+
|
|
1322
1623
|
def get(self):
|
|
1323
1624
|
"""
|
|
1324
1625
|
Return context required to properly run a full app connected to the API
|
|
@@ -1328,13 +1629,17 @@ class ContextResource(Resource):
|
|
|
1328
1629
|
- User
|
|
1329
1630
|
responses:
|
|
1330
1631
|
200:
|
|
1331
|
-
|
|
1332
|
-
|
|
1632
|
+
description: Context to properly run a full app connected to the API
|
|
1633
|
+
content:
|
|
1634
|
+
application/json:
|
|
1635
|
+
schema:
|
|
1636
|
+
type: object
|
|
1333
1637
|
"""
|
|
1334
1638
|
return user_service.get_context()
|
|
1335
1639
|
|
|
1336
1640
|
|
|
1337
1641
|
class ClearAvatarResource(Resource):
|
|
1642
|
+
|
|
1338
1643
|
def delete(self):
|
|
1339
1644
|
"""
|
|
1340
1645
|
Set `has_avatar` flag to False for current user and remove its avatar
|
|
@@ -1344,7 +1649,9 @@ class ClearAvatarResource(Resource):
|
|
|
1344
1649
|
- User
|
|
1345
1650
|
responses:
|
|
1346
1651
|
204:
|
|
1347
|
-
|
|
1652
|
+
description: Avatar file deleted
|
|
1653
|
+
404:
|
|
1654
|
+
description: User not found
|
|
1348
1655
|
"""
|
|
1349
1656
|
user = persons_service.get_current_user()
|
|
1350
1657
|
persons_service.clear_avatar(user["id"])
|
|
@@ -1361,7 +1668,13 @@ class ChatsResource(Resource):
|
|
|
1361
1668
|
- User
|
|
1362
1669
|
responses:
|
|
1363
1670
|
200:
|
|
1364
|
-
|
|
1671
|
+
description: Chats where user is participant
|
|
1672
|
+
content:
|
|
1673
|
+
application/json:
|
|
1674
|
+
schema:
|
|
1675
|
+
type: array
|
|
1676
|
+
items:
|
|
1677
|
+
type: object
|
|
1365
1678
|
"""
|
|
1366
1679
|
user = persons_service.get_current_user()
|
|
1367
1680
|
return chats_service.get_chats_for_person(user["id"])
|
|
@@ -1378,13 +1691,20 @@ class JoinChatResource(Resource):
|
|
|
1378
1691
|
parameters:
|
|
1379
1692
|
- in: path
|
|
1380
1693
|
name: entity_id
|
|
1381
|
-
required:
|
|
1382
|
-
|
|
1383
|
-
|
|
1694
|
+
required: true
|
|
1695
|
+
schema:
|
|
1696
|
+
type: string
|
|
1697
|
+
format: uuid
|
|
1384
1698
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1385
1699
|
responses:
|
|
1386
1700
|
201:
|
|
1387
|
-
|
|
1701
|
+
description: Chat joined
|
|
1702
|
+
content:
|
|
1703
|
+
application/json:
|
|
1704
|
+
schema:
|
|
1705
|
+
type: object
|
|
1706
|
+
404:
|
|
1707
|
+
description: Entity not found
|
|
1388
1708
|
"""
|
|
1389
1709
|
entity = entities_service.get_entity(entity_id)
|
|
1390
1710
|
user_service.check_project_access(entity["project_id"])
|
|
@@ -1401,13 +1721,16 @@ class JoinChatResource(Resource):
|
|
|
1401
1721
|
parameters:
|
|
1402
1722
|
- in: path
|
|
1403
1723
|
name: entity_id
|
|
1404
|
-
required:
|
|
1405
|
-
|
|
1406
|
-
|
|
1724
|
+
required: true
|
|
1725
|
+
schema:
|
|
1726
|
+
type: string
|
|
1727
|
+
format: uuid
|
|
1407
1728
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
1408
1729
|
responses:
|
|
1409
1730
|
204:
|
|
1410
|
-
|
|
1731
|
+
description: Chat left successfully
|
|
1732
|
+
404:
|
|
1733
|
+
description: Entity not found
|
|
1411
1734
|
"""
|
|
1412
1735
|
entity = entities_service.get_entity(entity_id)
|
|
1413
1736
|
user_service.check_project_access(entity["project_id"])
|