zou 0.20.82__py3-none-any.whl → 0.20.84__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zou/__init__.py +1 -1
- zou/app/blueprints/assets/resources.py +1060 -153
- zou/app/blueprints/auth/resources.py +368 -238
- zou/app/blueprints/breakdown/resources.py +584 -94
- zou/app/blueprints/chats/resources.py +176 -37
- zou/app/blueprints/comments/resources.py +409 -150
- zou/app/blueprints/concepts/resources.py +443 -63
- zou/app/blueprints/crud/asset_instance.py +272 -0
- zou/app/blueprints/crud/attachment_file.py +263 -0
- zou/app/blueprints/crud/base.py +176 -69
- zou/app/blueprints/crud/budget.py +278 -0
- zou/app/blueprints/crud/budget_entry.py +269 -0
- zou/app/blueprints/crud/chat.py +282 -0
- zou/app/blueprints/crud/chat_message.py +286 -0
- zou/app/blueprints/crud/comments.py +312 -1
- zou/app/blueprints/crud/custom_action.py +268 -0
- zou/app/blueprints/crud/day_off.py +298 -0
- zou/app/blueprints/crud/department.py +268 -0
- zou/app/blueprints/crud/entity.py +297 -3
- zou/app/blueprints/crud/entity_link.py +303 -0
- zou/app/blueprints/crud/entity_type.py +269 -0
- zou/app/blueprints/crud/event.py +197 -0
- zou/app/blueprints/crud/file_status.py +268 -0
- zou/app/blueprints/crud/hardware_item.py +268 -0
- zou/app/blueprints/crud/metadata_descriptor.py +312 -0
- zou/app/blueprints/crud/milestone.py +302 -1
- zou/app/blueprints/crud/news.py +285 -0
- zou/app/blueprints/crud/notification.py +287 -0
- zou/app/blueprints/crud/organisation.py +269 -0
- zou/app/blueprints/crud/output_file.py +34 -10
- zou/app/blueprints/crud/output_type.py +30 -10
- zou/app/blueprints/crud/person.py +407 -2
- zou/app/blueprints/crud/playlist.py +322 -4
- zou/app/blueprints/crud/plugin.py +269 -0
- zou/app/blueprints/crud/preview_background_file.py +272 -0
- zou/app/blueprints/crud/preview_file.py +280 -9
- zou/app/blueprints/crud/production_schedule_version.py +569 -0
- zou/app/blueprints/crud/project.py +440 -0
- zou/app/blueprints/crud/project_status.py +268 -0
- zou/app/blueprints/crud/salary_scale.py +185 -5
- zou/app/blueprints/crud/schedule_item.py +305 -0
- zou/app/blueprints/crud/search_filter.py +302 -0
- zou/app/blueprints/crud/search_filter_group.py +270 -0
- zou/app/blueprints/crud/software.py +30 -10
- zou/app/blueprints/crud/status_automation.py +296 -2
- zou/app/blueprints/crud/studio.py +268 -0
- zou/app/blueprints/crud/subscription.py +279 -0
- zou/app/blueprints/crud/task.py +325 -5
- zou/app/blueprints/crud/task_status.py +301 -0
- zou/app/blueprints/crud/task_type.py +283 -0
- zou/app/blueprints/crud/time_spent.py +327 -0
- zou/app/blueprints/crud/working_file.py +273 -10
- zou/app/blueprints/departments/resources.py +302 -68
- zou/app/blueprints/edits/resources.py +651 -81
- zou/app/blueprints/entities/resources.py +104 -39
- zou/app/blueprints/events/resources.py +96 -8
- zou/app/blueprints/export/csv/assets.py +15 -5
- zou/app/blueprints/export/csv/base.py +12 -3
- zou/app/blueprints/export/csv/casting.py +32 -5
- zou/app/blueprints/export/csv/edits.py +15 -5
- zou/app/blueprints/export/csv/persons.py +24 -0
- zou/app/blueprints/export/csv/playlists.py +16 -5
- zou/app/blueprints/export/csv/projects.py +23 -0
- zou/app/blueprints/export/csv/shots.py +15 -5
- zou/app/blueprints/export/csv/task_types.py +23 -0
- zou/app/blueprints/export/csv/tasks.py +24 -0
- zou/app/blueprints/export/csv/time_spents.py +24 -0
- zou/app/blueprints/files/resources.py +928 -377
- zou/app/blueprints/index/resources.py +49 -42
- zou/app/blueprints/news/resources.py +47 -27
- zou/app/blueprints/persons/resources.py +644 -271
- zou/app/blueprints/playlists/resources.py +154 -72
- zou/app/blueprints/previews/resources.py +473 -228
- zou/app/blueprints/projects/__init__.py +5 -0
- zou/app/blueprints/projects/resources.py +987 -420
- zou/app/blueprints/search/resources.py +44 -32
- zou/app/blueprints/shots/resources.py +1338 -88
- zou/app/blueprints/source/csv/assets.py +44 -6
- zou/app/blueprints/source/csv/casting.py +43 -6
- zou/app/blueprints/source/csv/edits.py +47 -9
- zou/app/blueprints/source/csv/persons.py +43 -4
- zou/app/blueprints/source/csv/shots.py +47 -6
- zou/app/blueprints/source/csv/task_type_estimations.py +95 -35
- zou/app/blueprints/source/kitsu.py +433 -11
- zou/app/blueprints/source/otio.py +215 -20
- zou/app/blueprints/source/shotgun/assets.py +146 -0
- zou/app/blueprints/source/shotgun/base.py +85 -14
- zou/app/blueprints/source/shotgun/episode.py +124 -0
- zou/app/blueprints/source/shotgun/import_errors.py +105 -14
- zou/app/blueprints/source/shotgun/notes.py +132 -0
- zou/app/blueprints/source/shotgun/person.py +163 -0
- zou/app/blueprints/source/shotgun/project.py +120 -0
- zou/app/blueprints/source/shotgun/scene.py +120 -0
- zou/app/blueprints/source/shotgun/sequence.py +134 -0
- zou/app/blueprints/source/shotgun/shot.py +166 -0
- zou/app/blueprints/source/shotgun/status.py +129 -0
- zou/app/blueprints/source/shotgun/steps.py +138 -0
- zou/app/blueprints/source/shotgun/tasks.py +199 -0
- zou/app/blueprints/source/shotgun/team.py +132 -0
- zou/app/blueprints/source/shotgun/versions.py +155 -0
- zou/app/blueprints/tasks/resources.py +1197 -308
- zou/app/blueprints/user/resources.py +1808 -215
- zou/app/models/metadata_descriptor.py +1 -0
- zou/app/services/persons_service.py +1 -1
- zou/app/services/projects_service.py +45 -1
- zou/app/services/time_spents_service.py +1 -1
- zou/app/swagger.py +100 -27
- zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/METADATA +18 -18
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/RECORD +114 -113
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/WHEEL +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/entry_points.txt +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/top_level.txt +0 -0
zou/app/blueprints/crud/base.py
CHANGED
|
@@ -153,18 +153,69 @@ class BaseModelsResource(Resource, ArgsMixin):
|
|
|
153
153
|
@jwt_required()
|
|
154
154
|
def get(self):
|
|
155
155
|
"""
|
|
156
|
-
|
|
156
|
+
Get models
|
|
157
157
|
---
|
|
158
158
|
tags:
|
|
159
159
|
- Crud
|
|
160
|
-
description:
|
|
160
|
+
description: Retrieve all entries for the given model. Supports
|
|
161
|
+
filtering via query parameters and pagination.
|
|
162
|
+
parameters:
|
|
163
|
+
- in: query
|
|
164
|
+
name: page
|
|
165
|
+
required: false
|
|
166
|
+
schema:
|
|
167
|
+
type: integer
|
|
168
|
+
example: 1
|
|
169
|
+
description: Page number for pagination
|
|
170
|
+
- in: query
|
|
171
|
+
name: limit
|
|
172
|
+
required: false
|
|
173
|
+
schema:
|
|
174
|
+
type: integer
|
|
175
|
+
example: 50
|
|
176
|
+
description: Number of results per page
|
|
177
|
+
- in: query
|
|
178
|
+
name: relations
|
|
179
|
+
required: false
|
|
180
|
+
schema:
|
|
181
|
+
type: boolean
|
|
182
|
+
default: false
|
|
183
|
+
example: false
|
|
184
|
+
description: Whether to include relations
|
|
161
185
|
responses:
|
|
162
186
|
200:
|
|
163
|
-
|
|
187
|
+
description: Models retrieved successfully
|
|
188
|
+
content:
|
|
189
|
+
application/json:
|
|
190
|
+
schema:
|
|
191
|
+
oneOf:
|
|
192
|
+
- type: array
|
|
193
|
+
items:
|
|
194
|
+
type: object
|
|
195
|
+
- type: object
|
|
196
|
+
properties:
|
|
197
|
+
data:
|
|
198
|
+
type: array
|
|
199
|
+
items:
|
|
200
|
+
type: object
|
|
201
|
+
example: []
|
|
202
|
+
total:
|
|
203
|
+
type: integer
|
|
204
|
+
example: 100
|
|
205
|
+
nb_pages:
|
|
206
|
+
type: integer
|
|
207
|
+
example: 2
|
|
208
|
+
limit:
|
|
209
|
+
type: integer
|
|
210
|
+
example: 50
|
|
211
|
+
offset:
|
|
212
|
+
type: integer
|
|
213
|
+
example: 0
|
|
214
|
+
page:
|
|
215
|
+
type: integer
|
|
216
|
+
example: 1
|
|
164
217
|
400:
|
|
165
|
-
|
|
166
|
-
403:
|
|
167
|
-
description: Permission denied
|
|
218
|
+
description: Invalid filter format or query error
|
|
168
219
|
"""
|
|
169
220
|
try:
|
|
170
221
|
query = self.model.query
|
|
@@ -206,36 +257,48 @@ class BaseModelsResource(Resource, ArgsMixin):
|
|
|
206
257
|
@jwt_required()
|
|
207
258
|
def post(self):
|
|
208
259
|
"""
|
|
209
|
-
Create
|
|
260
|
+
Create model
|
|
210
261
|
---
|
|
211
262
|
tags:
|
|
212
263
|
- Crud
|
|
213
|
-
description:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
264
|
+
description: Create a new model instance with data provided in the
|
|
265
|
+
request body. JSON format is expected. The model performs validation
|
|
266
|
+
automatically when instantiated.
|
|
267
|
+
requestBody:
|
|
268
|
+
required: true
|
|
269
|
+
content:
|
|
270
|
+
application/json:
|
|
271
|
+
schema:
|
|
218
272
|
type: object
|
|
219
273
|
properties:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
type: string
|
|
224
|
-
total:
|
|
225
|
-
type: integer
|
|
226
|
-
nb_pages:
|
|
227
|
-
type: integer
|
|
228
|
-
limit:
|
|
229
|
-
type: integer
|
|
230
|
-
offset:
|
|
231
|
-
type: integer
|
|
232
|
-
page:
|
|
233
|
-
type: integer
|
|
274
|
+
name:
|
|
275
|
+
type: string
|
|
276
|
+
example: Model Name
|
|
234
277
|
responses:
|
|
235
|
-
|
|
236
|
-
|
|
278
|
+
201:
|
|
279
|
+
description: Model created successfully
|
|
280
|
+
content:
|
|
281
|
+
application/json:
|
|
282
|
+
schema:
|
|
283
|
+
type: object
|
|
284
|
+
properties:
|
|
285
|
+
id:
|
|
286
|
+
type: string
|
|
287
|
+
format: uuid
|
|
288
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
289
|
+
name:
|
|
290
|
+
type: string
|
|
291
|
+
example: Model Name
|
|
292
|
+
created_at:
|
|
293
|
+
type: string
|
|
294
|
+
format: date-time
|
|
295
|
+
example: "2024-01-15T10:30:00Z"
|
|
296
|
+
updated_at:
|
|
297
|
+
type: string
|
|
298
|
+
format: date-time
|
|
299
|
+
example: "2024-01-15T10:30:00Z"
|
|
237
300
|
400:
|
|
238
|
-
|
|
301
|
+
description: Invalid data format or validation error
|
|
239
302
|
"""
|
|
240
303
|
try:
|
|
241
304
|
data = request.json
|
|
@@ -315,24 +378,53 @@ class BaseModelResource(Resource, ArgsMixin):
|
|
|
315
378
|
@jwt_required()
|
|
316
379
|
def get(self, instance_id):
|
|
317
380
|
"""
|
|
318
|
-
|
|
381
|
+
Get model
|
|
319
382
|
---
|
|
320
383
|
tags:
|
|
321
384
|
- Crud
|
|
385
|
+
description: Retrieve a model instance by its ID and return it as a
|
|
386
|
+
JSON object. Supports including relations.
|
|
322
387
|
parameters:
|
|
323
388
|
- in: path
|
|
324
389
|
name: instance_id
|
|
325
|
-
required:
|
|
326
|
-
|
|
327
|
-
|
|
390
|
+
required: true
|
|
391
|
+
schema:
|
|
392
|
+
type: string
|
|
393
|
+
format: uuid
|
|
328
394
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
395
|
+
- in: query
|
|
396
|
+
name: relations
|
|
397
|
+
required: false
|
|
398
|
+
schema:
|
|
399
|
+
type: boolean
|
|
400
|
+
default: true
|
|
401
|
+
example: true
|
|
402
|
+
description: Whether to include relations
|
|
329
403
|
responses:
|
|
330
404
|
200:
|
|
331
|
-
|
|
405
|
+
description: Model retrieved successfully
|
|
406
|
+
content:
|
|
407
|
+
application/json:
|
|
408
|
+
schema:
|
|
409
|
+
type: object
|
|
410
|
+
properties:
|
|
411
|
+
id:
|
|
412
|
+
type: string
|
|
413
|
+
format: uuid
|
|
414
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
415
|
+
name:
|
|
416
|
+
type: string
|
|
417
|
+
example: Model Name
|
|
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-15T10:30:00Z"
|
|
332
426
|
400:
|
|
333
|
-
|
|
334
|
-
404:
|
|
335
|
-
description: Value error
|
|
427
|
+
description: Invalid ID format or query error
|
|
336
428
|
"""
|
|
337
429
|
relations = self.get_bool_parameter("relations", "true")
|
|
338
430
|
try:
|
|
@@ -366,42 +458,56 @@ class BaseModelResource(Resource, ArgsMixin):
|
|
|
366
458
|
@jwt_required()
|
|
367
459
|
def put(self, instance_id):
|
|
368
460
|
"""
|
|
369
|
-
Update
|
|
461
|
+
Update model
|
|
370
462
|
---
|
|
371
463
|
tags:
|
|
372
464
|
- Crud
|
|
373
|
-
description:
|
|
465
|
+
description: Update a model instance with data provided in the
|
|
466
|
+
request body. JSON format is expected. Model performs validation
|
|
467
|
+
automatically when fields are modified.
|
|
374
468
|
parameters:
|
|
375
469
|
- in: path
|
|
376
470
|
name: instance_id
|
|
377
|
-
required:
|
|
378
|
-
type: string
|
|
379
|
-
format: uuid
|
|
380
|
-
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
381
|
-
- in: body
|
|
382
|
-
name: Model
|
|
471
|
+
required: true
|
|
383
472
|
schema:
|
|
473
|
+
type: string
|
|
474
|
+
format: uuid
|
|
475
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
476
|
+
requestBody:
|
|
477
|
+
required: true
|
|
478
|
+
content:
|
|
479
|
+
application/json:
|
|
480
|
+
schema:
|
|
384
481
|
type: object
|
|
385
482
|
properties:
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
type: string
|
|
390
|
-
total:
|
|
391
|
-
type: integer
|
|
392
|
-
nb_pages:
|
|
393
|
-
type: integer
|
|
394
|
-
limit:
|
|
395
|
-
type: integer
|
|
396
|
-
offset:
|
|
397
|
-
type: integer
|
|
398
|
-
page:
|
|
399
|
-
type: integer
|
|
483
|
+
name:
|
|
484
|
+
type: string
|
|
485
|
+
example: Updated Model Name
|
|
400
486
|
responses:
|
|
401
487
|
200:
|
|
402
|
-
|
|
488
|
+
description: Model updated successfully
|
|
489
|
+
content:
|
|
490
|
+
application/json:
|
|
491
|
+
schema:
|
|
492
|
+
type: object
|
|
493
|
+
properties:
|
|
494
|
+
id:
|
|
495
|
+
type: string
|
|
496
|
+
format: uuid
|
|
497
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
498
|
+
name:
|
|
499
|
+
type: string
|
|
500
|
+
example: Updated Model Name
|
|
501
|
+
created_at:
|
|
502
|
+
type: string
|
|
503
|
+
format: date-time
|
|
504
|
+
example: "2024-01-15T10:30:00Z"
|
|
505
|
+
updated_at:
|
|
506
|
+
type: string
|
|
507
|
+
format: date-time
|
|
508
|
+
example: "2024-01-15T11:00:00Z"
|
|
403
509
|
400:
|
|
404
|
-
|
|
510
|
+
description: Invalid data format or validation error
|
|
405
511
|
"""
|
|
406
512
|
try:
|
|
407
513
|
data = self.get_arguments()
|
|
@@ -432,24 +538,25 @@ class BaseModelResource(Resource, ArgsMixin):
|
|
|
432
538
|
@jwt_required()
|
|
433
539
|
def delete(self, instance_id):
|
|
434
540
|
"""
|
|
435
|
-
Delete
|
|
541
|
+
Delete model
|
|
436
542
|
---
|
|
437
543
|
tags:
|
|
438
544
|
- Crud
|
|
545
|
+
description: Delete a model instance by its ID. Returns empty
|
|
546
|
+
response on success.
|
|
439
547
|
parameters:
|
|
440
548
|
- in: path
|
|
441
549
|
name: instance_id
|
|
442
|
-
required:
|
|
443
|
-
|
|
444
|
-
|
|
550
|
+
required: true
|
|
551
|
+
schema:
|
|
552
|
+
type: string
|
|
553
|
+
format: uuid
|
|
445
554
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
446
555
|
responses:
|
|
447
556
|
204:
|
|
448
|
-
|
|
557
|
+
description: Model deleted successfully
|
|
449
558
|
400:
|
|
450
|
-
|
|
451
|
-
404:
|
|
452
|
-
description: Instance non-existant
|
|
559
|
+
description: Integrity error or cannot delete
|
|
453
560
|
"""
|
|
454
561
|
instance = self.get_model_or_404(instance_id)
|
|
455
562
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.blueprints.crud.base import BaseModelsResource, BaseModelResource
|
|
2
4
|
|
|
3
5
|
from zou.app.models.salary_scale import Budget
|
|
@@ -7,6 +9,138 @@ class BudgetsResource(BaseModelsResource):
|
|
|
7
9
|
def __init__(self):
|
|
8
10
|
BaseModelsResource.__init__(self, Budget)
|
|
9
11
|
|
|
12
|
+
@jwt_required()
|
|
13
|
+
def get(self):
|
|
14
|
+
"""
|
|
15
|
+
Get budgets
|
|
16
|
+
---
|
|
17
|
+
tags:
|
|
18
|
+
- Crud
|
|
19
|
+
description: Retrieve all budgets. Supports filtering via query
|
|
20
|
+
parameters and pagination.
|
|
21
|
+
parameters:
|
|
22
|
+
- in: query
|
|
23
|
+
name: page
|
|
24
|
+
required: false
|
|
25
|
+
schema:
|
|
26
|
+
type: integer
|
|
27
|
+
example: 1
|
|
28
|
+
description: Page number for pagination
|
|
29
|
+
- in: query
|
|
30
|
+
name: limit
|
|
31
|
+
required: false
|
|
32
|
+
schema:
|
|
33
|
+
type: integer
|
|
34
|
+
example: 50
|
|
35
|
+
description: Number of results per page
|
|
36
|
+
- in: query
|
|
37
|
+
name: relations
|
|
38
|
+
required: false
|
|
39
|
+
schema:
|
|
40
|
+
type: boolean
|
|
41
|
+
default: false
|
|
42
|
+
example: false
|
|
43
|
+
description: Whether to include relations
|
|
44
|
+
responses:
|
|
45
|
+
200:
|
|
46
|
+
description: Budgets retrieved successfully
|
|
47
|
+
content:
|
|
48
|
+
application/json:
|
|
49
|
+
schema:
|
|
50
|
+
oneOf:
|
|
51
|
+
- type: array
|
|
52
|
+
items:
|
|
53
|
+
type: object
|
|
54
|
+
- type: object
|
|
55
|
+
properties:
|
|
56
|
+
data:
|
|
57
|
+
type: array
|
|
58
|
+
items:
|
|
59
|
+
type: object
|
|
60
|
+
example: []
|
|
61
|
+
total:
|
|
62
|
+
type: integer
|
|
63
|
+
example: 100
|
|
64
|
+
nb_pages:
|
|
65
|
+
type: integer
|
|
66
|
+
example: 2
|
|
67
|
+
limit:
|
|
68
|
+
type: integer
|
|
69
|
+
example: 50
|
|
70
|
+
offset:
|
|
71
|
+
type: integer
|
|
72
|
+
example: 0
|
|
73
|
+
page:
|
|
74
|
+
type: integer
|
|
75
|
+
example: 1
|
|
76
|
+
400:
|
|
77
|
+
description: Invalid filter format or query error
|
|
78
|
+
"""
|
|
79
|
+
return super().get()
|
|
80
|
+
|
|
81
|
+
@jwt_required()
|
|
82
|
+
def post(self):
|
|
83
|
+
"""
|
|
84
|
+
Create budget
|
|
85
|
+
---
|
|
86
|
+
tags:
|
|
87
|
+
- Crud
|
|
88
|
+
description: Create a new budget with data provided in the request
|
|
89
|
+
body. JSON format is expected.
|
|
90
|
+
requestBody:
|
|
91
|
+
required: true
|
|
92
|
+
content:
|
|
93
|
+
application/json:
|
|
94
|
+
schema:
|
|
95
|
+
type: object
|
|
96
|
+
required:
|
|
97
|
+
- project_id
|
|
98
|
+
properties:
|
|
99
|
+
project_id:
|
|
100
|
+
type: string
|
|
101
|
+
format: uuid
|
|
102
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
103
|
+
name:
|
|
104
|
+
type: string
|
|
105
|
+
example: Budget Q1
|
|
106
|
+
revision:
|
|
107
|
+
type: integer
|
|
108
|
+
example: 1
|
|
109
|
+
responses:
|
|
110
|
+
201:
|
|
111
|
+
description: Budget created successfully
|
|
112
|
+
content:
|
|
113
|
+
application/json:
|
|
114
|
+
schema:
|
|
115
|
+
type: object
|
|
116
|
+
properties:
|
|
117
|
+
id:
|
|
118
|
+
type: string
|
|
119
|
+
format: uuid
|
|
120
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
121
|
+
project_id:
|
|
122
|
+
type: string
|
|
123
|
+
format: uuid
|
|
124
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
125
|
+
name:
|
|
126
|
+
type: string
|
|
127
|
+
example: Budget Q1
|
|
128
|
+
revision:
|
|
129
|
+
type: integer
|
|
130
|
+
example: 1
|
|
131
|
+
created_at:
|
|
132
|
+
type: string
|
|
133
|
+
format: date-time
|
|
134
|
+
example: "2024-01-15T10:30:00Z"
|
|
135
|
+
updated_at:
|
|
136
|
+
type: string
|
|
137
|
+
format: date-time
|
|
138
|
+
example: "2024-01-15T10:30:00Z"
|
|
139
|
+
400:
|
|
140
|
+
description: Invalid data format or validation error
|
|
141
|
+
"""
|
|
142
|
+
return super().post()
|
|
143
|
+
|
|
10
144
|
|
|
11
145
|
class BudgetResource(BaseModelResource):
|
|
12
146
|
protected_fields = [
|
|
@@ -19,3 +153,147 @@ class BudgetResource(BaseModelResource):
|
|
|
19
153
|
|
|
20
154
|
def __init__(self):
|
|
21
155
|
BaseModelResource.__init__(self, Budget)
|
|
156
|
+
|
|
157
|
+
@jwt_required()
|
|
158
|
+
def get(self, instance_id):
|
|
159
|
+
"""
|
|
160
|
+
Get budget
|
|
161
|
+
---
|
|
162
|
+
tags:
|
|
163
|
+
- Crud
|
|
164
|
+
description: Retrieve a budget by its ID and return it as a JSON
|
|
165
|
+
object. Supports including relations.
|
|
166
|
+
parameters:
|
|
167
|
+
- in: path
|
|
168
|
+
name: instance_id
|
|
169
|
+
required: true
|
|
170
|
+
schema:
|
|
171
|
+
type: string
|
|
172
|
+
format: uuid
|
|
173
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
174
|
+
- in: query
|
|
175
|
+
name: relations
|
|
176
|
+
required: false
|
|
177
|
+
schema:
|
|
178
|
+
type: boolean
|
|
179
|
+
default: true
|
|
180
|
+
example: true
|
|
181
|
+
description: Whether to include relations
|
|
182
|
+
responses:
|
|
183
|
+
200:
|
|
184
|
+
description: Budget retrieved successfully
|
|
185
|
+
content:
|
|
186
|
+
application/json:
|
|
187
|
+
schema:
|
|
188
|
+
type: object
|
|
189
|
+
properties:
|
|
190
|
+
id:
|
|
191
|
+
type: string
|
|
192
|
+
format: uuid
|
|
193
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
194
|
+
project_id:
|
|
195
|
+
type: string
|
|
196
|
+
format: uuid
|
|
197
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
198
|
+
name:
|
|
199
|
+
type: string
|
|
200
|
+
example: Budget Q1
|
|
201
|
+
revision:
|
|
202
|
+
type: integer
|
|
203
|
+
example: 1
|
|
204
|
+
created_at:
|
|
205
|
+
type: string
|
|
206
|
+
format: date-time
|
|
207
|
+
example: "2024-01-15T10:30:00Z"
|
|
208
|
+
updated_at:
|
|
209
|
+
type: string
|
|
210
|
+
format: date-time
|
|
211
|
+
example: "2024-01-15T10:30:00Z"
|
|
212
|
+
400:
|
|
213
|
+
description: Invalid ID format or query error
|
|
214
|
+
"""
|
|
215
|
+
return super().get(instance_id)
|
|
216
|
+
|
|
217
|
+
@jwt_required()
|
|
218
|
+
def put(self, instance_id):
|
|
219
|
+
"""
|
|
220
|
+
Update budget
|
|
221
|
+
---
|
|
222
|
+
tags:
|
|
223
|
+
- Crud
|
|
224
|
+
description: Update a budget with data provided in the request
|
|
225
|
+
body. JSON format is expected.
|
|
226
|
+
parameters:
|
|
227
|
+
- in: path
|
|
228
|
+
name: instance_id
|
|
229
|
+
required: true
|
|
230
|
+
schema:
|
|
231
|
+
type: string
|
|
232
|
+
format: uuid
|
|
233
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
234
|
+
requestBody:
|
|
235
|
+
required: true
|
|
236
|
+
content:
|
|
237
|
+
application/json:
|
|
238
|
+
schema:
|
|
239
|
+
type: object
|
|
240
|
+
properties:
|
|
241
|
+
name:
|
|
242
|
+
type: string
|
|
243
|
+
example: Updated Budget Q1
|
|
244
|
+
responses:
|
|
245
|
+
200:
|
|
246
|
+
description: Budget updated successfully
|
|
247
|
+
content:
|
|
248
|
+
application/json:
|
|
249
|
+
schema:
|
|
250
|
+
type: object
|
|
251
|
+
properties:
|
|
252
|
+
id:
|
|
253
|
+
type: string
|
|
254
|
+
format: uuid
|
|
255
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
256
|
+
project_id:
|
|
257
|
+
type: string
|
|
258
|
+
format: uuid
|
|
259
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
260
|
+
name:
|
|
261
|
+
type: string
|
|
262
|
+
example: Updated Budget Q1
|
|
263
|
+
created_at:
|
|
264
|
+
type: string
|
|
265
|
+
format: date-time
|
|
266
|
+
example: "2024-01-15T10:30:00Z"
|
|
267
|
+
updated_at:
|
|
268
|
+
type: string
|
|
269
|
+
format: date-time
|
|
270
|
+
example: "2024-01-15T11:00:00Z"
|
|
271
|
+
400:
|
|
272
|
+
description: Invalid data format or validation error
|
|
273
|
+
"""
|
|
274
|
+
return super().put(instance_id)
|
|
275
|
+
|
|
276
|
+
@jwt_required()
|
|
277
|
+
def delete(self, instance_id):
|
|
278
|
+
"""
|
|
279
|
+
Delete budget
|
|
280
|
+
---
|
|
281
|
+
tags:
|
|
282
|
+
- Crud
|
|
283
|
+
description: Delete a budget by its ID. Returns empty response on
|
|
284
|
+
success.
|
|
285
|
+
parameters:
|
|
286
|
+
- in: path
|
|
287
|
+
name: instance_id
|
|
288
|
+
required: true
|
|
289
|
+
schema:
|
|
290
|
+
type: string
|
|
291
|
+
format: uuid
|
|
292
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
293
|
+
responses:
|
|
294
|
+
204:
|
|
295
|
+
description: Budget deleted successfully
|
|
296
|
+
400:
|
|
297
|
+
description: Integrity error or cannot delete
|
|
298
|
+
"""
|
|
299
|
+
return super().delete(instance_id)
|