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
@@ -42,11 +42,12 @@ class DesktopLoginsResource(Resource, ArgsMixin):
42
42
  @jwt_required()
43
43
  def get(self, person_id):
44
44
  """
45
- Retrieve desktop login logs.
45
+ Get desktop login logs
46
46
  ---
47
+ description: Retrieve desktop login logs for a person. Desktop login
48
+ logs can only be created by current user.
47
49
  tags:
48
50
  - Persons
49
- description: Desktop login logs can only be created by current user.
50
51
  parameters:
51
52
  - in: path
52
53
  name: person_id
@@ -54,10 +55,11 @@ class DesktopLoginsResource(Resource, ArgsMixin):
54
55
  schema:
55
56
  type: string
56
57
  format: uuid
58
+ description: Person unique identifier
57
59
  example: a24a6ea4-ce75-4665-a070-57453082c25
58
60
  responses:
59
- '200':
60
- description: Desktop login logs
61
+ 200:
62
+ description: Desktop login logs for the person
61
63
  content:
62
64
  application/json:
63
65
  schema:
@@ -68,14 +70,18 @@ class DesktopLoginsResource(Resource, ArgsMixin):
68
70
  id:
69
71
  type: string
70
72
  format: uuid
73
+ description: Log entry unique identifier
74
+ example: a24a6ea4-ce75-4665-a070-57453082c25
71
75
  person_id:
72
76
  type: string
73
77
  format: uuid
78
+ description: Person unique identifier
79
+ example: b35b7fb5-df86-5776-b181-68564193d36
74
80
  date:
75
81
  type: string
76
82
  format: date-time
77
- '404':
78
- description: Person not found
83
+ description: Login date and time
84
+ example: "2022-07-12T10:30:00Z"
79
85
  """
80
86
  current_user = persons_service.get_current_user()
