zou 0.20.82__py3-none-any.whl → 0.20.84__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. zou/__init__.py +1 -1
  2. zou/app/blueprints/assets/resources.py +1060 -153
  3. zou/app/blueprints/auth/resources.py +368 -238
  4. zou/app/blueprints/breakdown/resources.py +584 -94
  5. zou/app/blueprints/chats/resources.py +176 -37
  6. zou/app/blueprints/comments/resources.py +409 -150
  7. zou/app/blueprints/concepts/resources.py +443 -63
  8. zou/app/blueprints/crud/asset_instance.py +272 -0
  9. zou/app/blueprints/crud/attachment_file.py +263 -0
  10. zou/app/blueprints/crud/base.py +176 -69
  11. zou/app/blueprints/crud/budget.py +278 -0
  12. zou/app/blueprints/crud/budget_entry.py +269 -0
  13. zou/app/blueprints/crud/chat.py +282 -0
  14. zou/app/blueprints/crud/chat_message.py +286 -0
  15. zou/app/blueprints/crud/comments.py +312 -1
  16. zou/app/blueprints/crud/custom_action.py +268 -0
  17. zou/app/blueprints/crud/day_off.py +298 -0
  18. zou/app/blueprints/crud/department.py +268 -0
  19. zou/app/blueprints/crud/entity.py +297 -3
  20. zou/app/blueprints/crud/entity_link.py +303 -0
  21. zou/app/blueprints/crud/entity_type.py +269 -0
  22. zou/app/blueprints/crud/event.py +197 -0
  23. zou/app/blueprints/crud/file_status.py +268 -0
  24. zou/app/blueprints/crud/hardware_item.py +268 -0
  25. zou/app/blueprints/crud/metadata_descriptor.py +312 -0
  26. zou/app/blueprints/crud/milestone.py +302 -1
  27. zou/app/blueprints/crud/news.py +285 -0
  28. zou/app/blueprints/crud/notification.py +287 -0
  29. zou/app/blueprints/crud/organisation.py +269 -0
  30. zou/app/blueprints/crud/output_file.py +34 -10
  31. zou/app/blueprints/crud/output_type.py +30 -10
  32. zou/app/blueprints/crud/person.py +407 -2
  33. zou/app/blueprints/crud/playlist.py +322 -4
  34. zou/app/blueprints/crud/plugin.py +269 -0
  35. zou/app/blueprints/crud/preview_background_file.py +272 -0
  36. zou/app/blueprints/crud/preview_file.py +280 -9
  37. zou/app/blueprints/crud/production_schedule_version.py +569 -0
  38. zou/app/blueprints/crud/project.py +440 -0
  39. zou/app/blueprints/crud/project_status.py +268 -0
  40. zou/app/blueprints/crud/salary_scale.py +185 -5
  41. zou/app/blueprints/crud/schedule_item.py +305 -0
  42. zou/app/blueprints/crud/search_filter.py +302 -0
  43. zou/app/blueprints/crud/search_filter_group.py +270 -0
  44. zou/app/blueprints/crud/software.py +30 -10
  45. zou/app/blueprints/crud/status_automation.py +296 -2
  46. zou/app/blueprints/crud/studio.py +268 -0
  47. zou/app/blueprints/crud/subscription.py +279 -0
  48. zou/app/blueprints/crud/task.py +325 -5
  49. zou/app/blueprints/crud/task_status.py +301 -0
  50. zou/app/blueprints/crud/task_type.py +283 -0
  51. zou/app/blueprints/crud/time_spent.py +327 -0
  52. zou/app/blueprints/crud/working_file.py +273 -10
  53. zou/app/blueprints/departments/resources.py +302 -68
  54. zou/app/blueprints/edits/resources.py +651 -81
  55. zou/app/blueprints/entities/resources.py +104 -39
  56. zou/app/blueprints/events/resources.py +96 -8
  57. zou/app/blueprints/export/csv/assets.py +15 -5
  58. zou/app/blueprints/export/csv/base.py +12 -3
  59. zou/app/blueprints/export/csv/casting.py +32 -5
  60. zou/app/blueprints/export/csv/edits.py +15 -5
  61. zou/app/blueprints/export/csv/persons.py +24 -0
  62. zou/app/blueprints/export/csv/playlists.py +16 -5
  63. zou/app/blueprints/export/csv/projects.py +23 -0
  64. zou/app/blueprints/export/csv/shots.py +15 -5
  65. zou/app/blueprints/export/csv/task_types.py +23 -0
  66. zou/app/blueprints/export/csv/tasks.py +24 -0
  67. zou/app/blueprints/export/csv/time_spents.py +24 -0
  68. zou/app/blueprints/files/resources.py +928 -377
  69. zou/app/blueprints/index/resources.py +49 -42
  70. zou/app/blueprints/news/resources.py +47 -27
  71. zou/app/blueprints/persons/resources.py +644 -271
  72. zou/app/blueprints/playlists/resources.py +154 -72
  73. zou/app/blueprints/previews/resources.py +473 -228
  74. zou/app/blueprints/projects/__init__.py +5 -0
  75. zou/app/blueprints/projects/resources.py +987 -420
  76. zou/app/blueprints/search/resources.py +44 -32
  77. zou/app/blueprints/shots/resources.py +1338 -88
  78. zou/app/blueprints/source/csv/assets.py +44 -6
  79. zou/app/blueprints/source/csv/casting.py +43 -6
  80. zou/app/blueprints/source/csv/edits.py +47 -9
  81. zou/app/blueprints/source/csv/persons.py +43 -4
  82. zou/app/blueprints/source/csv/shots.py +47 -6
  83. zou/app/blueprints/source/csv/task_type_estimations.py +95 -35
  84. zou/app/blueprints/source/kitsu.py +433 -11
  85. zou/app/blueprints/source/otio.py +215 -20
  86. zou/app/blueprints/source/shotgun/assets.py +146 -0
  87. zou/app/blueprints/source/shotgun/base.py +85 -14
  88. zou/app/blueprints/source/shotgun/episode.py +124 -0
  89. zou/app/blueprints/source/shotgun/import_errors.py +105 -14
  90. zou/app/blueprints/source/shotgun/notes.py +132 -0
  91. zou/app/blueprints/source/shotgun/person.py +163 -0
  92. zou/app/blueprints/source/shotgun/project.py +120 -0
  93. zou/app/blueprints/source/shotgun/scene.py +120 -0
  94. zou/app/blueprints/source/shotgun/sequence.py +134 -0
  95. zou/app/blueprints/source/shotgun/shot.py +166 -0
  96. zou/app/blueprints/source/shotgun/status.py +129 -0
  97. zou/app/blueprints/source/shotgun/steps.py +138 -0
  98. zou/app/blueprints/source/shotgun/tasks.py +199 -0
  99. zou/app/blueprints/source/shotgun/team.py +132 -0
  100. zou/app/blueprints/source/shotgun/versions.py +155 -0
  101. zou/app/blueprints/tasks/resources.py +1197 -308
  102. zou/app/blueprints/user/resources.py +1808 -215
  103. zou/app/models/metadata_descriptor.py +1 -0
  104. zou/app/services/persons_service.py +1 -1
  105. zou/app/services/projects_service.py +45 -1
  106. zou/app/services/time_spents_service.py +1 -1
  107. zou/app/swagger.py +100 -27
  108. zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
  109. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/METADATA +18 -18
  110. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/RECORD +114 -113
  111. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/WHEEL +0 -0
  112. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/entry_points.txt +0 -0
  113. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/licenses/LICENSE +0 -0
  114. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/top_level.txt +0 -0
@@ -33,17 +33,17 @@ from zou.app.mixin import ArgsMixin
33
33
 
34
34
 
35
35
  class AddPreviewResource(Resource, ArgsMixin):
36
+
36
37
  @jwt_required()
37
38
  def post(self, task_id, comment_id):
38
39
  """
39
- Add preview metadata to given task. The preview file itself should be
40
- uploaded afterward.
41
-
42
- Revision is automatically set: it is equal to last revision + 1. It can
43
- be also set manually.
40
+ Add task preview
44
41
  ---
45
42
  tags:
46
43
  - Tasks
44
+ description: Add preview metadata to a task. The preview file is
45
+ uploaded after. Revision is auto set to last + 1. It can also be set
46
+ manually.
47
47
  parameters:
48
48
  - in: path
49
49
  name: task_id
@@ -72,15 +72,37 @@ class AddPreviewResource(Resource, ArgsMixin):
72
72
  example: 1
73
73
  responses:
74
74
  201:
75
- description: Preview metadata added to given task
75
+ description: Preview metadata added to task
76
76
  content:
77
77
  application/json:
78
78
  schema:
79
79
  type: object
80
+ properties:
81
+ id:
82
+ type: string
83
+ format: uuid
84
+ example: b24a6ea4-ce75-4665-a070-57453082c25
85
+ comment_id:
86
+ type: string
87
+ format: uuid
88
+ example: a24a6ea4-ce75-4665-a070-57453082c25
89
+ task_id:
90
+ type: string
91
+ format: uuid
92
+ example: c24a6ea4-ce75-4665-a070-57453082c25
93
+ revision:
94
+ type: integer
95
+ example: 3
96
+ person_id:
97
+ type: string
98
+ format: uuid
99
+ example: d24a6ea4-ce75-4665-a070-57453082c25
100
+ created_at:
101
+ type: string
102
+ format: date-time
103
+ example: "2024-01-15T10:30:00Z"
80
104
  400:
81
105
  description: Bad request
82
- 404:
83
- description: Task or comment not found
84
106
  """
85
107
  args = self.get_args([("revision", 0, False, int)])
86
108
 
@@ -94,17 +116,16 @@ class AddPreviewResource(Resource, ArgsMixin):
94
116
 
95
117
 
96
118
  class AddExtraPreviewResource(Resource, ArgsMixin):
97
- """
98
- Add a preview to given comment.
99
- """
100
119
 
101
120
  @jwt_required()
102
121
  def post(self, task_id, comment_id, preview_file_id):
