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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.chat_message import ChatMessage
|
|
2
4
|
|
|
3
5
|
from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
@@ -7,7 +9,291 @@ class ChatMessagesResource(BaseModelsResource):
|
|
|
7
9
|
def __init__(self):
|
|
8
10
|
BaseModelsResource.__init__(self, ChatMessage)
|
|
9
11
|
|
|
12
|
+
@jwt_required()
|
|
13
|
+
def get(self):
|
|
14
|
+
"""
|
|
15
|
+
Get chat messages
|
|
16
|
+
---
|
|
17
|
+
tags:
|
|
18
|
+
- Crud
|
|
19
|
+
description: Retrieve all chat messages. Supports filtering via
|
|
20
|
+
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: Chat messages 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 chat message
|
|
85
|
+
---
|
|
86
|
+
tags:
|
|
87
|
+
- Crud
|
|
88
|
+
description: Create a new chat message with data provided in the
|
|
89
|
+
request body. JSON format is expected.
|
|
90
|
+
requestBody:
|
|
91
|
+
required: true
|
|
92
|
+
content:
|
|
93
|
+
application/json:
|
|
94
|
+
schema:
|
|
95
|
+
type: object
|
|
96
|
+
required:
|
|
97
|
+
- chat_id
|
|
98
|
+
- person_id
|
|
99
|
+
properties:
|
|
100
|
+
chat_id:
|
|
101
|
+
type: string
|
|
102
|
+
format: uuid
|
|
103
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
104
|
+
person_id:
|
|
105
|
+
type: string
|
|
106
|
+
format: uuid
|
|
107
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
108
|
+
text:
|
|
109
|
+
type: string
|
|
110
|
+
example: Message text
|
|
111
|
+
responses:
|
|
112
|
+
201:
|
|
113
|
+
description: Chat message created successfully
|
|
114
|
+
content:
|
|
115
|
+
application/json:
|
|
116
|
+
schema:
|
|
117
|
+
type: object
|
|
118
|
+
properties:
|
|
119
|
+
id:
|
|
120
|
+
type: string
|
|
121
|
+
format: uuid
|
|
122
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
123
|
+
chat_id:
|
|
124
|
+
type: string
|
|
125
|
+
format: uuid
|
|
126
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
127
|
+
person_id:
|
|
128
|
+
type: string
|
|
129
|
+
format: uuid
|
|
130
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
131
|
+
text:
|
|
132
|
+
type: string
|
|
133
|
+
example: Message text
|
|
134
|
+
created_at:
|
|
135
|
+
type: string
|
|
136
|
+
format: date-time
|
|
137
|
+
example: "2024-01-15T10:30:00Z"
|
|
138
|
+
updated_at:
|
|
139
|
+
type: string
|
|
140
|
+
format: date-time
|
|
141
|
+
example: "2024-01-15T10:30:00Z"
|
|
142
|
+
400:
|
|
143
|
+
description: Invalid data format or validation error
|
|
144
|
+
"""
|
|
145
|
+
return super().post()
|
|
146
|
+
|
|
10
147
|
|
|
11
148
|
class ChatMessageResource(BaseModelResource):
|
|
12
149
|
def __init__(self):
|
|
13
150
|
BaseModelResource.__init__(self, ChatMessage)
|
|
151
|
+
|
|
152
|
+
@jwt_required()
|
|
153
|
+
def get(self, instance_id):
|
|
154
|
+
"""
|
|
155
|
+
Get chat message
|
|
156
|
+
---
|
|
157
|
+
tags:
|
|
158
|
+
- Crud
|
|
159
|
+
description: Retrieve a chat message by its ID and return it as a
|
|
160
|
+
JSON object. Supports including relations.
|
|
161
|
+
parameters:
|
|
162
|
+
- in: path
|
|
163
|
+
name: instance_id
|
|
164
|
+
required: true
|
|
165
|
+
schema:
|
|
166
|
+
type: string
|
|
167
|
+
format: uuid
|
|
168
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
169
|
+
- in: query
|
|
170
|
+
name: relations
|
|
171
|
+
required: false
|
|
172
|
+
schema:
|
|
173
|
+
type: boolean
|
|
174
|
+
default: true
|
|
175
|
+
example: true
|
|
176
|
+
description: Whether to include relations
|
|
177
|
+
responses:
|
|
178
|
+
200:
|
|
179
|
+
description: Chat message retrieved successfully
|
|
180
|
+
content:
|
|
181
|
+
application/json:
|
|
182
|
+
schema:
|
|
183
|
+
type: object
|
|
184
|
+
properties:
|
|
185
|
+
id:
|
|
186
|
+
type: string
|
|
187
|
+
format: uuid
|
|
188
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
189
|
+
chat_id:
|
|
190
|
+
type: string
|
|
191
|
+
format: uuid
|
|
192
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
193
|
+
person_id:
|
|
194
|
+
type: string
|
|
195
|
+
format: uuid
|
|
196
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
197
|
+
text:
|
|
198
|
+
type: string
|
|
199
|
+
example: Message text
|
|
200
|
+
created_at:
|
|
201
|
+
type: string
|
|
202
|
+
format: date-time
|
|
203
|
+
example: "2024-01-15T10:30:00Z"
|
|
204
|
+
updated_at:
|
|
205
|
+
type: string
|
|
206
|
+
format: date-time
|
|
207
|
+
example: "2024-01-15T10:30:00Z"
|
|
208
|
+
400:
|
|
209
|
+
description: Invalid ID format or query error
|
|
210
|
+
"""
|
|
211
|
+
return super().get(instance_id)
|
|
212
|
+
|
|
213
|
+
@jwt_required()
|
|
214
|
+
def put(self, instance_id):
|
|
215
|
+
"""
|
|
216
|
+
Update chat message
|
|
217
|
+
---
|
|
218
|
+
tags:
|
|
219
|
+
- Crud
|
|
220
|
+
description: Update a chat message with data provided in the
|
|
221
|
+
request body. JSON format is expected.
|
|
222
|
+
parameters:
|
|
223
|
+
- in: path
|
|
224
|
+
name: instance_id
|
|
225
|
+
required: true
|
|
226
|
+
schema:
|
|
227
|
+
type: string
|
|
228
|
+
format: uuid
|
|
229
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
230
|
+
requestBody:
|
|
231
|
+
required: true
|
|
232
|
+
content:
|
|
233
|
+
application/json:
|
|
234
|
+
schema:
|
|
235
|
+
type: object
|
|
236
|
+
properties:
|
|
237
|
+
text:
|
|
238
|
+
type: string
|
|
239
|
+
example: Updated message text
|
|
240
|
+
responses:
|
|
241
|
+
200:
|
|
242
|
+
description: Chat message updated successfully
|
|
243
|
+
content:
|
|
244
|
+
application/json:
|
|
245
|
+
schema:
|
|
246
|
+
type: object
|
|
247
|
+
properties:
|
|
248
|
+
id:
|
|
249
|
+
type: string
|
|
250
|
+
format: uuid
|
|
251
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
252
|
+
chat_id:
|
|
253
|
+
type: string
|
|
254
|
+
format: uuid
|
|
255
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
256
|
+
person_id:
|
|
257
|
+
type: string
|
|
258
|
+
format: uuid
|
|
259
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
260
|
+
text:
|
|
261
|
+
type: string
|
|
262
|
+
example: Updated message text
|
|
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 chat message
|
|
280
|
+
---
|
|
281
|
+
tags:
|
|
282
|
+
- Crud
|
|
283
|
+
description: Delete a chat message by its ID. Returns empty
|
|
284
|
+
response on 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: Chat message deleted successfully
|
|
296
|
+
400:
|
|
297
|
+
description: Integrity error or cannot delete
|
|
298
|
+
"""
|
|
299
|
+
return super().delete(instance_id)
|
|
@@ -22,12 +22,305 @@ class CommentsResource(BaseModelsResource):
|
|
|
22
22
|
def __init__(self):
|
|
23
23
|
BaseModelsResource.__init__(self, Comment)
|
|
24
24
|
|
|
25
|
+
@jwt_required()
|
|
26
|
+
def get(self):
|
|
27
|
+
"""
|
|
28
|
+
Get comments
|
|
29
|
+
---
|
|
30
|
+
tags:
|
|
31
|
+
- Crud
|
|
32
|
+
description: Retrieve all comments. Supports filtering via query
|
|
33
|
+
parameters and pagination.
|
|
34
|
+
parameters:
|
|
35
|
+
- in: query
|
|
36
|
+
name: page
|
|
37
|
+
required: false
|
|
38
|
+
schema:
|
|
39
|
+
type: integer
|
|
40
|
+
example: 1
|
|
41
|
+
description: Page number for pagination
|
|
42
|
+
- in: query
|
|
43
|
+
name: limit
|
|
44
|
+
required: false
|
|
45
|
+
schema:
|
|
46
|
+
type: integer
|
|
47
|
+
example: 50
|
|
48
|
+
description: Number of results per page
|
|
49
|
+
- in: query
|
|
50
|
+
name: relations
|
|
51
|
+
required: false
|
|
52
|
+
schema:
|
|
53
|
+
type: boolean
|
|
54
|
+
default: false
|
|
55
|
+
example: false
|
|
56
|
+
description: Whether to include relations
|
|
57
|
+
responses:
|
|
58
|
+
200:
|
|
59
|
+
description: Comments retrieved successfully
|
|
60
|
+
content:
|
|
61
|
+
application/json:
|
|
62
|
+
schema:
|
|
63
|
+
oneOf:
|
|
64
|
+
- type: array
|
|
65
|
+
items:
|
|
66
|
+
type: object
|
|
67
|
+
- type: object
|
|
68
|
+
properties:
|
|
69
|
+
data:
|
|
70
|
+
type: array
|
|
71
|
+
items:
|
|
72
|
+
type: object
|
|
73
|
+
example: []
|
|
74
|
+
total:
|
|
75
|
+
type: integer
|
|
76
|
+
example: 100
|
|
77
|
+
nb_pages:
|
|
78
|
+
type: integer
|
|
79
|
+
example: 2
|
|
80
|
+
limit:
|
|
81
|
+
type: integer
|
|
82
|
+
example: 50
|
|
83
|
+
offset:
|
|
84
|
+
type: integer
|
|
85
|
+
example: 0
|
|
86
|
+
page:
|
|
87
|
+
type: integer
|
|
88
|
+
example: 1
|
|
89
|
+
400:
|
|
90
|
+
description: Invalid filter format or query error
|
|
91
|
+
"""
|
|
92
|
+
return super().get()
|
|
93
|
+
|
|
94
|
+
@jwt_required()
|
|
95
|
+
def post(self):
|
|
96
|
+
"""
|
|
97
|
+
Create comment
|
|
98
|
+
---
|
|
99
|
+
tags:
|
|
100
|
+
- Crud
|
|
101
|
+
description: Create a new comment with data provided in the request
|
|
102
|
+
body. JSON format is expected.
|
|
103
|
+
requestBody:
|
|
104
|
+
required: true
|
|
105
|
+
content:
|
|
106
|
+
application/json:
|
|
107
|
+
schema:
|
|
108
|
+
type: object
|
|
109
|
+
required:
|
|
110
|
+
- object_id
|
|
111
|
+
- person_id
|
|
112
|
+
- task_status_id
|
|
113
|
+
properties:
|
|
114
|
+
object_id:
|
|
115
|
+
type: string
|
|
116
|
+
format: uuid
|
|
117
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
118
|
+
person_id:
|
|
119
|
+
type: string
|
|
120
|
+
format: uuid
|
|
121
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
122
|
+
task_status_id:
|
|
123
|
+
type: string
|
|
124
|
+
format: uuid
|
|
125
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
126
|
+
text:
|
|
127
|
+
type: string
|
|
128
|
+
example: Comment text
|
|
129
|
+
responses:
|
|
130
|
+
201:
|
|
131
|
+
description: Comment created successfully
|
|
132
|
+
content:
|
|
133
|
+
application/json:
|
|
134
|
+
schema:
|
|
135
|
+
type: object
|
|
136
|
+
properties:
|
|
137
|
+
id:
|
|
138
|
+
type: string
|
|
139
|
+
format: uuid
|
|
140
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
141
|
+
object_id:
|
|
142
|
+
type: string
|
|
143
|
+
format: uuid
|
|
144
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
145
|
+
person_id:
|
|
146
|
+
type: string
|
|
147
|
+
format: uuid
|
|
148
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
149
|
+
task_status_id:
|
|
150
|
+
type: string
|
|
151
|
+
format: uuid
|
|
152
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
153
|
+
text:
|
|
154
|
+
type: string
|
|
155
|
+
example: Comment text
|
|
156
|
+
created_at:
|
|
157
|
+
type: string
|
|
158
|
+
format: date-time
|
|
159
|
+
example: "2024-01-15T10:30:00Z"
|
|
160
|
+
updated_at:
|
|
161
|
+
type: string
|
|
162
|
+
format: date-time
|
|
163
|
+
example: "2024-01-15T10:30:00Z"
|
|
164
|
+
400:
|
|
165
|
+
description: Invalid data format or validation error
|
|
166
|
+
"""
|
|
167
|
+
return super().post()
|
|
168
|
+
|
|
25
169
|
|
|
26
170
|
class CommentResource(BaseModelResource):
|
|
27
171
|
def __init__(self):
|
|
28
172
|
BaseModelResource.__init__(self, Comment)
|
|
29
173
|
self.protected_fields += ["mentions", "department_mentions"]
|
|
30
174
|
|
|
175
|
+
@jwt_required()
|
|
176
|
+
def get(self, instance_id):
|
|
177
|
+
"""
|
|
178
|
+
Get comment
|
|
179
|
+
---
|
|
180
|
+
tags:
|
|
181
|
+
- Crud
|
|
182
|
+
description: Retrieve a comment by its ID and return it as a JSON
|
|
183
|
+
object. Supports including relations. Client users can only see
|
|
184
|
+
their own comments or comments from other clients.
|
|
185
|
+
parameters:
|
|
186
|
+
- in: path
|
|
187
|
+
name: instance_id
|
|
188
|
+
required: true
|
|
189
|
+
schema:
|
|
190
|
+
type: string
|
|
191
|
+
format: uuid
|
|
192
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
193
|
+
- in: query
|
|
194
|
+
name: relations
|
|
195
|
+
required: false
|
|
196
|
+
schema:
|
|
197
|
+
type: boolean
|
|
198
|
+
default: true
|
|
199
|
+
example: true
|
|
200
|
+
description: Whether to include relations
|
|
201
|
+
responses:
|
|
202
|
+
200:
|
|
203
|
+
description: Comment retrieved successfully
|
|
204
|
+
content:
|
|
205
|
+
application/json:
|
|
206
|
+
schema:
|
|
207
|
+
type: object
|
|
208
|
+
properties:
|
|
209
|
+
id:
|
|
210
|
+
type: string
|
|
211
|
+
format: uuid
|
|
212
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
213
|
+
object_id:
|
|
214
|
+
type: string
|
|
215
|
+
format: uuid
|
|
216
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
217
|
+
person_id:
|
|
218
|
+
type: string
|
|
219
|
+
format: uuid
|
|
220
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
221
|
+
task_status_id:
|
|
222
|
+
type: string
|
|
223
|
+
format: uuid
|
|
224
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
225
|
+
text:
|
|
226
|
+
type: string
|
|
227
|
+
example: Comment text
|
|
228
|
+
created_at:
|
|
229
|
+
type: string
|
|
230
|
+
format: date-time
|
|
231
|
+
example: "2024-01-15T10:30:00Z"
|
|
232
|
+
updated_at:
|
|
233
|
+
type: string
|
|
234
|
+
format: date-time
|
|
235
|
+
example: "2024-01-15T10:30:00Z"
|
|
236
|
+
400:
|
|
237
|
+
description: Invalid ID format or query error
|
|
238
|
+
"""
|
|
239
|
+
return super().get(instance_id)
|
|
240
|
+
|
|
241
|
+
@jwt_required()
|
|
242
|
+
def put(self, instance_id):
|
|
243
|
+
"""
|
|
244
|
+
Update comment
|
|
245
|
+
---
|
|
246
|
+
tags:
|
|
247
|
+
- Crud
|
|
248
|
+
description: Update a comment with data provided in the request
|
|
249
|
+
body. JSON format is expected. May update task status if
|
|
250
|
+
task_status_id is changed.
|
|
251
|
+
parameters:
|
|
252
|
+
- in: path
|
|
253
|
+
name: instance_id
|
|
254
|
+
required: true
|
|
255
|
+
schema:
|
|
256
|
+
type: string
|
|
257
|
+
format: uuid
|
|
258
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
259
|
+
requestBody:
|
|
260
|
+
required: true
|
|
261
|
+
content:
|
|
262
|
+
application/json:
|
|
263
|
+
schema:
|
|
264
|
+
type: object
|
|
265
|
+
properties:
|
|
266
|
+
text:
|
|
267
|
+
type: string
|
|
268
|
+
example: Updated comment text
|
|
269
|
+
task_status_id:
|
|
270
|
+
type: string
|
|
271
|
+
format: uuid
|
|
272
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
273
|
+
pinned:
|
|
274
|
+
type: boolean
|
|
275
|
+
example: true
|
|
276
|
+
checklist:
|
|
277
|
+
type: array
|
|
278
|
+
items:
|
|
279
|
+
type: object
|
|
280
|
+
example: [{"text": "Item 1", "checked": false}]
|
|
281
|
+
responses:
|
|
282
|
+
200:
|
|
283
|
+
description: Comment updated successfully
|
|
284
|
+
content:
|
|
285
|
+
application/json:
|
|
286
|
+
schema:
|
|
287
|
+
type: object
|
|
288
|
+
properties:
|
|
289
|
+
id:
|
|
290
|
+
type: string
|
|
291
|
+
format: uuid
|
|
292
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
293
|
+
object_id:
|
|
294
|
+
type: string
|
|
295
|
+
format: uuid
|
|
296
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
297
|
+
person_id:
|
|
298
|
+
type: string
|
|
299
|
+
format: uuid
|
|
300
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
301
|
+
task_status_id:
|
|
302
|
+
type: string
|
|
303
|
+
format: uuid
|
|
304
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
305
|
+
text:
|
|
306
|
+
type: string
|
|
307
|
+
example: Updated comment text
|
|
308
|
+
pinned:
|
|
309
|
+
type: boolean
|
|
310
|
+
example: true
|
|
311
|
+
created_at:
|
|
312
|
+
type: string
|
|
313
|
+
format: date-time
|
|
314
|
+
example: "2024-01-15T10:30:00Z"
|
|
315
|
+
updated_at:
|
|
316
|
+
type: string
|
|
317
|
+
format: date-time
|
|
318
|
+
example: "2024-01-15T11:00:00Z"
|
|
319
|
+
400:
|
|
320
|
+
description: Invalid data format or validation error
|
|
321
|
+
"""
|
|
322
|
+
return super().put(instance_id)
|
|
323
|
+
|
|
31
324
|
def get_serialized_instance(self, instance_id, relations=True):
|
|
32
325
|
return tasks_service.get_comment(instance_id, relations=relations)
|
|
33
326
|
|
|
@@ -197,7 +490,25 @@ class CommentResource(BaseModelResource):
|
|
|
197
490
|
@jwt_required()
|
|
198
491
|
def delete(self, instance_id):
|
|
199
492
|
"""
|
|
200
|
-
Delete
|
|
493
|
+
Delete comment
|
|
494
|
+
---
|
|
495
|
+
tags:
|
|
496
|
+
- Crud
|
|
497
|
+
description: Delete a comment by its ID. Returns empty response
|
|
498
|
+
on success. Updates task status if comment had status change.
|
|
499
|
+
parameters:
|
|
500
|
+
- in: path
|
|
501
|
+
name: instance_id
|
|
502
|
+
required: true
|
|
503
|
+
schema:
|
|
504
|
+
type: string
|
|
505
|
+
format: uuid
|
|
506
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
507
|
+
responses:
|
|
508
|
+
204:
|
|
509
|
+
description: Comment deleted successfully
|
|
510
|
+
400:
|
|
511
|
+
description: Cannot delete comment or integrity error
|
|
201
512
|
"""
|
|
202
513
|
comment = tasks_service.get_comment(instance_id)
|
|
203
514
|
task = tasks_service.get_task(comment["object_id"])
|