zou 0.20.83__py3-none-any.whl → 0.20.85__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zou/__init__.py +1 -1
- zou/app/blueprints/comments/resources.py +32 -35
- zou/app/blueprints/concepts/resources.py +23 -8
- 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/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/news/resources.py +7 -5
- 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/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/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/METADATA +18 -18
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/RECORD +103 -102
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/WHEEL +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/entry_points.txt +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.search_filter_group import SearchFilterGroup
|
|
2
4
|
|
|
3
5
|
from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
@@ -7,7 +9,275 @@ class SearchFilterGroupsResource(BaseModelsResource):
|
|
|
7
9
|
def __init__(self):
|
|
8
10
|
BaseModelsResource.__init__(self, SearchFilterGroup)
|
|
9
11
|
|
|
12
|
+
@jwt_required()
|
|
13
|
+
def get(self):
|
|
14
|
+
"""
|
|
15
|
+
Get search filter groups
|
|
16
|
+
---
|
|
17
|
+
tags:
|
|
18
|
+
- Crud
|
|
19
|
+
description: Retrieve all search filter groups. Supports
|
|
20
|
+
filtering via query 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: Search filter groups 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 search filter group
|
|
85
|
+
---
|
|
86
|
+
tags:
|
|
87
|
+
- Crud
|
|
88
|
+
description: Create a new search filter group with data
|
|
89
|
+
provided in the request body. JSON format is expected.
|
|
90
|
+
requestBody:
|
|
91
|
+
required: true
|
|
92
|
+
content:
|
|
93
|
+
application/json:
|
|
94
|
+
schema:
|
|
95
|
+
type: object
|
|
96
|
+
required:
|
|
97
|
+
- name
|
|
98
|
+
- person_id
|
|
99
|
+
properties:
|
|
100
|
+
name:
|
|
101
|
+
type: string
|
|
102
|
+
example: My Filter Group
|
|
103
|
+
person_id:
|
|
104
|
+
type: string
|
|
105
|
+
format: uuid
|
|
106
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
107
|
+
responses:
|
|
108
|
+
201:
|
|
109
|
+
description: Search filter group created successfully
|
|
110
|
+
content:
|
|
111
|
+
application/json:
|
|
112
|
+
schema:
|
|
113
|
+
type: object
|
|
114
|
+
properties:
|
|
115
|
+
id:
|
|
116
|
+
type: string
|
|
117
|
+
format: uuid
|
|
118
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
119
|
+
name:
|
|
120
|
+
type: string
|
|
121
|
+
example: My Filter Group
|
|
122
|
+
person_id:
|
|
123
|
+
type: string
|
|
124
|
+
format: uuid
|
|
125
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
126
|
+
created_at:
|
|
127
|
+
type: string
|
|
128
|
+
format: date-time
|
|
129
|
+
example: "2024-01-15T10:30:00Z"
|
|
130
|
+
updated_at:
|
|
131
|
+
type: string
|
|
132
|
+
format: date-time
|
|
133
|
+
example: "2024-01-15T10:30:00Z"
|
|
134
|
+
400:
|
|
135
|
+
description: Invalid data format or validation error
|
|
136
|
+
"""
|
|
137
|
+
return super().post()
|
|
138
|
+
|
|
10
139
|
|
|
11
140
|
class SearchFilterGroupResource(BaseModelResource):
|
|
12
141
|
def __init__(self):
|
|
13
142
|
BaseModelResource.__init__(self, SearchFilterGroup)
|
|
143
|
+
|
|
144
|
+
@jwt_required()
|
|
145
|
+
def get(self, instance_id):
|
|
146
|
+
"""
|
|
147
|
+
Get search filter group
|
|
148
|
+
---
|
|
149
|
+
tags:
|
|
150
|
+
- Crud
|
|
151
|
+
description: Retrieve a search filter group by its ID and
|
|
152
|
+
return it as a JSON object. Supports including relations.
|
|
153
|
+
parameters:
|
|
154
|
+
- in: path
|
|
155
|
+
name: instance_id
|
|
156
|
+
required: true
|
|
157
|
+
schema:
|
|
158
|
+
type: string
|
|
159
|
+
format: uuid
|
|
160
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
161
|
+
- in: query
|
|
162
|
+
name: relations
|
|
163
|
+
required: false
|
|
164
|
+
schema:
|
|
165
|
+
type: boolean
|
|
166
|
+
default: true
|
|
167
|
+
example: true
|
|
168
|
+
description: Whether to include relations
|
|
169
|
+
responses:
|
|
170
|
+
200:
|
|
171
|
+
description: Search filter group retrieved successfully
|
|
172
|
+
content:
|
|
173
|
+
application/json:
|
|
174
|
+
schema:
|
|
175
|
+
type: object
|
|
176
|
+
properties:
|
|
177
|
+
id:
|
|
178
|
+
type: string
|
|
179
|
+
format: uuid
|
|
180
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
181
|
+
name:
|
|
182
|
+
type: string
|
|
183
|
+
example: My Filter Group
|
|
184
|
+
person_id:
|
|
185
|
+
type: string
|
|
186
|
+
format: uuid
|
|
187
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
188
|
+
created_at:
|
|
189
|
+
type: string
|
|
190
|
+
format: date-time
|
|
191
|
+
example: "2024-01-15T10:30:00Z"
|
|
192
|
+
updated_at:
|
|
193
|
+
type: string
|
|
194
|
+
format: date-time
|
|
195
|
+
example: "2024-01-15T10:30:00Z"
|
|
196
|
+
400:
|
|
197
|
+
description: Invalid ID format or query error
|
|
198
|
+
"""
|
|
199
|
+
return super().get(instance_id)
|
|
200
|
+
|
|
201
|
+
@jwt_required()
|
|
202
|
+
def put(self, instance_id):
|
|
203
|
+
"""
|
|
204
|
+
Update search filter group
|
|
205
|
+
---
|
|
206
|
+
tags:
|
|
207
|
+
- Crud
|
|
208
|
+
description: Update a search filter group with data provided
|
|
209
|
+
in the request body. JSON format is expected.
|
|
210
|
+
parameters:
|
|
211
|
+
- in: path
|
|
212
|
+
name: instance_id
|
|
213
|
+
required: true
|
|
214
|
+
schema:
|
|
215
|
+
type: string
|
|
216
|
+
format: uuid
|
|
217
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
218
|
+
requestBody:
|
|
219
|
+
required: true
|
|
220
|
+
content:
|
|
221
|
+
application/json:
|
|
222
|
+
schema:
|
|
223
|
+
type: object
|
|
224
|
+
properties:
|
|
225
|
+
name:
|
|
226
|
+
type: string
|
|
227
|
+
example: Updated Filter Group Name
|
|
228
|
+
responses:
|
|
229
|
+
200:
|
|
230
|
+
description: Search filter group updated successfully
|
|
231
|
+
content:
|
|
232
|
+
application/json:
|
|
233
|
+
schema:
|
|
234
|
+
type: object
|
|
235
|
+
properties:
|
|
236
|
+
id:
|
|
237
|
+
type: string
|
|
238
|
+
format: uuid
|
|
239
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
240
|
+
name:
|
|
241
|
+
type: string
|
|
242
|
+
example: Updated Filter Group Name
|
|
243
|
+
person_id:
|
|
244
|
+
type: string
|
|
245
|
+
format: uuid
|
|
246
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
247
|
+
created_at:
|
|
248
|
+
type: string
|
|
249
|
+
format: date-time
|
|
250
|
+
example: "2024-01-15T10:30:00Z"
|
|
251
|
+
updated_at:
|
|
252
|
+
type: string
|
|
253
|
+
format: date-time
|
|
254
|
+
example: "2024-01-15T11:00:00Z"
|
|
255
|
+
400:
|
|
256
|
+
description: Invalid data format or validation error
|
|
257
|
+
"""
|
|
258
|
+
return super().put(instance_id)
|
|
259
|
+
|
|
260
|
+
@jwt_required()
|
|
261
|
+
def delete(self, instance_id):
|
|
262
|
+
"""
|
|
263
|
+
Delete search filter group
|
|
264
|
+
---
|
|
265
|
+
tags:
|
|
266
|
+
- Crud
|
|
267
|
+
description: Delete a search filter group by its ID. Returns
|
|
268
|
+
empty response on success.
|
|
269
|
+
parameters:
|
|
270
|
+
- in: path
|
|
271
|
+
name: instance_id
|
|
272
|
+
required: true
|
|
273
|
+
schema:
|
|
274
|
+
type: string
|
|
275
|
+
format: uuid
|
|
276
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
277
|
+
responses:
|
|
278
|
+
204:
|
|
279
|
+
description: Search filter group deleted successfully
|
|
280
|
+
400:
|
|
281
|
+
description: Integrity error or cannot delete
|
|
282
|
+
"""
|
|
283
|
+
return super().delete(instance_id)
|
|
@@ -26,25 +26,45 @@ class SoftwareResource(BaseModelResource):
|
|
|
26
26
|
@jwt_required()
|
|
27
27
|
def get(self, instance_id):
|
|
28
28
|
"""
|
|
29
|
-
|
|
30
|
-
JSON object.
|
|
29
|
+
Get software
|
|
31
30
|
---
|
|
32
31
|
tags:
|
|
33
32
|
- Crud
|
|
33
|
+
description: Retrieve a software instance by its ID and return it
|
|
34
|
+
as a JSON object.
|
|
34
35
|
parameters:
|
|
35
36
|
- in: path
|
|
36
|
-
name:
|
|
37
|
-
required:
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
name: instance_id
|
|
38
|
+
required: true
|
|
39
|
+
schema:
|
|
40
|
+
type: string
|
|
41
|
+
format: uuid
|
|
40
42
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
41
43
|
responses:
|
|
42
44
|
200:
|
|
43
|
-
|
|
45
|
+
description: Software retrieved successfully
|
|
46
|
+
content:
|
|
47
|
+
application/json:
|
|
48
|
+
schema:
|
|
49
|
+
type: object
|
|
50
|
+
properties:
|
|
51
|
+
id:
|
|
52
|
+
type: string
|
|
53
|
+
format: uuid
|
|
54
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
55
|
+
name:
|
|
56
|
+
type: string
|
|
57
|
+
example: Maya
|
|
58
|
+
created_at:
|
|
59
|
+
type: string
|
|
60
|
+
format: date-time
|
|
61
|
+
example: "2024-01-15T10:30:00Z"
|
|
62
|
+
updated_at:
|
|
63
|
+
type: string
|
|
64
|
+
format: date-time
|
|
65
|
+
example: "2024-01-15T10:30:00Z"
|
|
44
66
|
400:
|
|
45
|
-
|
|
46
|
-
404:
|
|
47
|
-
description: Value error
|
|
67
|
+
description: Invalid ID format or query error
|
|
48
68
|
"""
|
|
49
69
|
try:
|
|
50
70
|
software = files_service.get_software(instance_id)
|
|
@@ -17,6 +17,149 @@ class StatusAutomationsResource(BaseModelsResource):
|
|
|
17
17
|
user_service.block_access_to_vendor()
|
|
18
18
|
return True
|
|
19
19
|
|
|
20
|
+
@jwt_required()
|
|
21
|
+
def get(self):
|
|
22
|
+
"""
|
|
23
|
+
Get status automations
|
|
24
|
+
---
|
|
25
|
+
tags:
|
|
26
|
+
- Crud
|
|
27
|
+
description: Retrieve all status automations. Supports filtering
|
|
28
|
+
via query parameters and pagination. Vendor access is blocked.
|
|
29
|
+
parameters:
|
|
30
|
+
- in: query
|
|
31
|
+
name: page
|
|
32
|
+
required: false
|
|
33
|
+
schema:
|
|
34
|
+
type: integer
|
|
35
|
+
example: 1
|
|
36
|
+
description: Page number for pagination
|
|
37
|
+
- in: query
|
|
38
|
+
name: limit
|
|
39
|
+
required: false
|
|
40
|
+
schema:
|
|
41
|
+
type: integer
|
|
42
|
+
example: 50
|
|
43
|
+
description: Number of results per page
|
|
44
|
+
- in: query
|
|
45
|
+
name: relations
|
|
46
|
+
required: false
|
|
47
|
+
schema:
|
|
48
|
+
type: boolean
|
|
49
|
+
default: false
|
|
50
|
+
example: false
|
|
51
|
+
description: Whether to include relations
|
|
52
|
+
responses:
|
|
53
|
+
200:
|
|
54
|
+
description: Status automations retrieved successfully
|
|
55
|
+
content:
|
|
56
|
+
application/json:
|
|
57
|
+
schema:
|
|
58
|
+
oneOf:
|
|
59
|
+
- type: array
|
|
60
|
+
items:
|
|
61
|
+
type: object
|
|
62
|
+
- type: object
|
|
63
|
+
properties:
|
|
64
|
+
data:
|
|
65
|
+
type: array
|
|
66
|
+
items:
|
|
67
|
+
type: object
|
|
68
|
+
example: []
|
|
69
|
+
total:
|
|
70
|
+
type: integer
|
|
71
|
+
example: 100
|
|
72
|
+
nb_pages:
|
|
73
|
+
type: integer
|
|
74
|
+
example: 2
|
|
75
|
+
limit:
|
|
76
|
+
type: integer
|
|
77
|
+
example: 50
|
|
78
|
+
offset:
|
|
79
|
+
type: integer
|
|
80
|
+
example: 0
|
|
81
|
+
page:
|
|
82
|
+
type: integer
|
|
83
|
+
example: 1
|
|
84
|
+
400:
|
|
85
|
+
description: Invalid filter format or query error
|
|
86
|
+
"""
|
|
87
|
+
return super().get()
|
|
88
|
+
|
|
89
|
+
@jwt_required()
|
|
90
|
+
def post(self):
|
|
91
|
+
"""
|
|
92
|
+
Create status automation
|
|
93
|
+
---
|
|
94
|
+
tags:
|
|
95
|
+
- Crud
|
|
96
|
+
description: Create a new status automation with data provided
|
|
97
|
+
in the request body. JSON format is expected.
|
|
98
|
+
requestBody:
|
|
99
|
+
required: true
|
|
100
|
+
content:
|
|
101
|
+
application/json:
|
|
102
|
+
schema:
|
|
103
|
+
type: object
|
|
104
|
+
required:
|
|
105
|
+
- source_task_status_id
|
|
106
|
+
- target_task_status_id
|
|
107
|
+
- field_name
|
|
108
|
+
- field_value
|
|
109
|
+
properties:
|
|
110
|
+
source_task_status_id:
|
|
111
|
+
type: string
|
|
112
|
+
format: uuid
|
|
113
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
114
|
+
target_task_status_id:
|
|
115
|
+
type: string
|
|
116
|
+
format: uuid
|
|
117
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
118
|
+
field_name:
|
|
119
|
+
type: string
|
|
120
|
+
example: ready_for
|
|
121
|
+
field_value:
|
|
122
|
+
type: string
|
|
123
|
+
example: production
|
|
124
|
+
responses:
|
|
125
|
+
201:
|
|
126
|
+
description: Status automation created successfully
|
|
127
|
+
content:
|
|
128
|
+
application/json:
|
|
129
|
+
schema:
|
|
130
|
+
type: object
|
|
131
|
+
properties:
|
|
132
|
+
id:
|
|
133
|
+
type: string
|
|
134
|
+
format: uuid
|
|
135
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
136
|
+
source_task_status_id:
|
|
137
|
+
type: string
|
|
138
|
+
format: uuid
|
|
139
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
140
|
+
target_task_status_id:
|
|
141
|
+
type: string
|
|
142
|
+
format: uuid
|
|
143
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
144
|
+
field_name:
|
|
145
|
+
type: string
|
|
146
|
+
example: ready_for
|
|
147
|
+
field_value:
|
|
148
|
+
type: string
|
|
149
|
+
example: production
|
|
150
|
+
created_at:
|
|
151
|
+
type: string
|
|
152
|
+
format: date-time
|
|
153
|
+
example: "2024-01-15T10:30:00Z"
|
|
154
|
+
updated_at:
|
|
155
|
+
type: string
|
|
156
|
+
format: date-time
|
|
157
|
+
example: "2024-01-15T10:30:00Z"
|
|
158
|
+
400:
|
|
159
|
+
description: Invalid data format or validation error
|
|
160
|
+
"""
|
|
161
|
+
return super().post()
|
|
162
|
+
|
|
20
163
|
def post_creation(self, status_automation):
|
|
21
164
|
status_automations_service.clear_status_automation_cache()
|
|
22
165
|
return status_automation.serialize()
|
|
@@ -26,6 +169,139 @@ class StatusAutomationResource(BaseModelResource):
|
|
|
26
169
|
def __init__(self):
|
|
27
170
|
BaseModelResource.__init__(self, StatusAutomation)
|
|
28
171
|
|
|
172
|
+
@jwt_required()
|
|
173
|
+
def get(self, instance_id):
|
|
174
|
+
"""
|
|
175
|
+
Get status automation
|
|
176
|
+
---
|
|
177
|
+
tags:
|
|
178
|
+
- Crud
|
|
179
|
+
description: Retrieve a status automation by its ID and return
|
|
180
|
+
it as a JSON object. Supports including relations.
|
|
181
|
+
parameters:
|
|
182
|
+
- in: path
|
|
183
|
+
name: instance_id
|
|
184
|
+
required: true
|
|
185
|
+
schema:
|
|
186
|
+
type: string
|
|
187
|
+
format: uuid
|
|
188
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
189
|
+
- in: query
|
|
190
|
+
name: relations
|
|
191
|
+
required: false
|
|
192
|
+
schema:
|
|
193
|
+
type: boolean
|
|
194
|
+
default: true
|
|
195
|
+
example: true
|
|
196
|
+
description: Whether to include relations
|
|
197
|
+
responses:
|
|
198
|
+
200:
|
|
199
|
+
description: Status automation retrieved successfully
|
|
200
|
+
content:
|
|
201
|
+
application/json:
|
|
202
|
+
schema:
|
|
203
|
+
type: object
|
|
204
|
+
properties:
|
|
205
|
+
id:
|
|
206
|
+
type: string
|
|
207
|
+
format: uuid
|
|
208
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
209
|
+
source_task_status_id:
|
|
210
|
+
type: string
|
|
211
|
+
format: uuid
|
|
212
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
213
|
+
target_task_status_id:
|
|
214
|
+
type: string
|
|
215
|
+
format: uuid
|
|
216
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
217
|
+
field_name:
|
|
218
|
+
type: string
|
|
219
|
+
example: ready_for
|
|
220
|
+
field_value:
|
|
221
|
+
type: string
|
|
222
|
+
example: production
|
|
223
|
+
created_at:
|
|
224
|
+
type: string
|
|
225
|
+
format: date-time
|
|
226
|
+
example: "2024-01-15T10:30:00Z"
|
|
227
|
+
updated_at:
|
|
228
|
+
type: string
|
|
229
|
+
format: date-time
|
|
230
|
+
example: "2024-01-15T10:30:00Z"
|
|
231
|
+
400:
|
|
232
|
+
description: Invalid ID format or query error
|
|
233
|
+
"""
|
|
234
|
+
return super().get(instance_id)
|
|
235
|
+
|
|
236
|
+
@jwt_required()
|
|
237
|
+
def put(self, instance_id):
|
|
238
|
+
"""
|
|
239
|
+
Update status automation
|
|
240
|
+
---
|
|
241
|
+
tags:
|
|
242
|
+
- Crud
|
|
243
|
+
description: Update a status automation with data provided in
|
|
244
|
+
the request body. JSON format is expected.
|
|
245
|
+
parameters:
|
|
246
|
+
- in: path
|
|
247
|
+
name: instance_id
|
|
248
|
+
required: true
|
|
249
|
+
schema:
|
|
250
|
+
type: string
|
|
251
|
+
format: uuid
|
|
252
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
253
|
+
requestBody:
|
|
254
|
+
required: true
|
|
255
|
+
content:
|
|
256
|
+
application/json:
|
|
257
|
+
schema:
|
|
258
|
+
type: object
|
|
259
|
+
properties:
|
|
260
|
+
field_name:
|
|
261
|
+
type: string
|
|
262
|
+
example: ready_for
|
|
263
|
+
field_value:
|
|
264
|
+
type: string
|
|
265
|
+
example: approved
|
|
266
|
+
responses:
|
|
267
|
+
200:
|
|
268
|
+
description: Status automation updated successfully
|
|
269
|
+
content:
|
|
270
|
+
application/json:
|
|
271
|
+
schema:
|
|
272
|
+
type: object
|
|
273
|
+
properties:
|
|
274
|
+
id:
|
|
275
|
+
type: string
|
|
276
|
+
format: uuid
|
|
277
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
278
|
+
source_task_status_id:
|
|
279
|
+
type: string
|
|
280
|
+
format: uuid
|
|
281
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
282
|
+
target_task_status_id:
|
|
283
|
+
type: string
|
|
284
|
+
format: uuid
|
|
285
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
286
|
+
field_name:
|
|
287
|
+
type: string
|
|
288
|
+
example: ready_for
|
|
289
|
+
field_value:
|
|
290
|
+
type: string
|
|
291
|
+
example: approved
|
|
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-15T11:00:00Z"
|
|
300
|
+
400:
|
|
301
|
+
description: Invalid data format or validation error
|
|
302
|
+
"""
|
|
303
|
+
return super().put(instance_id)
|
|
304
|
+
|
|
29
305
|
def post_update(self, status_automation, data):
|
|
30
306
|
status_automations_service.clear_status_automation_cache()
|
|
31
307
|
return status_automation
|
|
@@ -33,8 +309,26 @@ class StatusAutomationResource(BaseModelResource):
|
|
|
33
309
|
@jwt_required()
|
|
34
310
|
def delete(self, instance_id):
|
|
35
311
|
"""
|
|
36
|
-
Delete status automation
|
|
37
|
-
|
|
312
|
+
Delete status automation
|
|
313
|
+
---
|
|
314
|
+
tags:
|
|
315
|
+
- Crud
|
|
316
|
+
description: Delete a status automation by its ID. Returns empty
|
|
317
|
+
response on success. Cannot delete if automation is used in a
|
|
318
|
+
project.
|
|
319
|
+
parameters:
|
|
320
|
+
- in: path
|
|
321
|
+
name: instance_id
|
|
322
|
+
required: true
|
|
323
|
+
schema:
|
|
324
|
+
type: string
|
|
325
|
+
format: uuid
|
|
326
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
327
|
+
responses:
|
|
328
|
+
204:
|
|
329
|
+
description: Status automation deleted successfully
|
|
330
|
+
400:
|
|
331
|
+
description: Automation is used in a project or integrity error
|
|
38
332
|
"""
|
|
39
333
|
instance = self.get_model_or_404(instance_id)
|
|
40
334
|
instance_dict = instance.serialize()
|