103
122
  """
104
- Add a preview to given comment.
123
+ Add preview to comment
105
124
  ---
106
125
  tags:
107
126
  - Tasks
127
+ description: Add a preview to a comment by uploading a file in multipart
128
+ form data.
108
129
  parameters:
109
130
  - in: path
110
131
  name: task_id
@@ -140,15 +161,33 @@ class AddExtraPreviewResource(Resource, ArgsMixin):
140
161
  description: Preview file to upload
141
162
  responses:
142
163
  201:
143
- description: Preview added to given comment
164
+ description: Preview added to comment
144
165
  content:
145
166
  application/json:
146
167
  schema:
147
168
  type: object
169
+ properties:
170
+ id:
171
+ type: string
172
+ format: uuid
173
+ example: b24a6ea4-ce75-4665-a070-57453082c25
174
+ comment_id:
175
+ type: string
176
+ format: uuid
177
+ example: a24a6ea4-ce75-4665-a070-57453082c25
178
+ task_id:
179
+ type: string
180
+ format: uuid
181
+ example: c24a6ea4-ce75-4665-a070-57453082c25
182
+ revision:
183
+ type: integer
184
+ example: 2
185
+ person_id:
186
+ type: string
187
+ format: uuid
188
+ example: d24a6ea4-ce75-4665-a070-57453082c25
148
189
  400:
149
190
  description: Bad request
150
- 404:
151
- description: Task, comment, or preview file not found
152
191
  """
153
192
  user_service.check_task_action_access(task_id)
154
193
  tasks_service.get_comment(comment_id)
@@ -164,10 +203,12 @@ class AddExtraPreviewResource(Resource, ArgsMixin):
164
203
  @jwt_required()
165
204
  def delete(self, task_id, comment_id, preview_file_id):
166
205
  """
167
- Delete preview from given comment.
206
+ Delete preview from comment
168
207
  ---
169
208
  tags:
170
209
  - Tasks
210
+ description: Delete a preview from a comment. Use force query to delete
211
+ even if there are dependencies.
171
212
  parameters:
172
213
  - in: path
173
214
  name: task_id
@@ -199,9 +240,7 @@ class AddExtraPreviewResource(Resource, ArgsMixin):
199
240
  description: Force deletion even if preview has dependencies
200
241
  responses:
201
242
  204:
202
- description: Preview deleted from given comment
203
- 404:
204
- description: Task, comment, or preview file not found
243
+ description: Preview deleted from comment
205
244
  """
206
245
  task = tasks_service.get_task(task_id)
207
246
  user_service.check_project_access(task["project_id"])
@@ -212,17 +251,15 @@ class AddExtraPreviewResource(Resource, ArgsMixin):
212
251
 
213
252
 
214
253
  class TaskPreviewsResource(Resource):
215
- """
216
- Return previews linked to given task.
217
- """
218
254
 
219
255
  @jwt_required()
220
256
  def get(self, task_id):
221
257
  """
222
- Return previews linked to given task.
258
+ Get task previews
223
259
  ---
224
260
  tags:
225
261
  - Tasks
262
+ description: Return previews linked to a task.
226
263
  parameters:
227
264
  - in: path
228
265
  name: task_id
@@ -233,32 +270,52 @@ class TaskPreviewsResource(Resource):
233
270
  example: a24a6ea4-ce75-4665-a070-57453082c25
234
271
  responses:
235
272
  200:
236
- description: Previews linked to given task
273
+ description: Previews linked to task
237
274
  content:
238
275
  application/json:
239
276
  schema:
240
277
  type: array
241
278
  items:
242
279
  type: object
243
- 404:
244
- description: Task not found
280
+ properties:
281
+ id:
282
+ type: string
283
+ format: uuid
284
+ example: a24a6ea4-ce75-4665-a070-57453082c25
285
+ task_id:
286
+ type: string
287
+ format: uuid
288
+ example: b24a6ea4-ce75-4665-a070-57453082c25
289
+ revision:
290
+ type: integer
291
+ example: 1
292
+ comment_id:
293
+ type: string
294
+ format: uuid
295
+ example: d24a6ea4-ce75-4665-a070-57453082c25
296
+ person_id:
297
+ type: string
298
+ format: uuid
299
+ example: e24a6ea4-ce75-4665-a070-57453082c25
300
+ created_at:
301
+ type: string
302
+ format: date-time
303
+ example: "2024-01-15T10:30:00Z"
245
304
  """
246
305
  user_service.check_task_access(task_id)
247
306
  return files_service.get_preview_files_for_task(task_id)
248
307
 
249
308
 
250
309
  class TaskCommentsResource(Resource):
251
- """
252
- Return comments linked to given task.
253
- """
254
310
 
255
311
  @jwt_required()
256
312
  def get(self, task_id):
257
313
  """
258
- Return comments linked to given task.
314
+ Get task comments
259
315
  ---
260
316
  tags:
261
317
  - Tasks
318
+ description: Return comments linked to a task.
262
319
  parameters:
263
320
  - in: path
264
321
  name: task_id
@@ -269,15 +326,37 @@ class TaskCommentsResource(Resource):
269
326
  example: a24a6ea4-ce75-4665-a070-57453082c25
270
327
  responses:
271
328
  200:
272
- description: Comments linked to given task
329
+ description: Comments linked to task
273
330
  content:
274
331
  application/json:
275
332
  schema:
276
333
  type: array
277
334
  items:
278
335
  type: object
279
- 404:
280
- description: Task not found
336
+ properties:
337
+ id:
338
+ type: string
339
+ format: uuid
340
+ example: a24a6ea4-ce75-4665-a070-57453082c25
341
+ object_id:
342
+ type: string
343
+ format: uuid
344
+ example: b24a6ea4-ce75-4665-a070-57453082c25
345
+ person_id:
346
+ type: string
347
+ format: uuid
348
+ example: c24a6ea4-ce75-4665-a070-57453082c25
349
+ text:
350
+ type: string
351
+ example: This task is progressing well
352
+ created_at:
353
+ type: string
354
+ format: date-time
355
+ example: "2024-01-15T10:30:00Z"
356
+ updated_at:
357
+ type: string
358
+ format: date-time
359
+ example: "2024-01-15T11:00:00Z"
281
360
  """
282
361
  user_service.check_task_access(task_id)
283
362
  is_client = permissions.has_client_permissions()
@@ -289,17 +368,15 @@ class TaskCommentsResource(Resource):
289
368
 
290
369
 
291
370
  class TaskCommentResource(Resource):
292
- """
293
- Remove given comment and update linked task accordingly.
294
- """
295
371
 
296
372
  @jwt_required()
297
373
  def get(self, task_id, comment_id):
298
374
  """
299
- Get comment corresponding at given ID.
375
+ Get comment
300
376
  ---
301
377
  tags:
302
378
  - Tasks
379
+ description: Get a comment by id for a task.
303
380
  parameters:
304
381
  - in: path
305
382
  name: task_id
@@ -317,13 +394,35 @@ class TaskCommentResource(Resource):
317
394
  example: a24a6ea4-ce75-4665-a070-57453082c25
318
395
  responses:
319
396
  200:
320
- description: Comment corresponding at given ID
397
+ description: Comment found and returned
321
398
  content:
322
399
  application/json:
323
400
  schema:
324
401
  type: object
325
- 404:
326
- description: Task or comment not found
402
+ properties:
403
+ id:
404
+ type: string
405
+ format: uuid
406
+ example: a24a6ea4-ce75-4665-a070-57453082c25
407
+ object_id:
408
+ type: string
409
+ format: uuid
410
+ example: b24a6ea4-ce75-4665-a070-57453082c25
411
+ person_id:
412
+ type: string
413
+ format: uuid
414
+ example: c24a6ea4-ce75-4665-a070-57453082c25
415
+ text:
416
+ type: string
417
+ example: Review completed successfully
418
+ created_at:
419
+ type: string
420
+ format: date-time
421
+ example: "2024-01-15T10:30:00Z"
422
+ updated_at:
423
+ type: string
424
+ format: date-time
425
+ example: "2024-01-15T11:00:00Z"
327
426
  """
328
427
  comment = tasks_service.get_comment(comment_id)
329
428
  user_service.check_comment_access(comment)
@@ -353,10 +452,11 @@ class TaskCommentResource(Resource):
353
452
  @jwt_required()
354
453
  def delete(self, task_id, comment_id):
355
454
  """
356
- Delete a comment corresponding at given ID.
455
+ Delete comment
357
456
  ---
358
457
  tags:
359
458
  - Tasks
459
+ description: Delete a comment by id for a task.
360
460
  parameters:
361
461
  - in: path
362
462
  name: task_id
@@ -374,9 +474,7 @@ class TaskCommentResource(Resource):
374
474
  example: a24a6ea4-ce75-4665-a070-57453082c25
375
475
  responses:
376
476
  204:
377
- description: Comment corresponding at given ID deleted
378
- 404:
379
- description: Task or comment not found
477
+ description: Comment deleted
380
478
  """
381
479
  comment = tasks_service.get_comment(comment_id)
382
480
  task = tasks_service.get_task(comment["object_id"])
@@ -393,18 +491,16 @@ class TaskCommentResource(Resource):
393
491
 
394
492
 
395
493
  class PersonTasksResource(Resource):
396
- """
397
- Return task assigned to given user of which status has is_done flag sets
398
- to false.
399
- """
400
494
 
401
495
  @jwt_required()
402
496
  def get(self, person_id):
403
497
  """
404
- Return task assigned to given user of which status has is_done flag sets to false.
498
+ Get person open tasks
405
499
  ---
406
500
  tags:
407
501
  - Tasks
502
+ description: List tasks assigned to a person where the status is not
503
+ done.
408
504
  parameters:
409
505
  - in: path
410
506
  name: person_id
@@ -422,8 +518,36 @@ class PersonTasksResource(Resource):
422
518
  type: array
423
519
  items:
424
520
  type: object
425
- 404:
426
- description: Person not found
521
+ properties:
522
+ id:
523
+ type: string
524
+ format: uuid
525
+ example: a24a6ea4-ce75-4665-a070-57453082c25
526
+ name:
527
+ type: string
528
+ example: SH010 Animation
529
+ task_type_id:
530
+ type: string
531
+ format: uuid
532
+ example: b24a6ea4-ce75-4665-a070-57453082c25
533
+ task_status_id:
534
+ type: string
535
+ format: uuid
536
+ example: c24a6ea4-ce75-4665-a070-57453082c25
537
+ entity_id:
538
+ type: string
539
+ format: uuid
540
+ example: d24a6ea4-ce75-4665-a070-57453082c25
541
+ project_id:
542
+ type: string
543
+ format: uuid
544
+ example: e24a6ea4-ce75-4665-a070-57453082c25
545
+ assignees:
546
+ type: array
547
+ items:
548
+ type: string
549
+ format: uuid
550
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
427
551
  """
428
552
  user_service.check_person_is_not_bot(person_id)
429
553
  if not permissions.has_admin_permissions():
@@ -440,18 +564,16 @@ class PersonTasksResource(Resource):
440
564
 
441
565
 
442
566
  class PersonRelatedTasksResource(Resource):