81
87
  if (
@@ -90,11 +96,11 @@ class DesktopLoginsResource(Resource, ArgsMixin):
90
96
  @jwt_required()
91
97
  def post(self, person_id):
92
98
  """
93
- Create desktop login logs.
99
+ Create desktop login log
94
100
  ---
101
+ description: Add a new log entry for desktop logins for a person.
95
102
  tags:
96
103
  - Persons
97
- description: Add a new log entry for desktop logins.
98
104
  parameters:
99
105
  - in: path
100
106
  name: person_id
@@ -102,11 +108,12 @@ class DesktopLoginsResource(Resource, ArgsMixin):
102
108
  schema:
103
109
  type: string
104
110
  format: uuid
111
+ description: Person unique identifier
105
112
  example: a24a6ea4-ce75-4665-a070-57453082c25
106
113
  requestBody:
107
114
  required: true
108
115
  content:
109
- application/x-www-form-urlencoded:
116
+ application/json:
110
117
  schema:
111
118
  type: object
112
119
  required:
@@ -115,9 +122,10 @@ class DesktopLoginsResource(Resource, ArgsMixin):
115
122
  date:
116
123
  type: string
117
124
  format: date
125
+ description: Login date
118
126
  example: "2022-07-12"
119
127
  responses:
120
- '201':
128
+ 201:
121
129
  description: Desktop login log entry created
122
130
  content:
123
131
  application/json:
@@ -127,16 +135,20 @@ class DesktopLoginsResource(Resource, ArgsMixin):
127
135
  id:
128
136
  type: string
129
137
  format: uuid
138
+ description: Log entry unique identifier
139
+ example: a24a6ea4-ce75-4665-a070-57453082c25
130
140
  person_id:
131
141
  type: string
132
142
  format: uuid
143
+ description: Person unique identifier
144
+ example: b35b7fb5-df86-5776-b181-68564193d36
133
145
  date:
134
146
  type: string
135
147
  format: date-time
136
- '400':
148
+ description: Login date and time
149
+ example: "2022-07-12T10:30:00Z"
150
+ 400:
137
151
  description: Invalid date format
138
- '404':
139
- description: Person not found
140
152
  """
141
153
  args = self.get_args([("date", date_helpers.get_utc_now_datetime())])
142
154
 
@@ -159,8 +171,10 @@ class PresenceLogsResource(Resource):
159
171
  @jwt_required()
160
172
  def get(self, month_date):
161
173
  """
162
- Return a csv file containing the presence logs based on a daily basis.
174
+ Get presence logs
163
175
  ---
176
+ description: Return a CSV file containing the presence logs based on a
177
+ daily basis for the given month.
164
178
  tags:
165
179
  - Persons
166
180
  parameters:
@@ -170,16 +184,17 @@ class PresenceLogsResource(Resource):
170
184
  schema:
171
185
  type: string
172
186
  format: date
187
+ description: Month in YYYY-MM format
173
188
  example: "2022-07"
174
189
  responses:
175
- '200':
176
- description: CSV file containing the presence logs based on a daily basis
190
+ 200:
191
+ description: CSV file containing the presence logs based on daily basis
177
192
  content:
178
193
  text/csv:
179
194
  schema:
180
195
  type: string
181
196
  format: binary
182
- '400':
197
+ 400:
183
198
  description: Invalid date format
184
199
  """
185
200
  permissions.check_admin_permissions()
@@ -195,9 +210,10 @@ class TimeSpentsResource(Resource, ArgsMixin):
195
210
  @jwt_required()
196
211
  def get(self, person_id):
197
212
  """
198
- Get all time spents for the given person.
199
- Optionally can accept date range parameters.
213
+ Get time spents
200
214
  ---
215
+ description: Get all time spents for the given person. Optionally can
216
+ accept date range parameters.
201
217
  tags:
202
218
  - Persons
203
219
  parameters:
@@ -207,6 +223,7 @@ class TimeSpentsResource(Resource, ArgsMixin):
207
223
  schema:
208
224
  type: string
209
225
  format: uuid
226
+ description: Person unique identifier
210
227
  example: a24a6ea4-ce75-4665-a070-57453082c25
211
228
  - in: query
212
229
  name: start_date
@@ -214,6 +231,7 @@ class TimeSpentsResource(Resource, ArgsMixin):
214
231
  schema:
215
232
  type: string
216
233
  format: date
234
+ description: Start date for date range filter
217
235
  example: "2022-07-01"
218
236
  - in: query
219
237
  name: end_date
@@ -221,9 +239,10 @@ class TimeSpentsResource(Resource, ArgsMixin):
221
239
  schema:
222
240
  type: string
223
241
  format: date
242
+ description: End date for date range filter
224
243
  example: "2022-07-31"
225
244
  responses:
226
- '200':
245
+ 200:
227
246
  description: All time spents for the given person
228
247
  content:
229
248
  application/json:
@@ -235,19 +254,25 @@ class TimeSpentsResource(Resource, ArgsMixin):
235
254
  id:
236
255
  type: string
237
256
  format: uuid
257
+ description: Time spent unique identifier
258
+ example: a24a6ea4-ce75-4665-a070-57453082c25
238
259
  person_id:
239
260
  type: string
240
261
  format: uuid
262
+ description: Person unique identifier
263
+ example: b35b7fb5-df86-5776-b181-68564193d36
241
264
  duration:
242
265
  type: number
243
266
  format: float
267
+ description: Time spent duration in hours
268
+ example: 8.5
244
269
  date:
245
270
  type: string
246
271
  format: date
247
- '400':
272
+ description: Date of time spent entry
273
+ example: "2022-07-12"
274
+ 400:
248
275
  description: Invalid date range parameters
249
- '404':
250
- description: Person not found
251
276
  """
252
277
  user_service.check_person_is_not_bot(person_id)
253
278
  permissions.check_admin_permissions()
@@ -279,8 +304,9 @@ class DateTimeSpentsResource(Resource):
279
304
  @jwt_required()
280
305
  def get(self, person_id, date):
281
306
  """
282
- Get time spents for given person and date.
307
+ Get time spents for date
283
308
  ---
309
+ description: Get time spents for given person and specific date.
284
310
  tags:
285
311
  - Persons
286
312
  parameters:
@@ -290,6 +316,7 @@ class DateTimeSpentsResource(Resource):
290
316
  schema:
291
317
  type: string
292
318
  format: uuid
319
+ description: Person unique identifier
293
320
  example: a24a6ea4-ce75-4665-a070-57453082c25
294
321
  - in: path
295
322
  name: date
@@ -297,9 +324,10 @@ class DateTimeSpentsResource(Resource):
297
324
  schema:
298
325
  type: string
299
326
  format: date
327
+ description: Date to get time spents for
300
328
  example: "2022-07-12"
301
329
  responses:
302
- '200':
330
+ 200:
303
331
  description: Time spents for given person and date
304
332
  content:
305
333
  application/json:
@@ -311,19 +339,25 @@ class DateTimeSpentsResource(Resource):
311
339
  id:
312
340
  type: string
313
341
  format: uuid
342
+ description: Time spent unique identifier
343
+ example: a24a6ea4-ce75-4665-a070-57453082c25
314
344
  person_id:
315
345
  type: string
316
346
  format: uuid
347
+ description: Person unique identifier
348
+ example: b35b7fb5-df86-5776-b181-68564193d36
317
349
  duration:
318
350
  type: number
319
351
  format: float
352
+ description: Time spent duration in hours
353
+ example: 8.5
320
354
  date:
321
355
  type: string
322
356
  format: date
323
- '400':
357
+ description: Date of time spent entry
358
+ example: "2022-07-12"
359
+ 400:
324
360
  description: Wrong date format
325
- '404':
326
- description: Person not found
327
361
  """
328
362
  user_service.check_person_is_not_bot(person_id)
329
363
  department_ids = None
@@ -360,8 +394,9 @@ class DayOffResource(Resource):
360
394
  @jwt_required()
361
395
  def get(self, person_id, date):
362
396
  """
363
- Get day off object for given person and date.
397
+ Get day off
364
398
  ---
399
+ description: Get day off object for given person and date.
365
400
  tags:
366
401
  - Persons
367
402
  parameters:
@@ -371,6 +406,7 @@ class DayOffResource(Resource):
371
406
  schema:
372
407
  type: string
373
408
  format: uuid
409
+ description: Person unique identifier
374
410
  example: a24a6ea4-ce75-4665-a070-57453082c25
375
411
  - in: path
376
412
  name: date
@@ -378,9 +414,10 @@ class DayOffResource(Resource):
378
414
  schema:
379
415
  type: string
380
416
  format: date
417
+ description: Date to get day off for
381
418
  example: "2022-07-12"
382
419
  responses:
383
- '200':
420
+ 200:
384
421
  description: Day off object for given person and date
385
422
  content:
386
423
  application/json:
@@ -390,18 +427,24 @@ class DayOffResource(Resource):
390
427
  id:
391
428
  type: string
392
429
  format: uuid
430
+ description: Day off unique identifier
431
+ example: a24a6ea4-ce75-4665-a070-57453082c25
393
432
  person_id:
394
433
  type: string
395
434
  format: uuid
435
+ description: Person unique identifier
436
+ example: b35b7fb5-df86-5776-b181-68564193d36
396
437
  date:
397
438
  type: string
398
439
  format: date
440
+ description: Day off date
441
+ example: "2022-07-12"
399
442
  type:
400
443
  type: string
401
- '400':
444
+ description: Day off type
445
+ example: "vacation"
446
+ 400:
402
447
  description: Wrong date format
403
- '404':
404
- description: Person not found
405
448
  """
406
449
  user_service.check_person_is_not_bot(person_id)
407
450
  current_user = persons_service.get_current_user()
@@ -453,8 +496,9 @@ class PersonYearTimeSpentsResource(PersonDurationTimeSpentsResource):
453
496
  @jwt_required()
454
497
  def get(self, person_id, year):
455
498
  """
456
- Get aggregated time spents for given person and year.
499
+ Get year time spents
457
500
  ---
501
+ description: Get aggregated time spents for given person and year.
458
502
  tags:
459
503
  - Persons
460
504
  parameters:
@@ -464,15 +508,17 @@ class PersonYearTimeSpentsResource(PersonDurationTimeSpentsResource):
464
508
  schema:
465
509
  type: string
466
510
  format: uuid
511
+ description: Person unique identifier
467
512
  example: a24a6ea4-ce75-4665-a070-57453082c25
468
513
  - in: path
469
514
  name: year
470
515
  required: true
471
516
  schema:
472
517
  type: integer
518
+ description: Year to get aggregated time spents for
473
519
  example: 2022
474
520
  responses:
475
- '200':
521
+ 200:
476
522
  description: Aggregated time spents for given person and year
477
523
  content:
478
524
  application/json:
@@ -482,12 +528,14 @@ class PersonYearTimeSpentsResource(PersonDurationTimeSpentsResource):
482
528
  total_duration:
483
529
  type: number
484
530
  format: float
531
+ description: Total duration in hours
532
+ example: 2080.5
485
533
  year:
486
534
  type: integer
487
- '400':
535
+ description: Year
536
+ example: 2022
537
+ 400:
488
538
  description: Wrong date format
489
- '404':
490
- description: Person not found
491
539
  """
492
540
  user_service.check_person_is_not_bot(person_id)
493
541
  try:
@@ -505,34 +553,59 @@ class PersonMonthTimeSpentsResource(PersonDurationTimeSpentsResource):
505
553
  @jwt_required()
506
554
  def get(self, person_id, year, month):
507
555
  """
508
- Get aggregated time spents for given person and month.
556
+ Get month time spents
509
557
  ---
558
+ description: Get aggregated time spents for given person and month.
510
559
  tags:
511
- - Persons
560
+ - Persons
512
561
  parameters:
513
562
  - in: path
514
563
  name: person_id
515
- required: True
516
- type: string
517
- format: uuid
564
+ required: true
565
+ schema:
566
+ type: string
567
+ format: uuid
568
+ description: Person unique identifier
518
569
  example: a24a6ea4-ce75-4665-a070-57453082c25
519
570
  - in: path
520
571
  name: year
521
- required: True
522
- type: integer
523
- example: "2022"
572
+ required: true
573
+ schema:
574
+ type: integer
575
+ description: Year to get aggregated time spents for
576
+ example: 2022
524
577
  - in: path
525
578
  name: month
526
- required: True
527
- type: integer
528
- example: 07
579
+ required: true
580
+ schema:
581
+ type: integer
582
+ description: Month to get aggregated time spents for
583
+ example: 7
529
584
  minimum: 1
530
585
  maximum: 12
531
586
  responses:
532
- 200:
533
- description: Aggregated time spents for given person and month
534
- 404:
535
- description: Wrong date format
587
+ 200:
588
+ description: Aggregated time spents for given person and month
589
+ content:
590
+ application/json:
591
+ schema:
592
+ type: object
593
+ properties:
594
+ total_duration:
595
+ type: number
596
+ format: float
597
+ description: Total duration in hours
598
+ example: 173.5
599
+ year:
600
+ type: integer
601
+ description: Year
602
+ example: 2022
603
+ month:
604
+ type: integer
605
+ description: Month
606
+ example: 7
607
+ 400:
608
+ description: Wrong date format
536
609
  """
537
610
  user_service.check_person_is_not_bot(person_id)
538
611
  try:
@@ -551,7 +624,45 @@ class PersonMonthAllTimeSpentsResource(Resource):
551
624
  @jwt_required()
552
625
  def get(self, person_id, year, month):
553
626
  """
554
- Get all time spents for a given person and month.
627
+ Get all month time spents
628
+ ---
629
+ description: Get all time spents for a given person and month.
630
+ tags:
631
+ - Persons
632
+ parameters:
633
+ - in: path
634
+ name: person_id
635
+ required: true
636
+ schema:
637
+ type: string
638
+ format: uuid
639
+ description: Person unique identifier
640
+ example: a24a6ea4-ce75-4665-a070-57453082c25
641
+ - in: path
642
+ name: year
643
+ required: true
644
+ schema:
645
+ type: integer
646
+ description: Year to get time spents for
647
+ example: 2022
648
+ - in: path
649
+ name: month
650
+ required: true
651
+ schema:
652
+ type: integer
653
+ description: Month to get time spents for
654
+ example: 7
655
+ minimum: 1
656
+ maximum: 12
657
+ responses:
658
+ 200:
659
+ description: All time spents for the given person and month
660
+ content:
661
+ application/json:
662
+ schema:
663
+ type: array
664
+ items:
665
+ type: object
555
666
  """
556
667
  user_service.check_person_is_not_bot(person_id)
557
668
  user_service.check_person_access(person_id)
@@ -569,34 +680,59 @@ class PersonWeekTimeSpentsResource(PersonDurationTimeSpentsResource):
569
680
  @jwt_required()
570
681
  def get(self, person_id, year, week):
571
682
  """
572
- Get aggregated time spents for given person and week.
683
+ Get week time spents
573
684
  ---
685
+ description: Get aggregated time spents for given person and week.
574
686
  tags:
575
- - Persons
687
+ - Persons
576
688
  parameters:
577
689
  - in: path
578
690
  name: person_id
579
- required: True
580
- type: string
581
- format: uuid
691
+ required: true
692
+ schema:
693
+ type: string
694
+ format: uuid
695
+ description: Person unique identifier
582
696
  example: a24a6ea4-ce75-4665-a070-57453082c25
583
697
  - in: path
584
698
  name: year
585
- required: True
586
- type: integer
587
- example: "2022"
699
+ required: true
700
+ schema:
701
+ type: integer
702
+ description: Year to get aggregated time spents for
703
+ example: 2022
588
704
  - in: path
589
705
  name: week
590
- required: True
591
- type: integer
706
+ required: true
707
+ schema:
708
+ type: integer
709
+ description: Week number to get aggregated time spents for
592
710
  example: 35
593
711
  minimum: 1
594
712
  maximum: 52
595
713
  responses:
596
- 200:
597
- description: Aggregated time spents for given person and week
598
- 404:
599
- description: Wrong date format
714
+ 200:
715
+ description: Aggregated time spents for given person and week
716
+ content:
717
+ application/json:
718
+ schema:
719
+ type: object
720
+ properties:
721
+ total_duration:
722
+ type: number
723
+ format: float
724
+ description: Total duration in hours
725
+ example: 40.0
726
+ year:
727
+ type: integer
728
+ description: Year
729
+ example: 2022
730
+ week:
731
+ type: integer
732
+ description: Week number
733
+ example: 35
734
+ 400:
735
+ description: Wrong date format
600
736
  """
601
737
  user_service.check_person_is_not_bot(person_id)
602
738
  try:
@@ -615,41 +751,72 @@ class PersonDayTimeSpentsResource(PersonDurationTimeSpentsResource):
615
751
  @jwt_required()
616
752
  def get(self, person_id, year, month, day):
617
753
  """
618
- Get aggregated time spents for given person and day.
754
+ Get day time spents
619
755
  ---
756
+ description: Get aggregated time spents for given person and day.
620
757
  tags:
621
- - Persons
758
+ - Persons
622
759
  parameters:
623
760
  - in: path
624
761
  name: person_id
625
- required: True
626
- type: string
627
- format: uuid
762
+ required: true
763
+ schema:
764
+ type: string
765
+ format: uuid
766
+ description: Person unique identifier
628
767
  example: a24a6ea4-ce75-4665-a070-57453082c25
629
768
  - in: path
630
769
  name: year
631
- required: True
632
- type: integer
633
- example: "2022"
770
+ required: true
771
+ schema:
772
+ type: integer
773
+ description: Year to get aggregated time spents for
774
+ example: 2022
634
775
  - in: path
635
776
  name: month
636
- required: True
637
- type: integer
638
- example: 07
777
+ required: true
778
+ schema:
779
+ type: integer
780
+ description: Month to get aggregated time spents for
781
+ example: 7
639
782
  minimum: 1
640
783
  maximum: 12
641
784
  - in: path
642
785
  name: day
643
- required: True
644
- type: integer
786
+ required: true
787
+ schema:
788
+ type: integer
789
+ description: Day to get aggregated time spents for
645
790
  example: 12
646
791
  minimum: 1
647
792
  maximum: 31
648
793
  responses:
649
- 200:
650
- description: Aggregated time spents for given person and day
651
- 404:
652
- description: Wrong date format
794
+ 200:
795
+ description: Aggregated time spents for given person and day
796
+ content:
797
+ application/json:
798
+ schema:
799
+ type: object
800
+ properties:
801
+ total_duration:
802
+ type: number
803
+ format: float
804
+ description: Total duration in hours
805
+ example: 8.5
806
+ year:
807
+ type: integer
808
+ description: Year
809
+ example: 2022
810
+ month:
811
+ type: integer
812
+ description: Month
813
+ example: 7
814
+ day:
815
+ type: integer
816
+ description: Day
817
+ example: 12
818
+ 400:
819
+ description: Wrong date format
653
820
  """
654
821
  user_service.check_person_is_not_bot(person_id)
655
822
  try:
@@ -721,40 +888,55 @@ class PersonMonthQuotaShotsResource(Resource, PersonQuotaMixin):
721
888
  @jwt_required()
722
889
  def get(self, person_id, year, month):
723
890
  """
724
- Get ended shots used for quota calculation of this month.
891
+ Get month quota shots
725
892
  ---
893
+ description: Get ended shots used for quota calculation of this month.
726
894
  tags:
727
- - Persons
895
+ - Persons
728
896
  parameters:
729
897
  - in: path
730
898
  name: person_id
731
- required: True
732
- type: string
733
- format: uuid
899
+ required: true
900
+ schema:
901
+ type: string
902
+ format: uuid
903
+ description: Person unique identifier
734
904
  example: a24a6ea4-ce75-4665-a070-57453082c25
735
905
  - in: path
736
906
  name: year
737
- required: True
738
- type: integer
739
- example: "2022"
907
+ required: true
908
+ schema:
909
+ type: integer
910
+ description: Year to get quota shots for
911
+ example: 2022
740
912
  - in: path
741
913
  name: month
742
- required: True
743
- type: integer
744
- example: 07
914
+ required: true
915
+ schema:
916
+ type: integer
917
+ description: Month to get quota shots for
918
+ example: 7
745
919
  minimum: 1
746
920
  maximum: 12
747
921
  - in: query
748
922
  name: count_mode
749
- required: True
750
- type: string
751
- enum: [weighted, weigtheddone, feedback, done]
923
+ required: false
924
+ schema:
925
+ type: string
926
+ enum: [weighted, weighteddone, feedback, done]
927
+ description: Count mode for quota calculation
752
928
  example: weighted
753
929
  responses:
754
- 200:
755
- description: Ended shots used for quota calculation of this month
756
- 404:
757
- description: Wrong date format
930
+ 200:
931
+ description: Ended shots used for quota calculation of this month
932
+ content:
933
+ application/json:
934
+ schema:
935
+ type: array
936
+ items:
937
+ type: object
938
+ 400:
939
+ description: Wrong date format or invalid count mode
758
940
  """
759
941
  return super().get(person_id, year, month)
760
942
 
@@ -769,40 +951,55 @@ class PersonWeekQuotaShotsResource(Resource, PersonQuotaMixin):
769
951
  @jwt_required()
770
952
  def get(self, person_id, year, week):
771
953
  """
772
- Get ended shots used for quota calculation of this week.
954
+ Get week quota shots
773
955
  ---
956
+ description: Get ended shots used for quota calculation of this week.
774
957
  tags:
775
- - Persons
958
+ - Persons
776
959
  parameters:
777
960
  - in: path
778
961
  name: person_id
779
- required: True
780
- type: string
781
- format: uuid
962
+ required: true
963
+ schema:
964
+ type: string
965
+ format: uuid
966
+ description: Person unique identifier
782
967
  example: a24a6ea4-ce75-4665-a070-57453082c25
783
968
  - in: path
784
969
  name: year
785
- required: True
786
- type: integer
787
- example: "2022"
970
+ required: true
971
+ schema:
972
+ type: integer
973
+ description: Year to get quota shots for
974
+ example: 2022
788
975
  - in: path
789
976
  name: week
790
- required: True
791
- type: integer
977
+ required: true
978
+ schema:
979
+ type: integer
980
+ description: Week number to get quota shots for
792
981
  example: 35
793
982
  minimum: 1
794
983
  maximum: 52
795
984
  - in: query
796
985
  name: count_mode
797
- required: True
798
- type: string
799
- enum: [weighted, weigtheddone, feedback, done]
986
+ required: false
987
+ schema:
988
+ type: string
989
+ enum: [weighted, weighteddone, feedback, done]
990
+ description: Count mode for quota calculation
800
991
  example: weighted
801
992
  responses:
802
- 200:
803
- description: Ended shots used for quota calculation of this week
804
- 404:
805
- description: Wrong date format
993
+ 200:
994
+ description: Ended shots used for quota calculation of this week
995
+ content:
996
+ application/json:
997
+ schema:
998
+ type: array
999
+ items:
1000
+ type: object
1001
+ 400:
1002
+ description: Wrong date format or invalid count mode
806
1003
  """
807
1004
  return super().get(person_id, year, week)
808
1005
 
@@ -817,47 +1014,64 @@ class PersonDayQuotaShotsResource(Resource, PersonQuotaMixin):
817
1014
  @jwt_required()
818
1015
  def get(self, person_id, year, month, day):
819
1016
  """
820
- Get ended shots used for quota calculation of this day.
1017
+ Get day quota shots
821
1018
  ---
1019
+ description: Get ended shots used for quota calculation of this day.
822
1020
  tags:
823
- - Persons
1021
+ - Persons
824
1022
  parameters:
825
1023
  - in: path
826
1024
  name: person_id
827
- required: True
828
- type: string
829
- format: uuid
1025
+ required: true
1026
+ schema:
1027
+ type: string
1028
+ format: uuid
1029
+ description: Person unique identifier
830
1030
  example: a24a6ea4-ce75-4665-a070-57453082c25
831
1031
  - in: path
832
1032
  name: year
833
- required: True
834
- type: integer
835
- example: "2022"
1033
+ required: true
1034
+ schema:
1035
+ type: integer
1036
+ description: Year to get quota shots for
1037
+ example: 2022
836
1038
  - in: path
837
1039
  name: month
838
- required: True
839
- type: integer
840
- example: 07
1040
+ required: true
1041
+ schema:
1042
+ type: integer
1043
+ description: Month to get quota shots for
1044
+ example: 7
841
1045
  minimum: 1
842
1046
  maximum: 12
843
1047
  - in: path
844
1048
  name: day
845
- required: True
846
- type: integer
1049
+ required: true
1050
+ schema:
1051
+ type: integer
1052
+ description: Day to get quota shots for
847
1053
  example: 12
848
1054
  minimum: 1
849
1055
  maximum: 31
850
1056
  - in: query
851
1057
  name: count_mode
852
- required: True
853
- type: string
854
- enum: [weighted, weigtheddone, feedback, done]
1058
+ required: false
1059
+ schema:
1060
+ type: string
1061
+ enum: [weighted, weighteddone, feedback, done]
1062
+ description: Count mode for quota calculation
855
1063
  example: weighted
856
1064
  responses:
857
- 200:
858
- description: Ended shots used for quota calculation of this day
859
- 404:
860
- description: Wrong date format
1065
+ 200:
1066
+ description: Ended shots used for quota calculation of this day
1067
+ content:
1068
+ application/json:
1069
+ schema:
1070
+ type: array
1071
+ items:
1072
+ type: object
1073
+ 400:
1074
+ description: Wrong date format or invalid count mode
861
1075
  """
862
1076
  return super().get(person_id, year, month, day)
863
1077
 
@@ -915,26 +1129,36 @@ class TimeSpentMonthResource(TimeSpentDurationResource):
915
1129
  @jwt_required()
916
1130
  def get(self, year, month):
917
1131
  """
918
- Return a table giving time spent by user and by day for given year and month.
1132
+ Get time spent month table
919
1133
  ---
1134
+ description: Return a table giving time spent by user and by day for
1135
+ given year and month.
920
1136
  tags:
921
- - Persons
1137
+ - Persons
922
1138
  parameters:
923
1139
  - in: path
924
1140
  name: year
925
- required: True
926
- type: integer
927
- example: "2022"
1141
+ required: true
1142
+ schema:
1143
+ type: integer
1144
+ description: Year to get time spent table for
1145
+ example: 2022
928
1146
  - in: path
929
1147
  name: month
930
- required: True
931
- type: integer
932
- example: 07
1148
+ required: true
1149
+ schema:
1150
+ type: integer
1151
+ description: Month to get time spent table for
1152
+ example: 7
933
1153
  minimum: 1
934
1154
  maximum: 12
935
1155
  responses:
936
- 200:
937
- description: Table giving time spent by user and by day for given year and month
1156
+ 200:
1157
+ description: Table giving time spent by user and by day for given year and month
1158
+ content:
1159
+ application/json:
1160
+ schema:
1161
+ type: object
938
1162
  """
939
1163
 
940
1164
  return time_spents_service.get_day_table(
@@ -947,13 +1171,19 @@ class TimeSpentYearsResource(TimeSpentDurationResource):
947
1171
  @jwt_required()
948
1172
  def get(self):
949
1173
  """
950
- Return a table giving time spent by user and by month for given year.
1174
+ Get time spent years table
951
1175
  ---
1176
+ description: Return a table giving time spent by user and by month for
1177
+ all years.
952
1178
  tags:
953
- - Persons
1179
+ - Persons
954
1180
  responses:
955
- 200:
956
- description: Table giving time spent by user and by month for given year
1181
+ 200:
1182
+ description: Table giving time spent by user and by month for all years
1183
+ content:
1184
+ application/json:
1185
+ schema:
1186
+ type: object
957
1187
  """
958
1188
  return time_spents_service.get_year_table(
959
1189
  **self.get_person_project_department_arguments()
@@ -965,19 +1195,27 @@ class TimeSpentMonthsResource(TimeSpentDurationResource):
965
1195
  @jwt_required()
966
1196
  def get(self, year):
967
1197
  """
968
- Return a table giving time spent by user and by month for given year.
1198
+ Get time spent months table
969
1199
  ---
1200
+ description: Return a table giving time spent by user and by month for
1201
+ given year.
970
1202
  tags:
971
- - Persons
1203
+ - Persons
972
1204
  parameters:
973
1205
  - in: path
974
1206
  name: year
975
- required: True
976
- type: integer
977
- example: "2022"
1207
+ required: true
1208
+ schema:
1209
+ type: integer
1210
+ description: Year to get time spent table for
1211
+ example: 2022
978
1212
  responses:
979
- 200:
980
- description: Table giving time spent by user and by month for given year
1213
+ 200:
1214
+ description: Table giving time spent by user and by month for given year
1215
+ content:
1216
+ application/json:
1217
+ schema:
1218
+ type: object
981
1219
  """
982
1220
  return time_spents_service.get_month_table(
983
1221
  year, **self.get_person_project_department_arguments()
@@ -989,19 +1227,27 @@ class TimeSpentWeekResource(TimeSpentDurationResource):
989
1227
  @jwt_required()
990
1228
  def get(self, year):
991
1229
  """
992
- Return a table giving time spent by user and by week for given year.
1230
+ Get time spent weeks table
993
1231
  ---
1232
+ description: Return a table giving time spent by user and by week for
1233
+ given year.
994
1234
  tags:
995
- - Persons
1235
+ - Persons
996
1236
  parameters:
997
1237
  - in: path
998
1238
  name: year
999
- required: True
1000
- type: integer
1001
- example: "2022"
1239
+ required: true
1240
+ schema:
1241
+ type: integer
1242
+ description: Year to get time spent table for
1243
+ example: 2022
1002
1244
  responses:
1003
- 200:
1004
- description: Table giving time spent by user and by week for given year
1245
+ 200:
1246
+ description: Table giving time spent by user and by week for given year
1247
+ content:
1248
+ application/json:
1249
+ schema:
1250
+ type: object
1005
1251
  """
1006
1252
  return time_spents_service.get_week_table(
1007
1253
  year, **self.get_person_project_department_arguments()
@@ -1013,20 +1259,37 @@ class InvitePersonResource(Resource):
1013
1259
  @jwt_required()
1014
1260
  def get(self, person_id):
1015
1261
  """
1016
- Sends an email to given person to invite him/her to connect to Kitsu.
1262
+ Invite person
1017
1263
  ---
1264
+ description: Sends an email to given person to invite him or her to
1265
+ connect to Kitsu.
1018
1266
  tags:
1019
- - Persons
1267
+ - Persons
1020
1268
  parameters:
1021
1269
  - in: path
1022
1270
  name: person_id
1023
- required: True
1024
- type: string
1025
- format: uuid
1271
+ required: true
1272
+ schema:
1273
+ type: string
1274
+ format: uuid
1275
+ description: Person unique identifier
1026
1276
  example: a24a6ea4-ce75-4665-a070-57453082c25
1027
1277
  responses:
1028
- 200:
1029
- description: Email sent
1278
+ 200:
1279
+ description: Email sent successfully
1280
+ content:
1281
+ application/json:
1282
+ schema:
1283
+ type: object
1284
+ properties:
1285
+ success:
1286
+ type: boolean
1287
+ description: Success flag
1288
+ example: true
1289
+ message:
1290
+ type: string
1291
+ description: Success message
1292
+ example: "Email sent"
1030
1293
  """
1031
1294
  user_service.check_person_is_not_bot(person_id)
1032
1295
  permissions.check_admin_permissions()
@@ -1039,26 +1302,38 @@ class DayOffForMonthResource(Resource, ArgsMixin):
1039
1302
  @jwt_required()
1040
1303
  def get(self, year, month):
1041
1304
  """
1042
- Return all day off recorded for given month.
1305
+ Get day offs for month
1043
1306
  ---
1307
+ description: Return all day off recorded for given month. Admins get all
1308
+ day offs, regular users get only their own.
1044
1309
  tags:
1045
- - Persons
1310
+ - Persons
1046
1311
  parameters:
1047
1312
  - in: path
1048
1313
  name: year
1049
- required: True
1050
- type: integer
1051
- example: "2022"
1314
+ required: true
1315
+ schema:
1316
+ type: integer
1317
+ description: Year to get day offs for
1318
+ example: 2022
1052
1319
  - in: path
1053
1320
  name: month
1054
- required: True
1055
- type: integer
1056
- example: 07
1321
+ required: true
1322
+ schema:
1323
+ type: integer
1324
+ description: Month to get day offs for
1325
+ example: 7
1057
1326
  minimum: 1
1058
1327
  maximum: 12
1059
1328
  responses:
1060
- 200:
1061
- description: All day off recorded for given month
1329
+ 200:
1330
+ description: All day off recorded for given month
1331
+ content:
1332
+ application/json:
1333
+ schema:
1334
+ type: array
1335
+ items:
1336
+ type: object
1062
1337
  """
1063
1338
  if permissions.has_admin_permissions():
1064
1339
  return time_spents_service.get_day_offs_for_month(year, month)
@@ -1074,32 +1349,45 @@ class PersonWeekDayOffResource(Resource, ArgsMixin):
1074
1349
  @jwt_required()
1075
1350
  def get(self, person_id, year, week):
1076
1351
  """
1077
- Return all day off recorded for given week and person.
1352
+ Get person week day offs
1078
1353
  ---
1354
+ description: Return all day off recorded for given week and person.
1079
1355
  tags:
1080
- - Persons
1356
+ - Persons
1081
1357
  parameters:
1082
1358
  - in: path
1083
1359
  name: person_id
1084
- required: True
1085
- type: string
1086
- format: uuid
1360
+ required: true
1361
+ schema:
1362
+ type: string
1363
+ format: uuid
1364
+ description: Person unique identifier
1087
1365
  example: a24a6ea4-ce75-4665-a070-57453082c25
1088
1366
  - in: path
1089
1367
  name: year
1090
- required: True
1091
- type: integer
1092
- example: "2022"
1368
+ required: true
1369
+ schema:
1370
+ type: integer
1371
+ description: Year to get day offs for
1372
+ example: 2022
1093
1373
  - in: path
1094
1374
  name: week
1095
- required: True
1096
- type: integer
1375
+ required: true
1376
+ schema:
1377
+ type: integer
1378
+ description: Week number to get day offs for
1097
1379
  example: 35
1098
1380
  minimum: 1
1099
1381
  maximum: 52
1100
1382
  responses:
1101
- 200:
1102
- description: All day off recorded for given week and person
1383
+ 200:
1384
+ description: All day off recorded for given week and person
1385
+ content:
1386
+ application/json:
1387
+ schema:
1388
+ type: array
1389
+ items:
1390
+ type: object
1103
1391
  """
1104
1392
  user_service.check_person_is_not_bot(person_id)
1105
1393
  user_service.check_person_access(person_id)
@@ -1113,32 +1401,45 @@ class PersonMonthDayOffResource(Resource, ArgsMixin):
1113
1401
  @jwt_required()
1114
1402
  def get(self, person_id, year, month):
1115
1403
  """
1116
- Return all day off recorded for given month and person.
1404
+ Get person month day offs
1117
1405
  ---
1406
+ description: Return all day off recorded for given month and person.
1118
1407
  tags:
1119
- - Persons
1408
+ - Persons
1120
1409
  parameters:
1121
1410
  - in: path
1122
1411
  name: person_id
1123
- required: True
1124
- type: string
1125
- format: uuid
1412
+ required: true
1413
+ schema:
1414
+ type: string
1415
+ format: uuid
1416
+ description: Person unique identifier
1126
1417
  example: a24a6ea4-ce75-4665-a070-57453082c25
1127
1418
  - in: path
1128
1419
  name: year
1129
- required: True
1130
- type: integer
1131
- example: "2022"
1420
+ required: true
1421
+ schema:
1422
+ type: integer
1423
+ description: Year to get day offs for
1424
+ example: 2022
1132
1425
  - in: path
1133
1426
  name: month
1134
- required: True
1135
- type: integer
1136
- example: 07
1427
+ required: true
1428
+ schema:
1429
+ type: integer
1430
+ description: Month to get day offs for
1431
+ example: 7
1137
1432
  minimum: 1
1138
1433
  maximum: 12
1139
1434
  responses:
1140
- 200:
1141
- description: All day off recorded for given month and person
1435
+ 200:
1436
+ description: All day off recorded for given month and person
1437
+ content:
1438
+ application/json:
1439
+ schema:
1440
+ type: array
1441
+ items:
1442
+ type: object
1142
1443
  """
1143
1444
  user_service.check_person_is_not_bot(person_id)
1144
1445
  user_service.check_person_access(person_id)
@@ -1152,25 +1453,36 @@ class PersonYearDayOffResource(Resource, ArgsMixin):
1152
1453
  @jwt_required()
1153
1454
  def get(self, person_id, year):
1154
1455
  """
1155
- Return all day off recorded for given year and person.
1456
+ Get person year day offs
1156
1457
  ---
1458
+ description: Return all day off recorded for given year and person.
1157
1459
  tags:
1158
- - Persons
1460
+ - Persons
1159
1461
  parameters:
1160
1462
  - in: path
1161
1463
  name: person_id
1162
- required: True
1163
- type: string
1164
- format: uuid
1464
+ required: true
1465
+ schema:
1466
+ type: string
1467
+ format: uuid
1468
+ description: Person unique identifier
1165
1469
  example: a24a6ea4-ce75-4665-a070-57453082c25
1166
1470
  - in: path
1167
1471
  name: year
1168
- required: True
1169
- type: integer
1170
- example: "2022"
1472
+ required: true
1473
+ schema:
1474
+ type: integer
1475
+ description: Year to get day offs for
1476
+ example: 2022
1171
1477
  responses:
1172
- 200:
1173
- description: All day off recorded for given year and person
1478
+ 200:
1479
+ description: All day off recorded for given year and person
1480
+ content:
1481
+ application/json:
1482
+ schema:
1483
+ type: array
1484
+ items:
1485
+ type: object
1174
1486
  """
1175
1487
  user_service.check_person_is_not_bot(person_id)
1176
1488
  user_service.check_person_access(person_id)
@@ -1184,20 +1496,29 @@ class PersonDayOffResource(Resource, ArgsMixin):
1184
1496
  @jwt_required()
1185
1497
  def get(self, person_id):
1186
1498
  """
1187
- Return all day offs recorded for given and person.
1499
+ Get person day offs
1188
1500
  ---
1501
+ description: Return all day offs recorded for given person.
1189
1502
  tags:
1190
- - Persons
1503
+ - Persons
1191
1504
  parameters:
1192
1505
  - in: path
1193
1506
  name: person_id
1194
- required: True
1195
- type: string
1196
- format: uuid
1507
+ required: true
1508
+ schema:
1509
+ type: string
1510
+ format: uuid
1511
+ description: Person unique identifier
1197
1512
  example: a24a6ea4-ce75-4665-a070-57453082c25
1198
1513
  responses:
1199
- 200:
1200
- description: All day off recorded for given person.
1514
+ 200:
1515
+ description: All day off recorded for given person
1516
+ content:
1517
+ application/json:
1518
+ schema:
1519
+ type: array
1520
+ items:
1521
+ type: object
1201
1522
  """
1202
1523
  user_service.check_person_is_not_bot(person_id)
1203
1524
  user_service.check_person_access(person_id)
@@ -1211,8 +1532,9 @@ class AddToDepartmentResource(Resource, ArgsMixin):
1211
1532
  @jwt_required()
1212
1533
  def post(self, person_id):
1213
1534
  """
1214
- Add a user to given department.
1535
+ Add person to department
1215
1536
  ---
1537
+ description: Add a user to given department.
1216
1538
  tags:
1217
1539
  - Persons
1218
1540
  parameters:
@@ -1222,11 +1544,12 @@ class AddToDepartmentResource(Resource, ArgsMixin):
1222
1544
  schema:
1223
1545
  type: string
1224
1546
  format: uuid
1547
+ description: Person unique identifier
1225
1548
  example: a24a6ea4-ce75-4665-a070-57453082c25
1226
1549
  requestBody:
1227
1550
  required: true
1228
1551
  content:
1229
- application/x-www-form-urlencoded:
1552
+ application/json:
1230
1553
  schema:
1231
1554
  type: object
1232
1555
  required:
@@ -1235,9 +1558,10 @@ class AddToDepartmentResource(Resource, ArgsMixin):
1235
1558
  department_id:
1236
1559
  type: string
1237
1560
  format: uuid
1238
- example: a24a6ea4-ce75-4665-a070-57453082c25
1561
+ description: Department unique identifier
1562
+ example: b35b7fb5-df86-5776-b181-68564193d36
1239
1563
  responses:
1240
- '201':
1564
+ 201:
1241
1565
  description: User added to given department
1242
1566
  content:
1243
1567
  application/json:
@@ -1247,13 +1571,15 @@ class AddToDepartmentResource(Resource, ArgsMixin):
1247
1571
  id:
1248
1572
  type: string
1249
1573
  format: uuid
1574
+ description: Person unique identifier
1575
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1250
1576
  department_id:
1251
1577
  type: string
1252
1578
  format: uuid
1253
- '400':
1579
+ description: Department unique identifier
1580
+ example: b35b7fb5-df86-5776-b181-68564193d36
1581
+ 400:
1254
1582
  description: Invalid department ID
1255
- '404':
1256
- description: Person or department not found
1257
1583
  """
1258
1584
  args = self.get_args(
1259
1585
  [
@@ -1278,26 +1604,31 @@ class RemoveFromDepartmentResource(Resource, ArgsMixin):
1278
1604
  @jwt_required()
1279
1605
  def delete(self, person_id, department_id):
1280
1606
  """
1281
- Remove a user from given department.
1607
+ Remove person from department
1282
1608
  ---
1609
+ description: Remove a user from given department.
1283
1610
  tags:
1284
- - Persons
1611
+ - Persons
1285
1612
  parameters:
1286
1613
  - in: path
1287
1614
  name: person_id
1288
- required: True
1289
- type: string
1290
- format: uuid
1615
+ required: true
1616
+ schema:
1617
+ type: string
1618
+ format: uuid
1619
+ description: Person unique identifier
1291
1620
  example: a24a6ea4-ce75-4665-a070-57453082c25
1292
1621
  - in: path
1293
1622
  name: department_id
1294
- required: True
1295
- type: string
1296
- format: uuid
1297
- example: a24a6ea4-ce75-4665-a070-57453082c25
1623
+ required: true
1624
+ schema:
1625
+ type: string
1626
+ format: uuid
1627
+ description: Department unique identifier
1628
+ example: b35b7fb5-df86-5776-b181-68564193d36
1298
1629
  responses:
1299
- 204:
1300
- description: User removed from given department
1630
+ 204:
1631
+ description: User removed from given department
1301
1632
  """
1302
1633
  permissions.check_admin_permissions()
1303
1634
  try:
@@ -1315,12 +1646,12 @@ class ChangePasswordForPersonResource(Resource, ArgsMixin):
1315
1646
  @jwt_required()
1316
1647
  def post(self, person_id):
1317
1648
  """
1318
- Allow admin to change password for given user.
1649
+ Change person password
1319
1650
  ---
1320
- description: Prior to modifying the password, it requires to be admin.
1321
- An admin can't change other admins password.
1322
- The new password requires a confirmation to ensure that the admin didn't
1323
- make a mistake by typing the new password.
1651
+ description: Allow admin to change password for given user.
1652
+ An admin can't change other admins password. The new password requires
1653
+ a confirmation to ensure that the admin didn't make a mistake by
1654
+ typing the new password.
1324
1655
  tags:
1325
1656
  - Persons
1326
1657
  parameters:
@@ -1330,11 +1661,12 @@ class ChangePasswordForPersonResource(Resource, ArgsMixin):
1330
1661
  schema:
1331
1662
  type: string
1332
1663
  format: uuid
1664
+ description: Person unique identifier
1333
1665
  example: a24a6ea4-ce75-4665-a070-57453082c25
1334
1666
  requestBody:
1335
1667
  required: true
1336
1668
  content:
1337
- application/x-www-form-urlencoded:
1669
+ application/json:
1338
1670
  schema:
1339
1671
  type: object
1340
1672
  required:
@@ -1345,13 +1677,15 @@ class ChangePasswordForPersonResource(Resource, ArgsMixin):
1345
1677
  type: string
1346
1678
  format: password
1347
1679
  description: New password
1680
+ example: "newSecurePassword123"
1348
1681
  password_2:
1349
1682
  type: string
1350
1683
  format: password
1351
1684
  description: Password confirmation
1685
+ example: "newSecurePassword123"
1352
1686
  responses:
1353
- '200':
1354
- description: Password changed
1687
+ 200:
1688
+ description: Password changed successfully
1355
1689
  content:
1356
1690
  application/json:
1357
1691
  schema:
@@ -1359,7 +1693,9 @@ class ChangePasswordForPersonResource(Resource, ArgsMixin):
1359
1693
  properties:
1360
1694
  success:
1361
1695
  type: boolean
1362
- '400':
1696
+ description: Success flag
1697
+ example: true
1698
+ 400:
1363
1699
  description: Invalid password or inactive user
1364
1700
  content:
1365
1701
  application/json:
@@ -1367,9 +1703,13 @@ class ChangePasswordForPersonResource(Resource, ArgsMixin):
1367
1703
  type: object
1368
1704
  properties:
1369
1705
  error:
1706
+ type: boolean
1707
+ description: Error flag
1708
+ example: true
1709
+ message:
1370
1710
  type: string
1371
- '404':
1372
- description: Person not found
1711
+ description: Error message
1712
+ example: "Password is too short."
1373
1713
  """
1374
1714
  user_service.check_person_is_not_bot(person_id)
1375
1715
  (password, password_2) = self.get_arguments()
@@ -1458,26 +1798,49 @@ class DisableTwoFactorAuthenticationPersonResource(Resource, ArgsMixin):
1458
1798
  @jwt_required()
1459
1799
  def delete(self, person_id):
1460
1800
  """
1461
- Allow admin to disable two factor authentication for given user.
1801
+ Disable two factor authentication
1462
1802
  ---
1463
- description: Prior to disable two factor authentication, it requires to
1464
- be admin.
1465
- An admin can't disable two factor authentication for other
1466
- admins.
1803
+ description: Allow admin to disable two factor authentication for given
1804
+ user. An admin can't disable two factor authentication for other
1805
+ admins.
1467
1806
  tags:
1468
- - Persons
1807
+ - Persons
1469
1808
  parameters:
1470
1809
  - in: path
1471
1810
  name: person_id
1472
- required: True
1473
- type: string
1474
- format: uuid
1811
+ required: true
1812
+ schema:
1813
+ type: string
1814
+ format: uuid
1815
+ description: Person unique identifier
1475
1816
  example: a24a6ea4-ce75-4665-a070-57453082c25
1476
1817
  responses:
1477
1818
  200:
1478
- description: Two factor authentication disabled
1819
+ description: Two factor authentication disabled successfully
1820
+ content:
1821
+ application/json:
1822
+ schema:
1823
+ type: object
1824
+ properties:
1825
+ success:
1826
+ type: boolean
1827
+ description: Success flag
1828
+ example: true
1479
1829
  400:
1480
- description: Inactive user
1830
+ description: Inactive user or two factor authentication not enabled
1831
+ content:
1832
+ application/json:
1833
+ schema:
1834
+ type: object
1835
+ properties:
1836
+ error:
1837
+ type: boolean
1838
+ description: Error flag
1839
+ example: true
1840
+ message:
1841
+ type: string
1842
+ description: Error message
1843
+ example: "User is unactive."
1481
1844
  """
1482
1845
  user_service.check_person_is_not_bot(person_id)
1483
1846
  permissions.check_admin_permissions()
@@ -1526,14 +1889,24 @@ class ClearAvatarPersonResource(Resource):
1526
1889
  @jwt_required()
1527
1890
  def delete(self, person_id):
1528
1891
  """
1529
- Set `has_avatar` flag to False for current user and remove its avatar
1530
- file.
1892
+ Clear person avatar
1531
1893
  ---
1894
+ description: Set has_avatar flag to False for current user and remove
1895
+ its avatar file.
1532
1896
  tags:
1533
1897
  - Persons
1898
+ parameters:
1899
+ - in: path
1900
+ name: person_id
1901
+ required: true
1902
+ schema:
1903
+ type: string
1904
+ format: uuid
1905
+ description: Person unique identifier
1906
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1534
1907
  responses:
1535
- 204:
1536
- description: Avatar file deleted
1908
+ 204:
1909
+ description: Avatar file deleted
1537
1910
  """
1538
1911
  permissions.check_admin_permissions()
1539
1912
  persons_service.clear_avatar(person_id)