443
- """
444
- For all entities assigned to given person (that have at least one task
445
- assigned to given person), returns all tasks for given task type.
446
- """
447
567
 
448
568
  @jwt_required()
449
569
  def get(self, person_id, task_type_id):
450
570
  """
451
- For all entities assigned to given person (that have at least one task assigned to given person), returns all tasks for given task type.
571
+ Get person tasks for type
452
572
  ---
453
573
  tags:
454
574
  - Tasks
575
+ description: For all entities assigned to the person, return tasks for
576
+ the given task type.
455
577
  parameters:
456
578
  - in: path
457
579
  name: person_id
@@ -469,15 +591,43 @@ class PersonRelatedTasksResource(Resource):
469
591
  example: a24a6ea4-ce75-4665-a070-57453082c25
470
592
  responses:
471
593
  200:
472
- description: All Tasks for given task type
594
+ description: All tasks for the given task type
473
595
  content:
474
596
  application/json:
475
597
  schema:
476
598
  type: array
477
599
  items:
478
600
  type: object
479
- 404:
480
- description: Person or task type not found
601
+ properties:
602
+ id:
603
+ type: string
604
+ format: uuid
605
+ example: a24a6ea4-ce75-4665-a070-57453082c25
606
+ name:
607
+ type: string
608
+ example: Asset Modeling
609
+ task_type_id:
610
+ type: string
611
+ format: uuid
612
+ example: b24a6ea4-ce75-4665-a070-57453082c25
613
+ task_status_id:
614
+ type: string
615
+ format: uuid
616
+ example: c24a6ea4-ce75-4665-a070-57453082c25
617
+ entity_id:
618
+ type: string
619
+ format: uuid
620
+ example: d24a6ea4-ce75-4665-a070-57453082c25
621
+ project_id:
622
+ type: string
623
+ format: uuid
624
+ example: e24a6ea4-ce75-4665-a070-57453082c25
625
+ assignees:
626
+ type: array
627
+ items:
628
+ type: string
629
+ format: uuid
630
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
481
631
  """
482
632
  user_service.check_person_is_not_bot(person_id)
483
633
  user = persons_service.get_current_user()
@@ -487,19 +637,16 @@ class PersonRelatedTasksResource(Resource):
487
637
 
488
638
 
489
639
  class PersonDoneTasksResource(Resource):
490
- """
491
- Return task assigned to given user of which status has is_done flag sets
492
- to true. It return only tasks related to open projects.
493
- """
494
640
 
495
641
  @jwt_required()
496
642
  def get(self, person_id):
497
643
  """
498
- Return task assigned to given user of which status has is_done flag sets to true.
644
+ Get person done tasks
499
645
  ---
500
646
  tags:
501
647
  - Tasks
502
- description: It return only tasks related to open projects.
648
+ description: Return tasks assigned to the person that are done. Only
649
+ tasks in open projects are returned.
503
650
  parameters:
504
651
  - in: path
505
652
  name: person_id
@@ -517,8 +664,36 @@ class PersonDoneTasksResource(Resource):
517
664
  type: array
518
665
  items:
519
666
  type: object
520
- 404:
521
- description: Person not found
667
+ properties:
668
+ id:
669
+ type: string
670
+ format: uuid
671
+ example: a24a6ea4-ce75-4665-a070-57453082c25
672
+ name:
673
+ type: string
674
+ example: EP01 Layout
675
+ task_type_id:
676
+ type: string
677
+ format: uuid
678
+ example: b24a6ea4-ce75-4665-a070-57453082c25
679
+ task_status_id:
680
+ type: string
681
+ format: uuid
682
+ example: c24a6ea4-ce75-4665-a070-57453082c25
683
+ entity_id:
684
+ type: string
685
+ format: uuid
686
+ example: d24a6ea4-ce75-4665-a070-57453082c25
687
+ project_id:
688
+ type: string
689
+ format: uuid
690
+ example: e24a6ea4-ce75-4665-a070-57453082c25
691
+ assignees:
692
+ type: array
693
+ items:
694
+ type: string
695
+ format: uuid
696
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
522
697
  """
523
698
  user_service.check_person_is_not_bot(person_id)
524
699
  if not permissions.has_admin_permissions():
@@ -535,17 +710,16 @@ class PersonDoneTasksResource(Resource):
535
710
 
536
711
 
537
712
  class CreateShotTasksResource(Resource):
538
- """
539
- Create a new task for given shot and task type.
540
- """
541
713
 
542
714
  @jwt_required()
543
715
  def post(self, project_id, task_type_id):
544
716
  """
545
- Create a new task for given shot and task type.
717
+ Create shot tasks
546
718
  ---
547
719
  tags:
548
720
  - Tasks
721
+ description: Create tasks for shots. Provide a list of shot IDs in the
722
+ JSON body, or omit for all shots in the project.
549
723
  parameters:
550
724
  - in: path
551
725
  name: project_id
@@ -571,19 +745,42 @@ class CreateShotTasksResource(Resource):
571
745
  type: string
572
746
  format: uuid
573
747
  description: List of shot IDs to create tasks for
748
+ example: ["b24a6ea4-ce75-4665-a070-57453082c25"]
574
749
  responses:
575
750
  201:
576
- description: New task for given shot and task type created
751
+ description: Tasks created for shots
577
752
  content:
578
753
  application/json:
579
754
  schema:
580
755
  type: array
581
756
  items:
582
757
  type: object
758
+ properties:
759
+ id:
760
+ type: string
761
+ format: uuid
762
+ example: a24a6ea4-ce75-4665-a070-57453082c25
763
+ name:
764
+ type: string
765
+ example: SH010 Animation
766
+ task_type_id:
767
+ type: string
768
+ format: uuid
769
+ example: b24a6ea4-ce75-4665-a070-57453082c25
770
+ task_status_id:
771
+ type: string
772
+ format: uuid
773
+ example: c24a6ea4-ce75-4665-a070-57453082c25
774
+ entity_id:
775
+ type: string
776
+ format: uuid
777
+ example: d24a6ea4-ce75-4665-a070-57453082c25
778
+ project_id:
779
+ type: string
780
+ format: uuid
781
+ example: e24a6ea4-ce75-4665-a070-57453082c25
583
782
  400:
584
783
  description: Bad request
585
- 404:
586
- description: Project or task type not found
587
784
  """
588
785
  user_service.check_manager_project_access(project_id)
589
786
  task_type = tasks_service.get_task_type(task_type_id)
@@ -606,45 +803,77 @@ class CreateShotTasksResource(Resource):
606
803
 
607
804
 
608
805
  class CreateConceptTasksResource(Resource):
609
- """
610
- Create a new task for given concept and task type.
611
- """
612
806
 
613
807
  @jwt_required()
614
808
  def post(self, project_id, task_type_id):
615
809
  """
616
- Create a new task for given concept and task type.
810
+ Create concept tasks
617
811
  ---
618
812
  tags:
619
813
  - Tasks
814
+ description: Create tasks for concepts. Provide a list of concept IDs in
815
+ the JSON body, or omit for all concepts in the project.
620
816
  parameters:
621
817
  - in: path
622
818
  name: project_id
623
819
  required: true
624
820
  schema:
625
821
  type: string
626
- format: uuid
822
+ format: uuid
627
823
  example: a24a6ea4-ce75-4665-a070-57453082c25
628
824
  - in: path
629
825
  name: task_type_id
630
826
  required: true
631
827
  schema:
632
828
  type: string
633
- format: uuid
829
+ format: uuid
634
830
  example: a24a6ea4-ce75-4665-a070-57453082c25
831
+ requestBody:
832
+ required: true
833
+ content:
834
+ application/json:
835
+ schema:
836
+ type: array
837
+ items:
838
+ type: string
839
+ format: uuid
840
+ description: List of concept IDs to create tasks for
841
+ example: ["b24a6ea4-ce75-4665-a070-57453082c25"]
635
842
  responses:
636
843
  201:
637
- description: New task for given concept and task type created
844
+ description: Tasks created for concepts
638
845
  content:
639
846
  application/json:
640
847
  schema:
641
848
  type: array
642
849
  items:
643
850
  type: object
851
+ properties:
852
+ id:
853
+ type: string
854
+ format: uuid
855
+ example: a24a6ea4-ce75-4665-a070-57453082c25
856
+ name:
857
+ type: string
858
+ example: Concept Modeling
859
+ task_type_id:
860
+ type: string
861
+ format: uuid
862
+ example: b24a6ea4-ce75-4665-a070-57453082c25
863
+ task_status_id:
864
+ type: string
865
+ format: uuid
866
+ example: c24a6ea4-ce75-4665-a070-57453082c25
867
+ entity_id:
868
+ type: string
869
+ format: uuid
870
+ example: d24a6ea4-ce75-4665-a070-57453082c25
871
+ project_id:
872
+ type: string
873
+ format: uuid
874
+ example: e24a6ea4-ce75-4665-a070-57453082c25
644
875
  400:
645
876
  description: Bad request
646
- 404:
647
- description: Project or task type not found
648
877
  """
649
878
  user_service.check_project_access(project_id)
650
879
  if (
@@ -675,49 +904,84 @@ class CreateConceptTasksResource(Resource):
675
904
 
676
905
 
677
906
  class CreateEntityTasksResource(Resource):
907
+
678
908
  @jwt_required()
679
909
  def post(self, project_id, entity_type, task_type_id):
680
910
  """
681
- Create a new task with given task type for each entity of given
682
- entity type.
911
+ Create entity tasks
683
912
  ---
684
913
  tags:
685
914
  - Tasks
915
+ description: Create tasks for entities of a given type. Provide entity
916
+ IDs in the JSON body, or omit for all entities in the project.
686
917
  parameters:
687
918
  - in: path
688
919
  name: project_id
689
920
  required: true
690
921
  schema:
691
922
  type: string
692
- format: uuid
923
+ format: uuid
693
924
  example: a24a6ea4-ce75-4665-a070-57453082c25
694
925
  - in: path
695
- name: task_type_id
926
+ name: entity_type
696
927
  required: true
697
928
  schema:
698
929
  type: string
699
- format: uuid
700
- example: a24a6ea4-ce75-4665-a070-57453082c25
930
+ example: Asset
931
+ description: Entity type name (Asset, Sequence, etc.)
701
932
  - in: path
702
933
  name: task_type_id
703
934
  required: true
704
935
  schema:
705
936
  type: string
706
- format: uuid
937
+ format: uuid
707
938
  example: a24a6ea4-ce75-4665-a070-57453082c25
939
+ requestBody:
940
+ required: true
941
+ content:
942
+ application/json:
943
+ schema:
944
+ type: array
945
+ items:
946
+ type: string
947
+ format: uuid
948
+ description: List of entity IDs to create tasks for
949
+ example: ["b24a6ea4-ce75-4665-a070-57453082c25"]
708
950
  responses:
709
951
  201:
710
- description: List of created tasks
952
+ description: Tasks created for entities
711
953
  content:
712
954
  application/json:
713
955
  schema:
714
956
  type: array
715
957
  items:
716
958
  type: object
959
+ properties:
960
+ id:
961
+ type: string
962
+ format: uuid
963
+ example: a24a6ea4-ce75-4665-a070-57453082c25
964
+ name:
965
+ type: string
966
+ example: Entity Task Name
967
+ task_type_id:
968
+ type: string
969
+ format: uuid
970
+ example: b24a6ea4-ce75-4665-a070-57453082c25
971
+ task_status_id:
972
+ type: string
973
+ format: uuid
974
+ example: c24a6ea4-ce75-4665-a070-57453082c25
975
+ entity_id:
976
+ type: string
977
+ format: uuid
978
+ example: d24a6ea4-ce75-4665-a070-57453082c25
979
+ project_id:
980
+ type: string
981
+ format: uuid
982
+ example: e24a6ea4-ce75-4665-a070-57453082c25
717
983
  400:
718
984
  description: Bad request
719
- 404:
720
- description: Project, entity type, or task type not found
721
985
  """
722
986
  user_service.check_manager_project_access(project_id)
723
987
  task_type = tasks_service.get_task_type(task_type_id)
@@ -746,45 +1010,77 @@ class CreateEntityTasksResource(Resource):
746
1010
 
747
1011
 
748
1012
  class CreateAssetTasksResource(Resource):
749
- """
750
- Create a new task for given asset and task type.
751
- """
752
1013
 
753
1014
  @jwt_required()
754
1015
  def post(self, project_id, task_type_id):
755
1016
  """
756
- Create a new task for given asset and task type.
1017
+ Create asset tasks
757
1018
  ---
758
1019
  tags:
759
1020
  - Tasks
1021
+ description: Create tasks for assets. Provide a list of asset IDs in
1022
+ the JSON body, or omit for all assets in the project.
760
1023
  parameters:
761
1024
  - in: path
762
1025
  name: project_id
763
1026
  required: true
764
1027
  schema:
765
1028
  type: string
766
- format: uuid
1029
+ format: uuid
767
1030
  example: a24a6ea4-ce75-4665-a070-57453082c25
768
1031
  - in: path
769
1032
  name: task_type_id
770
1033
  required: true
771
1034
  schema:
772
1035
  type: string
773
- format: uuid
1036
+ format: uuid
774
1037
  example: a24a6ea4-ce75-4665-a070-57453082c25
1038
+ requestBody:
1039
+ required: true
1040
+ content:
1041
+ application/json:
1042
+ schema:
1043
+ type: array
1044
+ items:
1045
+ type: string
1046
+ format: uuid
1047
+ description: List of asset IDs to create tasks for
1048
+ example: ["b24a6ea4-ce75-4665-a070-57453082c25"]
775
1049
  responses:
776
1050
  201:
777
- description: New task for given asset and task type created
1051
+ description: Tasks created for assets
778
1052
  content:
779
1053
  application/json:
780
1054
  schema:
781
1055
  type: array
782
1056
  items:
783
1057
  type: object
1058
+ properties:
1059
+ id:
1060
+ type: string
1061
+ format: uuid
1062
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1063
+ name:
1064
+ type: string
1065
+ example: Asset Modeling
1066
+ task_type_id:
1067
+ type: string
1068
+ format: uuid
1069
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1070
+ task_status_id:
1071
+ type: string
1072
+ format: uuid
1073
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1074
+ entity_id:
1075
+ type: string
1076
+ format: uuid
1077
+ example: d24a6ea4-ce75-4665-a070-57453082c25
1078
+ project_id:
1079
+ type: string
1080
+ format: uuid
1081
+ example: e24a6ea4-ce75-4665-a070-57453082c25
784
1082
  400:
785
1083
  description: Bad request
786
- 404:
787
- description: Project or task type not found
788
1084
  """
789
1085
  user_service.check_manager_project_access(project_id)
790
1086
  task_type = tasks_service.get_task_type(task_type_id)
@@ -806,45 +1102,77 @@ class CreateAssetTasksResource(Resource):
806
1102
 
807
1103
 
808
1104
  class CreateEditTasksResource(Resource):
809
- """
810
- Create a new task for given edit and task type.
811
- """
812
1105
 
813
1106
  @jwt_required()
814
1107
  def post(self, project_id, task_type_id):
815
1108
  """
816
- Create a new task for given edit and task type.
1109
+ Create edit tasks
817
1110
  ---
818
1111
  tags:
819
1112
  - Tasks
1113
+ description: Create tasks for edits. Provide a list of edit IDs in
1114
+ the JSON body, or omit for all edits in the project.
820
1115
  parameters:
821
1116
  - in: path
822
1117
  name: project_id
823
1118
  required: true
824
1119
  schema:
825
1120
  type: string
826
- format: uuid
1121
+ format: uuid
827
1122
  example: a24a6ea4-ce75-4665-a070-57453082c25
828
1123
  - in: path
829
1124
  name: task_type_id
830
1125
  required: true
831
1126
  schema:
832
1127
  type: string
833
- format: uuid
1128
+ format: uuid
834
1129
  example: a24a6ea4-ce75-4665-a070-57453082c25
1130
+ requestBody:
1131
+ required: true
1132
+ content:
1133
+ application/json:
1134
+ schema:
1135
+ type: array
1136
+ items:
1137
+ type: string
1138
+ format: uuid
1139
+ description: List of edit IDs to create tasks for
1140
+ example: ["b24a6ea4-ce75-4665-a070-57453082c25"]
835
1141
  responses:
836
1142
  201:
837
- description: New task for given edit and task type created
1143
+ description: Tasks created for edits
838
1144
  content:
839
1145
  application/json:
840
1146
  schema:
841
1147
  type: array
842
1148
  items:
843
1149
  type: object
1150
+ properties:
1151
+ id:
1152
+ type: string
1153
+ format: uuid
1154
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1155
+ name:
1156
+ type: string
1157
+ example: Edit Compositing
1158
+ task_type_id:
1159
+ type: string
1160
+ format: uuid
1161
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1162
+ task_status_id:
1163
+ type: string
1164
+ format: uuid
1165
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1166
+ entity_id:
1167
+ type: string
1168
+ format: uuid
1169
+ example: d24a6ea4-ce75-4665-a070-57453082c25
1170
+ project_id:
1171
+ type: string
1172
+ format: uuid
1173
+ example: e24a6ea4-ce75-4665-a070-57453082c25
844
1174
  400:
845
- description: Bad request
846
- 404:
847
- description: Project or task type not found
1175
+ description: Wrong criterions format
848
1176
  """
849
1177
  user_service.check_manager_project_access(project_id)
850
1178
  task_type = tasks_service.get_task_type(task_type_id)
@@ -866,50 +1194,86 @@ class CreateEditTasksResource(Resource):
866
1194
 
867
1195
 
868
1196
  class ToReviewResource(Resource, ArgsMixin):
869
- """
870
- Change a task status to "to review". It creates a new preview file entry
871
- and set path from the hard disk.
872
- """
873
1197
 
874
1198
  @jwt_required()
875
1199
  def put(self, task_id):
876
1200
  """
877
- Change a task status to "to review".
1201
+ Set task to review
878
1202
  ---
879
1203
  tags:
880
1204
  - Tasks
881
- description: It creates a new preview file entry and set path from the hard disk.
1205
+ description: Create a new preview file entry and set the path from the
1206
+ disk. Optionally change the task status.
882
1207
  parameters:
883
1208
  - in: path
884
1209
  name: task_id
885
1210
  required: true
886
1211
  schema:
887
1212
  type: string
888
- format: uuid
1213
+ format: uuid
889
1214
  example: a24a6ea4-ce75-4665-a070-57453082c25
890
- - in: body
891
- name: Task
892
- description: person ID, name, comment, revision and change status of task
893
- schema:
1215
+ requestBody:
1216
+ required: true
1217
+ content:
1218
+ application/json:
1219
+ schema:
894
1220
  type: object
895
1221
  properties:
896
- person_id:
897
- type: string
898
- format: uuid
899
- example: a24a6ea4-ce75-4665-a070-57453082c25
900
- comment:
901
- type: string
902
- name:
903
- type: string
904
- revision:
905
- type: integer
906
- change_status:
907
- type: boolean
1222
+ person_id:
1223
+ type: string
1224
+ format: uuid
1225
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1226
+ comment:
1227
+ type: string
1228
+ example: Please check this version
1229
+ name:
1230
+ type: string
1231
+ example: main
1232
+ revision:
1233
+ type: integer
1234
+ example: 1
1235
+ change_status:
1236
+ type: boolean
1237
+ example: true
908
1238
  responses:
909
1239
  200:
910
- description: Task status changed to "to review"
1240
+ description: Task set to review and preview created
1241
+ content:
1242
+ application/json:
1243
+ schema:
1244
+ type: object
1245
+ properties:
1246
+ id:
1247
+ type: string
1248
+ format: uuid
1249
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1250
+ name:
1251
+ type: string
1252
+ example: SH010 Animation
1253
+ task_type_id:
1254
+ type: string
1255
+ format: uuid
1256
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1257
+ task_status_id:
1258
+ type: string
1259
+ format: uuid
1260
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1261
+ entity_id:
1262
+ type: string
1263
+ format: uuid
1264
+ example: d24a6ea4-ce75-4665-a070-57453082c25
1265
+ project_id:
1266
+ type: string
1267
+ format: uuid
1268
+ example: e24a6ea4-ce75-4665-a070-57453082c25
1269
+ assignees:
1270
+ type: array
1271
+ items:
1272
+ type: string
1273
+ format: uuid
1274
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
911
1275
  400:
912
- description: Given person not found
1276
+ description: Invalid person or parameters
913
1277
  """
914
1278
  (
915
1279
  person_id,
@@ -977,37 +1341,47 @@ class ToReviewResource(Resource, ArgsMixin):
977
1341
 
978
1342
 
979
1343
  class ClearAssignationResource(Resource, ArgsMixin):
980
- """
981
- Remove all assignations set to given task.
982
- """
983
1344
 
984
1345
  @jwt_required()
985
1346
  def put(self):
986
1347
  """
987
- Remove all assignations set to given task.
1348
+ Clear task assignations
988
1349
  ---
989
1350
  tags:
990
1351
  - Tasks
991
- parameters:
992
- - in: body
993
- name: Task
994
- description: List of tasks ID and person ID
995
- schema:
1352
+ requestBody:
1353
+ required: true
1354
+ content:
1355
+ application/json:
1356
+ schema:
996
1357
  type: object
997
1358
  required:
998
1359
  - task_ids
999
1360
  properties:
1000
- task_ids:
1001
- type: string
1002
- format: uuid
1003
- example: a24a6ea4-ce75-4665-a070-57453082c25
1004
- person_id:
1005
- type: string
1006
- format: uuid
1007
- example: a24a6ea4-ce75-4665-a070-57453082c25
1361
+ task_ids:
1362
+ type: array
1363
+ items:
1364
+ type: string
1365
+ format: uuid
1366
+ example: [
1367
+ "a24a6ea4-ce75-4665-a070-57453082c25",
1368
+ "b24a6ea4-ce75-4665-a070-57453082c25"
1369
+ ]
1370
+ person_id:
1371
+ type: string
1372
+ format: uuid
1373
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1008
1374
  responses:
1009
1375
  200:
1010
- description: All assignations removed
1376
+ description: Assignations removed
1377
+ content:
1378
+ application/json:
1379
+ schema:
1380
+ type: array
1381
+ items:
1382
+ type: string
1383
+ format: uuid
1384
+ example: ["a24a6ea4-ce75-4665-a070-57453082c25"]
1011
1385
  """
1012
1386
  (task_ids, person_id) = self.get_arguments()
1013
1387
 
@@ -1043,19 +1417,16 @@ class ClearAssignationResource(Resource, ArgsMixin):
1043
1417
 
1044
1418
 
1045
1419
  class TasksAssignResource(Resource, ArgsMixin):
1046
- """
1047
- Assign given task lists to given person. If a given task ID is wrong,
1048
- it ignores it.
1049
- """
1050
1420
 
1051
1421
  @jwt_required()
1052
1422
  def put(self, person_id):
1053
1423
  """
1054
- Assign given task lists to given person.
1424
+ Assign tasks to person
1055
1425
  ---
1056
1426
  tags:
1057
1427
  - Tasks
1058
- description: If a given task ID is wrong, it ignores it.
1428
+ description: Assign a list of tasks to a person. Unknown task ids are
1429
+ ignored.
1059
1430
  parameters:
1060
1431
  - in: path
1061
1432
  name: person_id
@@ -1064,21 +1435,65 @@ class TasksAssignResource(Resource, ArgsMixin):
1064
1435
  type: string
1065
1436
  format: uuid
1066
1437
  example: a24a6ea4-ce75-4665-a070-57453082c25
1067
- - in: body
1068
- name: Task
1069
- description: List of tasks ID
1070
- schema:
1438
+ requestBody:
1439
+ required: true
1440
+ content:
1441
+ application/json:
1442
+ schema:
1071
1443
  type: object
1072
1444
  required:
1073
1445
  - task_ids
1074
1446
  properties:
1075
- task_ids:
1076
- type: string
1077
- format: uuid
1078
- example: a24a6ea4-ce75-4665-a070-57453082c25
1447
+ task_ids:
1448
+ type: array
1449
+ items:
1450
+ type: string
1451
+ format: uuid
1452
+ example: [
1453
+ "a24a6ea4-ce75-4665-a070-57453082c25",
1454
+ "b24a6ea4-ce75-4665-a070-57453082c25"
1455
+ ]
1079
1456
  responses:
1080
1457
  200:
1081
- description: Given tasks lists assigned to given person
1458
+ description: Tasks assigned to person
1459
+ content:
1460
+ application/json:
1461
+ schema:
1462
+ type: array
1463
+ items:
1464
+ type: object
1465
+ properties:
1466
+ id:
1467
+ type: string
1468
+ format: uuid
1469
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1470
+ name:
1471
+ type: string
1472
+ example: SH010 Animation
1473
+ task_type_id:
1474
+ type: string
1475
+ format: uuid
1476
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1477
+ task_status_id:
1478
+ type: string
1479
+ format: uuid
1480
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1481
+ entity_id:
1482
+ type: string
1483
+ format: uuid
1484
+ example: d24a6ea4-ce75-4665-a070-57453082c25
1485
+ project_id:
1486
+ type: string
1487
+ format: uuid
1488
+ example: e24a6ea4-ce75-4665-a070-57453082c25
1489
+ assignees:
1490
+ type: array
1491
+ items:
1492
+ type: string
1493
+ format: uuid
1494
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
1495
+ 400:
1496
+ description: Assignee does not exist
1082
1497
  """
1083
1498
  args = self.get_args(
1084
1499
  [
@@ -1117,14 +1532,11 @@ class TasksAssignResource(Resource, ArgsMixin):
1117
1532
 
1118
1533
 
1119
1534
  class TaskAssignResource(Resource, ArgsMixin):
1120
- """
1121
- Assign given task to given person.
1122
- """
1123
1535
 
1124
1536
  @jwt_required()
1125
1537
  def put(self, task_id):
1126
1538
  """
1127
- Assign given task list to given person.
1539
+ Assign task to person
1128
1540
  ---
1129
1541
  tags:
1130
1542
  - Tasks
@@ -1134,25 +1546,60 @@ class TaskAssignResource(Resource, ArgsMixin):
1134
1546
  required: true
1135
1547
  schema:
1136
1548
  type: string
1137
- format: uuid
1549
+ format: uuid
1138
1550
  example: a24a6ea4-ce75-4665-a070-57453082c25
1139
- - in: body
1140
- name: Person
1141
- description: Person ID
1142
- schema:
1551
+ requestBody:
1552
+ required: true
1553
+ content:
1554
+ application/json:
1555
+ schema:
1143
1556
  type: object
1144
1557
  required:
1145
1558
  - person_id
1146
1559
  properties:
1147
- person_id:
1148
- type: string
1149
- format: uuid
1150
- example: a24a6ea4-ce75-4665-a070-57453082c25
1560
+ person_id:
1561
+ type: string
1562
+ format: uuid
1563
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1151
1564
  responses:
1152
1565
  200:
1153
- description: Given task assigned to given person
1566
+ description: Task assigned to person
1567
+ content:
1568
+ application/json:
1569
+ schema:
1570
+ type: object
1571
+ properties:
1572
+ id:
1573
+ type: string
1574
+ format: uuid
1575
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1576
+ name:
1577
+ type: string
1578
+ example: SH010 Animation
1579
+ task_type_id:
1580
+ type: string
1581
+ format: uuid
1582
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1583
+ task_status_id:
1584
+ type: string
1585
+ format: uuid
1586
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1587
+ entity_id:
1588
+ type: string
1589
+ format: uuid
1590
+ example: d24a6ea4-ce75-4665-a070-57453082c25
1591
+ project_id:
1592
+ type: string
1593
+ format: uuid
1594
+ example: e24a6ea4-ce75-4665-a070-57453082c25
1595
+ assignees:
1596
+ type: array
1597
+ items:
1598
+ type: string
1599
+ format: uuid
1600
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
1154
1601
  400:
1155
- description: Assignee non-existent in database
1602
+ description: Assignee does not exist
1156
1603
  """
1157
1604
  args = self.get_args(
1158
1605
  [
@@ -1182,17 +1629,14 @@ class TaskAssignResource(Resource, ArgsMixin):
1182
1629
 
1183
1630
 
1184
1631
  class TaskFullResource(Resource):
1185
- """
1186
- Return a task with many information: full details for assignees, full
1187
- details for task type, full details for task status, etc.
1188
- """
1189
1632
 
1190
1633
  @jwt_required()
1191
1634
  def get(self, task_id):
1192
1635
  """
1193
- Return a task with many information.
1636
+ Get task full
1194
1637
  ---
1195
- description: Full details for assignees, full details for task type, full details for task status, etc.
1638
+ description: Return a task with many information. Includes full details
1639
+ for assignees, task type, and task status.
1196
1640
  tags:
1197
1641
  - Tasks
1198
1642
  parameters:
@@ -1205,7 +1649,70 @@ class TaskFullResource(Resource):
1205
1649
  example: a24a6ea4-ce75-4665-a070-57453082c25
1206
1650
  responses:
1207
1651
  200:
1208
- description: Task with many information
1652
+ description: Task with full information
1653
+ content:
1654
+ application/json:
1655
+ schema:
1656
+ type: object
1657
+ properties:
1658
+ id:
1659
+ type: string
1660
+ format: uuid
1661
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1662
+ name:
1663
+ type: string
1664
+ example: SH010 Animation
1665
+ task_type_id:
1666
+ type: string
1667
+ format: uuid
1668
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1669
+ task_status_id:
1670
+ type: string
1671
+ format: uuid
1672
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1673
+ entity_id:
1674
+ type: string
1675
+ format: uuid
1676
+ example: d24a6ea4-ce75-4665-a070-57453082c25
1677
+ project_id:
1678
+ type: string
1679
+ format: uuid
1680
+ example: e24a6ea4-ce75-4665-a070-57453082c25
1681
+ assignees:
1682
+ type: array
1683
+ items:
1684
+ type: object
1685
+ properties:
1686
+ id:
1687
+ type: string
1688
+ format: uuid
1689
+ example: f24a6ea4-ce75-4665-a070-57453082c25
1690
+ first_name:
1691
+ type: string
1692
+ example: John
1693
+ last_name:
1694
+ type: string
1695
+ example: Doe
1696
+ task_type:
1697
+ type: object
1698
+ properties:
1699
+ id:
1700
+ type: string
1701
+ format: uuid
1702
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1703
+ name:
1704
+ type: string
1705
+ example: Animation
1706
+ task_status:
1707
+ type: object
1708
+ properties:
1709
+ id:
1710
+ type: string
1711
+ format: uuid
1712
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1713
+ name:
1714
+ type: string
1715
+ example: In Progress
1209
1716
  """
1210
1717
  task = tasks_service.get_full_task(
1211
1718
  task_id, persons_service.get_current_user()["id"]
@@ -1216,18 +1723,16 @@ class TaskFullResource(Resource):
1216
1723
 
1217
1724
 
1218
1725
  class TaskForEntityResource(Resource):
1219
- """
1220
- Return tasks related to given entity asset, episode, sequence, shot or
1221
- scene.
1222
- """
1223
1726
 
1224
1727
  @jwt_required()
1225
1728
  def get(self, entity_id, task_type_id):
1226
1729
  """
1227
- Return tasks related to given entity asset, episode, sequence, shot or scene.
1730
+ Get tasks for entity and type
1228
1731
  ---
1229
1732
  tags:
1230
1733
  - Tasks
1734
+ description: Return tasks related to the entity (asset, episode,
1735
+ sequence, shot, or scene) for a task type.
1231
1736
  parameters:
1232
1737
  - in: path
1233
1738
  name: entity_id
@@ -1245,7 +1750,43 @@ class TaskForEntityResource(Resource):
1245
1750
  example: a24a6ea4-ce75-4665-a070-57453082c25
1246
1751
  responses:
1247
1752
  200:
1248
- description: Tasks related to given entity asset, episode, sequence, shot or scene
1753
+ description: Tasks related to the entity and task type
1754
+ content:
1755
+ application/json:
1756
+ schema:
1757
+ type: array
1758
+ items:
1759
+ type: object
1760
+ properties:
1761
+ id:
1762
+ type: string
1763
+ format: uuid
1764
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1765
+ name:
1766
+ type: string
1767
+ example: SH010 Animation
1768
+ task_type_id:
1769
+ type: string
1770
+ format: uuid
1771
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1772
+ task_status_id:
1773
+ type: string
1774
+ format: uuid
1775
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1776
+ entity_id:
1777
+ type: string
1778
+ format: uuid
1779
+ example: d24a6ea4-ce75-4665-a070-57453082c25
1780
+ project_id:
1781
+ type: string
1782
+ format: uuid
1783
+ example: e24a6ea4-ce75-4665-a070-57453082c25
1784
+ assignees:
1785
+ type: array
1786
+ items:
1787
+ type: string
1788
+ format: uuid
1789
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
1249
1790
  """
1250
1791
  entity = entities_service.get_entity(entity_id)
1251
1792
  user_service.check_project_access(entity["project_id"])
@@ -1255,14 +1796,11 @@ class TaskForEntityResource(Resource):
1255
1796
 
1256
1797
 
1257
1798
  class SetTimeSpentResource(Resource, ArgsMixin):
1258
- """
1259
- Set time spent by a person on a task for a given day.
1260
- """
1261
1799
 
1262
1800
  @jwt_required()
1263
1801
  def post(self, task_id, date, person_id):
1264
1802
  """
1265
- Set time spent by a person on a task for a given day.
1803
+ Set time spent
1266
1804
  ---
1267
1805
  tags:
1268
1806
  - Tasks
@@ -1272,34 +1810,65 @@ class SetTimeSpentResource(Resource, ArgsMixin):
1272
1810
  required: true
1273
1811
  schema:
1274
1812
  type: string
1275
- format: uuid
1813
+ format: uuid
1276
1814
  example: a24a6ea4-ce75-4665-a070-57453082c25
1277
1815
  - in: path
1278
1816
  name: date
1279
1817
  required: true
1280
1818
  schema:
1281
1819
  type: string
1282
- format: date
1820
+ format: date
1283
1821
  example: "2022-07-12"
1284
1822
  - in: path
1285
1823
  name: person_id
1286
1824
  required: true
1287
1825
  schema:
1288
1826
  type: string
1289
- format: uuid
1827
+ format: uuid
1290
1828
  example: a24a6ea4-ce75-4665-a070-57453082c25
1291
- - in: body
1292
- name: Duration
1293
- schema:
1829
+ requestBody:
1830
+ required: true
1831
+ content:
1832
+ application/json:
1833
+ schema:
1294
1834
  type: object
1295
1835
  properties:
1296
- duration:
1297
- type: float
1836
+ duration:
1837
+ type: number
1838
+ example: 120
1298
1839
  responses:
1299
1840
  201:
1300
- description: Time spent by given person on given task for given day is set
1301
- 404:
1302
- description: Wrong date format
1841
+ description: Time spent set for the person on the task and day
1842
+ content:
1843
+ application/json:
1844
+ schema:
1845
+ type: object
1846
+ properties:
1847
+ id:
1848
+ type: string
1849
+ format: uuid
1850
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1851
+ task_id:
1852
+ type: string
1853
+ format: uuid
1854
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1855
+ person_id:
1856
+ type: string
1857
+ format: uuid
1858
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1859
+ date:
1860
+ type: string
1861
+ format: date
1862
+ example: "2022-07-12"
1863
+ duration:
1864
+ type: number
1865
+ example: 120
1866
+ created_at:
1867
+ type: string
1868
+ format: date-time
1869
+ example: "2024-01-15T10:30:00Z"
1870
+ 400:
1871
+ description: Invalid parameters
1303
1872
  """
1304
1873
  user_service.check_person_is_not_bot(person_id)
1305
1874
  args = self.get_args([("duration", 0, True, int)])
@@ -1322,7 +1891,7 @@ class SetTimeSpentResource(Resource, ArgsMixin):
1322
1891
  @jwt_required()
1323
1892
  def delete(self, task_id, date, person_id):
1324
1893
  """
1325
- Delete time spent by a person on a task for a given day.
1894
+ Delete time spent
1326
1895
  ---
1327
1896
  tags:
1328
1897
  - Tasks
@@ -1332,27 +1901,55 @@ class SetTimeSpentResource(Resource, ArgsMixin):
1332
1901
  required: true
1333
1902
  schema:
1334
1903
  type: string
1335
- format: uuid
1904
+ format: uuid
1336
1905
  example: a24a6ea4-ce75-4665-a070-57453082c25
1337
1906
  - in: path
1338
1907
  name: date
1339
1908
  required: true
1340
1909
  schema:
1341
1910
  type: string
1342
- format: date
1911
+ format: date
1343
1912
  example: "2022-07-12"
1344
1913
  - in: path
1345
1914
  name: person_id
1346
1915
  required: true
1347
1916
  schema:
1348
1917
  type: string
1349
- format: uuid
1918
+ format: uuid
1350
1919
  example: a24a6ea4-ce75-4665-a070-57453082c25
1351
1920
  responses:
1352
1921
  201:
1353
- description: Time spent by given person on given task for given day is removed
1354
- 404:
1355
- description: Wrong date format
1922
+ description: Time spent removed for the person on the task
1923
+ content:
1924
+ application/json:
1925
+ schema:
1926
+ type: object
1927
+ properties:
1928
+ id:
1929
+ type: string
1930
+ format: uuid
1931
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1932
+ task_id:
1933
+ type: string
1934
+ format: uuid
1935
+ example: b24a6ea4-ce75-4665-a070-57453082c25
1936
+ person_id:
1937
+ type: string
1938
+ format: uuid
1939
+ example: c24a6ea4-ce75-4665-a070-57453082c25
1940
+ date:
1941
+ type: string
1942
+ format: date
1943
+ example: "2022-07-12"
1944
+ duration:
1945
+ type: number
1946
+ example: 0
1947
+ created_at:
1948
+ type: string
1949
+ format: date-time
1950
+ example: "2024-01-15T10:30:00Z"
1951
+ 400:
1952
+ description: Invalid parameters
1356
1953
  """
1357
1954
  user_service.check_person_is_not_bot(person_id)
1358
1955
  try:
@@ -1370,14 +1967,11 @@ class SetTimeSpentResource(Resource, ArgsMixin):
1370
1967
 
1371
1968
 
1372
1969
  class AddTimeSpentResource(Resource, ArgsMixin):
1373
- """
1374
- Add given timeframe to time spent by a person on a task for a given day.
1375
- """
1376
1970
 
1377
1971
  @jwt_required()
1378
1972
  def post(self, task_id, date, person_id):
1379
1973
  """
1380
- Add given timeframe to time spent by a person on a task for a given day.
1974
+ Add time spent
1381
1975
  ---
1382
1976
  tags:
1383
1977
  - Tasks
@@ -1387,34 +1981,65 @@ class AddTimeSpentResource(Resource, ArgsMixin):
1387
1981
  required: true
1388
1982
  schema:
1389
1983
  type: string
1390
- format: uuid
1984
+ format: uuid
1391
1985
  example: a24a6ea4-ce75-4665-a070-57453082c25
1392
1986
  - in: path
1393
1987
  name: date
1394
1988
  required: true
1395
1989
  schema:
1396
1990
  type: string
1397
- format: date
1991
+ format: date
1398
1992
  example: "2022-07-12"
1399
1993
  - in: path
1400
1994
  name: person_id
1401
1995
  required: true
1402
1996
  schema:
1403
1997
  type: string
1404
- format: uuid
1998
+ format: uuid
1405
1999
  example: a24a6ea4-ce75-4665-a070-57453082c25
1406
- - in: body
1407
- name: Duration
1408
- schema:
2000
+ requestBody:
2001
+ required: true
2002
+ content:
2003
+ application/json:
2004
+ schema:
1409
2005
  type: object
1410
2006
  properties:
1411
- duration:
1412
- type: float
2007
+ duration:
2008
+ type: number
2009
+ example: 30
1413
2010
  responses:
1414
2011
  201:
1415
- description: Given timeframe added to time spent by given person on given task for given day
1416
- 404:
1417
- description: Wrong date format
2012
+ description: Timeframe added to time spent
2013
+ content:
2014
+ application/json:
2015
+ schema:
2016
+ type: object
2017
+ properties:
2018
+ id:
2019
+ type: string
2020
+ format: uuid
2021
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2022
+ task_id:
2023
+ type: string
2024
+ format: uuid
2025
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2026
+ person_id:
2027
+ type: string
2028
+ format: uuid
2029
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2030
+ date:
2031
+ type: string
2032
+ format: date
2033
+ example: "2022-07-12"
2034
+ duration:
2035
+ type: number
2036
+ example: 150
2037
+ created_at:
2038
+ type: string
2039
+ format: date-time
2040
+ example: "2024-01-15T10:30:00Z"
2041
+ 400:
2042
+ description: Invalid parameters
1418
2043
  """
1419
2044
  user_service.check_person_is_not_bot(person_id)
1420
2045
  args = self.get_args([("duration", 0, True, int)])
@@ -1433,14 +2058,11 @@ class AddTimeSpentResource(Resource, ArgsMixin):
1433
2058
 
1434
2059
 
1435
2060
  class GetTimeSpentResource(Resource):
1436
- """
1437
- Get time spent on a given task.
1438
- """
1439
2061
 
1440
2062
  @jwt_required()
1441
2063
  def get(self, task_id):
1442
2064
  """
1443
- Get time spent on a given task.
2065
+ Get task time spent
1444
2066
  ---
1445
2067
  tags:
1446
2068
  - Tasks
@@ -1454,23 +2076,48 @@ class GetTimeSpentResource(Resource):
1454
2076
  example: a24a6ea4-ce75-4665-a070-57453082c25
1455
2077
  responses:
1456
2078
  200:
1457
- description: Time spent on given task
1458
- 404:
1459
- description: Wrong date format
2079
+ description: Time spent on the task
2080
+ content:
2081
+ application/json:
2082
+ schema:
2083
+ type: array
2084
+ items:
2085
+ type: object
2086
+ properties:
2087
+ id:
2088
+ type: string
2089
+ format: uuid
2090
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2091
+ task_id:
2092
+ type: string
2093
+ format: uuid
2094
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2095
+ person_id:
2096
+ type: string
2097
+ format: uuid
2098
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2099
+ date:
2100
+ type: string
2101
+ format: date
2102
+ example: "2022-07-12"
2103
+ duration:
2104
+ type: number
2105
+ example: 120
2106
+ created_at:
2107
+ type: string
2108
+ format: date-time
2109
+ example: "2024-01-15T10:30:00Z"
1460
2110
  """
1461
2111
  user_service.check_task_access(task_id)
1462
2112
  return tasks_service.get_time_spents(task_id)
1463
2113
 
1464
2114
 
1465
2115
  class GetTimeSpentDateResource(Resource):
1466
- """
1467
- Get time spent on a given task and date.
1468
- """
1469
2116
 
1470
2117
  @jwt_required()
1471
2118
  def get(self, task_id, date):
1472
2119
  """
1473
- Get time spent on a given task and date.
2120
+ Get task time spent for date
1474
2121
  ---
1475
2122
  tags:
1476
2123
  - Tasks
@@ -1491,9 +2138,37 @@ class GetTimeSpentDateResource(Resource):
1491
2138
  example: "2022-07-12"
1492
2139
  responses:
1493
2140
  200:
1494
- description: Time spent on given task and date
1495
- 404:
1496
- description: Wrong date format
2141
+ description: Time spent on the task for the date
2142
+ content:
2143
+ application/json:
2144
+ schema:
2145
+ type: array
2146
+ items:
2147
+ type: object
2148
+ properties:
2149
+ id:
2150
+ type: string
2151
+ format: uuid
2152
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2153
+ task_id:
2154
+ type: string
2155
+ format: uuid
2156
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2157
+ person_id:
2158
+ type: string
2159
+ format: uuid
2160
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2161
+ date:
2162
+ type: string
2163
+ format: date
2164
+ example: "2022-07-12"
2165
+ duration:
2166
+ type: number
2167
+ example: 120
2168
+ created_at:
2169
+ type: string
2170
+ format: date-time
2171
+ example: "2024-01-15T10:30:00Z"
1497
2172
  """
1498
2173
  try:
1499
2174
  user_service.check_task_access(task_id)
@@ -1503,19 +2178,16 @@ class GetTimeSpentDateResource(Resource):
1503
2178
 
1504
2179
 
1505
2180
  class DeleteAllTasksForTaskTypeResource(Resource):
1506
- """
1507
- Delete all tasks for a given task type and project. It's mainly used
1508
- when tasks are created by mistake at the beginning of the project.
1509
- """
1510
2181
 
1511
2182
  @jwt_required()
1512
2183
  def delete(self, project_id, task_type_id):
1513
2184
  """
1514
- Delete all tasks for a given task type and project.
2185
+ Delete tasks for type
1515
2186
  ---
1516
2187
  tags:
1517
2188
  - Tasks
1518
- description: It's mainly used when tasks are created by mistake at the beginning of the project.
2189
+ description: Delete all tasks for a task type in a project. Useful when
2190
+ tasks were created by mistake at project start.
1519
2191
  parameters:
1520
2192
  - in: path
1521
2193
  name: project_id
@@ -1546,19 +2218,15 @@ class DeleteAllTasksForTaskTypeResource(Resource):
1546
2218
 
1547
2219
 
1548
2220
  class DeleteTasksResource(Resource):
1549
- """
1550
- Delete tasks matching id list given in parameter. See it as a way to batch
1551
- delete tasks.
1552
- """
1553
2221
 
1554
2222
  @jwt_required()
1555
2223
  def post(self, project_id):
1556
2224
  """
1557
- Delete tasks matching id list given in parameter.
2225
+ Delete tasks batch
1558
2226
  ---
1559
2227
  tags:
1560
2228
  - Tasks
1561
- description: See it as a way to batch delete tasks.
2229
+ description: Delete tasks given by id list. Useful for batch deletions.
1562
2230
  parameters:
1563
2231
  - in: path
1564
2232
  name: project_id
@@ -1570,6 +2238,14 @@ class DeleteTasksResource(Resource):
1570
2238
  responses:
1571
2239
  200:
1572
2240
  description: Tasks matching id list given in parameter deleted
2241
+ content:
2242
+ application/json:
2243
+ schema:
2244
+ type: array
2245
+ items:
2246
+ type: string
2247
+ format: uuid
2248
+ example: ["a24a6ea4-ce75-4665-a070-57453082c25"]
1573
2249
  """
1574
2250
  user_service.check_manager_project_access(project_id)
1575
2251
  task_ids = request.json
@@ -1580,20 +2256,17 @@ class DeleteTasksResource(Resource):
1580
2256
 
1581
2257
 
1582
2258
  class ProjectSubscriptionsResource(Resource):
1583
- """
1584
- Retrieve all subcriptions to tasks related to given project.
1585
- It's mainly used for synchronisation purpose.
1586
- """
1587
2259
 
1588
2260
  @jwt_required()
1589
2261
  @permissions.require_admin
1590
2262
  def get(self, project_id):
1591
2263
  """
1592
- Retrieve all subcriptions to tasks related to given project.
2264
+ Get project subscriptions
1593
2265
  ---
1594
2266
  tags:
1595
2267
  - Tasks
1596
- description: It's mainly used for synchronisation purpose.
2268
+ description: Retrieve all subscriptions to tasks related to a project.
2269
+ Useful for sync.
1597
2270
  parameters:
1598
2271
  - in: path
1599
2272
  name: project_id
@@ -1605,26 +2278,46 @@ class ProjectSubscriptionsResource(Resource):
1605
2278
  responses:
1606
2279
  200:
1607
2280
  description: All subcriptions to tasks related to given project
2281
+ content:
2282
+ application/json:
2283
+ schema:
2284
+ type: array
2285
+ items:
2286
+ type: object
2287
+ properties:
2288
+ id:
2289
+ type: string
2290
+ format: uuid
2291
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2292
+ person_id:
2293
+ type: string
2294
+ format: uuid
2295
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2296
+ task_id:
2297
+ type: string
2298
+ format: uuid
2299
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2300
+ created_at:
2301
+ type: string
2302
+ format: date-time
2303
+ example: "2024-01-15T10:30:00Z"
1608
2304
  """
1609
2305
  projects_service.get_project(project_id)
1610
2306
  return notifications_service.get_subscriptions_for_project(project_id)
1611
2307
 
1612
2308
 
1613
2309
  class ProjectNotificationsResource(Resource, ArgsMixin):
1614
- """
1615
- Retrieve all notifications related to given project.
1616
- It's mainly used for synchronisation purpose.
1617
- """
1618
2310
 
1619
2311
  @jwt_required()
1620
2312
  @permissions.require_admin
1621
2313
  def get(self, project_id):
1622
2314
  """
1623
- Retrieve all notifications to tasks related to given project.
2315
+ Get project notifications
1624
2316
  ---
1625
2317
  tags:
1626
2318
  - Tasks
1627
- description: It's mainly used for synchronisation purpose.
2319
+ description: Retrieve notifications for tasks related to a project.
2320
+ Useful for sync.
1628
2321
  parameters:
1629
2322
  - in: path
1630
2323
  name: project_id
@@ -1636,6 +2329,52 @@ class ProjectNotificationsResource(Resource, ArgsMixin):
1636
2329
  responses:
1637
2330
  200:
1638
2331
  description: All notifications to tasks related to given project
2332
+ content:
2333
+ application/json:
2334
+ schema:
2335
+ type: object
2336
+ properties:
2337
+ data:
2338
+ type: array
2339
+ items:
2340
+ type: object
2341
+ properties:
2342
+ id:
2343
+ type: string
2344
+ format: uuid
2345
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2346
+ person_id:
2347
+ type: string
2348
+ format: uuid
2349
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2350
+ task_id:
2351
+ type: string
2352
+ format: uuid
2353
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2354
+ comment_id:
2355
+ type: string
2356
+ format: uuid
2357
+ example: d24a6ea4-ce75-4665-a070-57453082c25
2358
+ notification_type:
2359
+ type: string
2360
+ example: assignment
2361
+ created_at:
2362
+ type: string
2363
+ format: date-time
2364
+ example: "2024-01-15T10:30:00Z"
2365
+ updated_at:
2366
+ type: string
2367
+ format: date-time
2368
+ example: "2024-01-15T11:00:00Z"
2369
+ limit:
2370
+ type: integer
2371
+ example: 100
2372
+ page:
2373
+ type: integer
2374
+ example: 1
2375
+ is_more:
2376
+ type: boolean
2377
+ example: true
1639
2378
  """
1640
2379
  projects_service.get_project(project_id)
1641
2380
  page = self.get_page()
@@ -1645,19 +2384,15 @@ class ProjectNotificationsResource(Resource, ArgsMixin):
1645
2384
 
1646
2385
 
1647
2386
  class ProjectTasksResource(Resource, ArgsMixin):
1648
- """
1649
- Retrieve all tasks related to given project.
1650
- It's mainly used for synchronisation purpose.
1651
- """
1652
2387
 
1653
2388
  @jwt_required()
1654
2389
  def get(self, project_id):
1655
2390
  """
1656
- Retrieve all tasks related to given project.
2391
+ Get project tasks
1657
2392
  ---
1658
2393
  tags:
1659
2394
  - Tasks
1660
- description: It's mainly used for synchronisation purpose.
2395
+ description: Retrieve tasks related to a project. Useful for sync.
1661
2396
  parameters:
1662
2397
  - in: path
1663
2398
  name: project_id
@@ -1686,6 +2421,54 @@ class ProjectTasksResource(Resource, ArgsMixin):
1686
2421
  responses:
1687
2422
  200:
1688
2423
  description: All tasks related to given project
2424
+ content:
2425
+ application/json:
2426
+ schema:
2427
+ type: object
2428
+ properties:
2429
+ data:
2430
+ type: array
2431
+ items:
2432
+ type: object
2433
+ properties:
2434
+ id:
2435
+ type: string
2436
+ format: uuid
2437
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2438
+ name:
2439
+ type: string
2440
+ example: SH010 Animation
2441
+ task_type_id:
2442
+ type: string
2443
+ format: uuid
2444
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2445
+ task_status_id:
2446
+ type: string
2447
+ format: uuid
2448
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2449
+ entity_id:
2450
+ type: string
2451
+ format: uuid
2452
+ example: d24a6ea4-ce75-4665-a070-57453082c25
2453
+ project_id:
2454
+ type: string
2455
+ format: uuid
2456
+ example: e24a6ea4-ce75-4665-a070-57453082c25
2457
+ assignees:
2458
+ type: array
2459
+ items:
2460
+ type: string
2461
+ format: uuid
2462
+ example: ["f24a6ea4-ce75-4665-a070-57453082c25"]
2463
+ limit:
2464
+ type: integer
2465
+ example: 100
2466
+ page:
2467
+ type: integer
2468
+ example: 1
2469
+ is_more:
2470
+ type: boolean
2471
+ example: true
1689
2472
  """
1690
2473
  projects_service.get_project(project_id)
1691
2474
  page = self.get_page()
@@ -1697,19 +2480,16 @@ class ProjectTasksResource(Resource, ArgsMixin):
1697
2480
 
1698
2481
 
1699
2482
  class ProjectCommentsResource(Resource, ArgsMixin):
1700
- """
1701
- Retrieve all comments to tasks related to given project.
1702
- It's mainly used for synchronisation purpose.
1703
- """
1704
2483
 
1705
2484
  @jwt_required()
1706
2485
  def get(self, project_id):
1707
2486
  """
1708
- Retrieve all comments to tasks related to given project.
2487
+ Get project comments
1709
2488
  ---
1710
2489
  tags:
1711
2490
  - Tasks
1712
- description: It's mainly used for synchronisation purpose.
2491
+ description: Retrieve comments for tasks related to a project. Useful
2492
+ for sync.
1713
2493
  parameters:
1714
2494
  - in: path
1715
2495
  name: project_id
@@ -1726,6 +2506,36 @@ class ProjectCommentsResource(Resource, ArgsMixin):
1726
2506
  responses:
1727
2507
  200:
1728
2508
  description: All comments to tasks related to given project
2509
+ content:
2510
+ application/json:
2511
+ schema:
2512
+ type: array
2513
+ items:
2514
+ type: object
2515
+ properties:
2516
+ id:
2517
+ type: string
2518
+ format: uuid
2519
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2520
+ object_id:
2521
+ type: string
2522
+ format: uuid
2523
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2524
+ person_id:
2525
+ type: string
2526
+ format: uuid
2527
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2528
+ text:
2529
+ type: string
2530
+ example: This task looks good
2531
+ created_at:
2532
+ type: string
2533
+ format: date-time
2534
+ example: "2024-01-15T10:30:00Z"
2535
+ updated_at:
2536
+ type: string
2537
+ format: date-time
2538
+ example: "2024-01-15T11:00:00Z"
1729
2539
  """
1730
2540
  projects_service.get_project(project_id)
1731
2541
  user_service.check_project_access(project_id)
@@ -1740,18 +2550,18 @@ class ProjectCommentsResource(Resource, ArgsMixin):
1740
2550
 
1741
2551
 
1742
2552
  class ProjectPreviewFilesResource(Resource, ArgsMixin):
1743
- """
1744
- Preview files related to a given project.
1745
- """
1746
2553
 
1747
2554
  @jwt_required()
1748
2555
  @permissions.require_admin
1749
2556
  def get(self, project_id):
1750
2557
  """
1751
- Preview files related to a given project.
2558
+ Get project preview files
1752
2559
  ---
1753
2560
  tags:
1754
2561
  - Tasks
2562
+ description: Retrieve all preview files that are linked to a specific
2563
+ project. This includes images, videos, and other preview media
2564
+ associated with the project.
1755
2565
  parameters:
1756
2566
  - in: path
1757
2567
  name: project_id
@@ -1763,6 +2573,48 @@ class ProjectPreviewFilesResource(Resource, ArgsMixin):
1763
2573
  responses:
1764
2574
  200:
1765
2575
  description: Preview files related to given project
2576
+ content:
2577
+ application/json:
2578
+ schema:
2579
+ type: object
2580
+ properties:
2581
+ data:
2582
+ type: array
2583
+ items:
2584
+ type: object
2585
+ properties:
2586
+ id:
2587
+ type: string
2588
+ format: uuid
2589
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2590
+ task_id:
2591
+ type: string
2592
+ format: uuid
2593
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2594
+ comment_id:
2595
+ type: string
2596
+ format: uuid
2597
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2598
+ revision:
2599
+ type: integer
2600
+ example: 1
2601
+ person_id:
2602
+ type: string
2603
+ format: uuid
2604
+ example: e24a6ea4-ce75-4665-a070-57453082c25
2605
+ created_at:
2606
+ type: string
2607
+ format: date-time
2608
+ example: "2024-01-15T10:30:00Z"
2609
+ limit:
2610
+ type: integer
2611
+ example: 100
2612
+ page:
2613
+ type: integer
2614
+ example: 1
2615
+ is_more:
2616
+ type: boolean
2617
+ example: true
1766
2618
  """
1767
2619
  projects_service.get_project(project_id)
1768
2620
  page = self.get_page()
@@ -1773,23 +2625,55 @@ class SetTaskMainPreviewResource(Resource):
1773
2625
  @jwt_required()
1774
2626
  def put(self, task_id):
1775
2627
  """
1776
- Set last preview from given task as main preview of the related entity.
1777
- This preview will be used as thumbnail to illustrate the entity.
2628
+ Set main preview from task
1778
2629
  ---
1779
2630
  tags:
1780
2631
  - Tasks
1781
- description: This preview will be used to illustrate the entity.
2632
+ description: Set the last preview of a task as the main preview of the
2633
+ related entity.
1782
2634
  parameters:
1783
2635
  - in: path
1784
- name: preview_file_id
2636
+ name: task_id
1785
2637
  required: true
1786
2638
  schema:
1787
2639
  type: string
1788
- format: uuid
2640
+ format: uuid
1789
2641
  example: a24a6ea4-ce75-4665-a070-57453082c25
1790
2642
  responses:
1791
2643
  200:
1792
- description: Given preview set as main preview
2644
+ description: Preview set as main preview
2645
+ content:
2646
+ application/json:
2647
+ schema:
2648
+ type: object
2649
+ properties:
2650
+ id:
2651
+ type: string
2652
+ format: uuid
2653
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2654
+ name:
2655
+ type: string
2656
+ example: SH010
2657
+ project_id:
2658
+ type: string
2659
+ format: uuid
2660
+ example: b24a6ea4-ce75-4665-a070-57453082c25
2661
+ preview_file_id:
2662
+ type: string
2663
+ format: uuid
2664
+ example: c24a6ea4-ce75-4665-a070-57453082c25
2665
+ entity_type_id:
2666
+ type: string
2667
+ format: uuid
2668
+ example: d24a6ea4-ce75-4665-a070-57453082c25
2669
+ created_at:
2670
+ type: string
2671
+ format: date-time
2672
+ example: "2024-01-15T10:30:00Z"
2673
+ updated_at:
2674
+ type: string
2675
+ format: date-time
2676
+ example: "2024-01-15T11:00:00Z"
1793
2677
  """
1794
2678
  task = tasks_service.get_task(task_id)
1795
2679
  user_service.check_project_access(task["project_id"])
@@ -1805,15 +2689,18 @@ class SetTaskMainPreviewResource(Resource):
1805
2689
 
1806
2690
 
1807
2691
  class PersonsTasksDatesResource(Resource, ArgsMixin):
2692
+
1808
2693
  @jwt_required()
1809
2694
  @permissions.require_admin
1810
2695
  def get(self):
1811
2696
  """
1812
- For schedule usages, for each active person, it returns the first start
1813
- date of all tasks of assigned to this person and the last end date.
2697
+ Get persons tasks dates
1814
2698
  ---
1815
2699
  tags:
1816
2700
  - Tasks
2701
+ description: For each active person, return the first start date of all
2702
+ tasks assigned to them and the last end date. Useful for schedule
2703
+ planning.
1817
2704
  parameters:
1818
2705
  - in: query
1819
2706
  name: project_id
@@ -1825,7 +2712,8 @@ class PersonsTasksDatesResource(Resource, ArgsMixin):
1825
2712
  description: Filter by project ID
1826
2713
  responses:
1827
2714
  200:
1828
- description: For each person, the first start date of all tasks assigned to this person and the last end date
2715
+ description: First start date and last end date for tasks per
2716
+ person
1829
2717
  content:
1830
2718
  application/json:
1831
2719
  schema:
@@ -1836,14 +2724,15 @@ class PersonsTasksDatesResource(Resource, ArgsMixin):
1836
2724
  person_id:
1837
2725
  type: string
1838
2726
  format: uuid
2727
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1839
2728
  first_start_date:
1840
2729
  type: string
1841
2730
  format: date
2731
+ example: "2024-01-15"
1842
2732
  last_end_date:
1843
2733
  type: string
1844
2734
  format: date
1845
- 403:
1846
- description: Admin permissions required
2735
+ example: "2024-03-21"
1847
2736
  """
1848
2737
  permissions.check_admin_permissions()
1849
2738
  args = self.get_args([("project_id", None, False, str)])
@@ -1853,17 +2742,16 @@ class PersonsTasksDatesResource(Resource, ArgsMixin):
1853
2742
 
1854
2743
 
1855
2744
  class OpenTasksResource(Resource, ArgsMixin):
1856
- """
1857
- Return all tasks related to open projects.
1858
- """
1859
2745
 
1860
2746
  @jwt_required()
1861
2747
  def get(self):
1862
2748
  """
1863
- Return all tasks related to open projects.
2749
+ Get open tasks
1864
2750
  ---
1865
2751
  tags:
1866
2752
  - Tasks
2753
+ description: Return tasks for open projects with optional filters and
2754
+ pagination. Includes statistics.
1867
2755
  parameters:
1868
2756
  - in: query
1869
2757
  name: project_id
@@ -2013,15 +2901,16 @@ class OpenTasksStatsResource(Resource, ArgsMixin):
2013
2901
  @jwt_required()
2014
2902
  def get(self):
2015
2903
  """
2016
- Return task amount, task done amount, total estimation, total duration
2017
- by status by task type by project for open projects. It aggregates the
2018
- result at the project level.
2904
+ Get open tasks stats
2019
2905
  ---
2020
2906
  tags:
2021
2907
  - Tasks
2908
+ description: Return totals and aggregates by status and task type per
2909
+ project for open projects.
2022
2910
  responses:
2023
2911
  200:
2024
- description: A dict organized by project that contains the results for each task type and status pairs
2912
+ description: A dict by project with results for each task type and
2913
+ status pair
2025
2914
  content:
2026
2915
  application/json:
2027
2916
  schema: