forked from emanuelgestosa/lbaw-tudo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yaml
1684 lines (1554 loc) Β· 48.3 KB
/
api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
version: '1.0'
title: 'LBAW Tu-Do Web API'
description: 'Web Resources Specification (A7) for Tu-Do'
externalDocs:
description: Find more info here.
url: https://web.fe.up.pt/~ssn/wiki/teach/lbaw/medialib/a07
tags:
- name: 'M01: Authentication and Individual Profile'
- name: 'M02: Works'
- name: 'M03: Reviews and Wish list'
- name: 'M04: Loans'
- name: 'M05: Projects'
paths:
/projects/{project_id}:
get:
operationId: R501
summary: 'R501: Fetch project page'
description: 'Get the project page. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: project_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show Project page'
'401':
description: 'Cannot access this page.'
# Get the board page
/boards/{board_id}:
get:
operationId: R502
summary: 'R502: Fetch board page'
description: 'Get the board page. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: board_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show Board page'
'401':
description: 'Cannot access this page.'
# Get the task page
/task/{task_id}:
get:
operationId: R503
summary: 'R503: Fetch task page'
description: 'Get the task page. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: task_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show task page'
'401':
description: 'Cannot access this page.'
/users/{user_id}/add_project:
# Obter a page para adicionar um projeto
get:
operationId: R504
summary: 'R504: Fetch add project page'
description: 'Gets the add_project page with a form to add a new project. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: user_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show add_project page'
'401':
description: 'Cannot access this page.'
# Adiciona um projeto novo a um user
post:
operationId: R505
summary: 'R505: Adds a project to a user Action'
description: 'Processes the add_project page form submission. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: user_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
title:
type: string
description:
type: string
required:
- title
responses:
'302':
description: 'Redirect after processing the add_project form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New Project was added. Redirect to projects page.'
value: '/users/{id}' #REDIRECIONAR PARA a pagina onde estao os projetos do user (homepage)
302Error:
description: 'Failed to add new project. Redirect to add_project form.'
value: '/users/{user_id}/add_project'
'400':
description: 'Bad Request. Back to add_project page.'
'401':
description: 'Cannot do this action.'
/project/{project_id}/add_board:
# Obter a page para adicionar uma project board
get:
operationId: R506
summary: 'R506: Fetch add_project_board page'
description: 'Gets the add_board page with a form to add a new project board. Access: COO'
tags:
- 'M05: Projects'
parameters:
- in: path
name: project_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show add_board page'
'401':
description: 'Cannot access this page.'
# Adiciona uma board nova a um projeto
post:
operationId: R507
summary: 'R507: Adds a project board to a project Action'
description: 'Processes the add_board page form submission. Access: COO'
tags:
- 'M05: Projects'
parameters:
- in: path
name: project_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
project_id:
type: integer
description:
type: string
name:
type: string
required:
- project_id
- name
responses:
'302':
description: 'Redirect after processing the add_board form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New Project board was added. Redirect to project page.'
value: '/projects/{project_id}'
302Error:
description: 'Failed to add new project board. Redirect to add_board form.'
value: '/project/{project_id}/board'
'400':
description: 'Bad Request. Back to add_board page.'
'401':
description: 'Cannot do this action.'
/boards/{board_id}/add_vertical:
# Obter a page para adicionar uma coluna
get:
operationId: R508
summary: 'R508: Fetch add_vertical page'
description: 'Gets the add_vertical page with a form to add a new board column. Access: COO'
tags:
- 'M05: Projects'
parameters:
- in: path
name: board_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show add_vertical page'
'401':
description: 'Cannot access this page.'
# Adiciona uma coluna nova a uma board
post:
operationId: R509
summary: 'R509: Adds a board vertical to a board Action'
description: 'Processes the add_vertical page form submission. Access: COO'
tags:
- 'M05: Projects'
parameters:
- in: path
name: board_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
board_id:
type: integer
name:
type: string
required:
- board_id
- name
responses:
'302':
description: 'Redirect after processing the add_vertical form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New board vertical was added. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to add new board vertical. Redirect to add_column form.'
value: '/boards/{board_id}/vertical'
'400':
description: 'Bad Request. Back to add_vertical page.'
'401':
description: 'Cannot do this action.'
/verticals/{vertical_id}/add_task:
# Obter a page para adicionar uma task
get:
operationId: R510
summary: 'R510: Fetch add_task page'
description: 'Gets the add_task page with a form to add a new column task. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: column_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show add_task page'
'401':
description: 'Cannot do this action.'
# Adiciona uma task nova a uma coluna
post:
operationId: R511
summary: 'R511: Adds a column task to a column Action'
description: 'Processes the add_task page form submission. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: column_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
column_id:
type: integer
name:
type: string
description:
type: string
due_date:
type: string
required:
- column_id
- name
responses:
'302':
description: 'Redirect after processing the add_task form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New column task was added. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to add new column task. Redirect to add_task form.'
value: '/boards/{board_id}/column'
'400':
description: 'Bad Request. Back to add_task page.'
'401':
description: 'Cannot do this action.'
/add_label:
# Obter a page para criar/adicionar uma label
get:
operationId: R512
summary: 'R512: Fetch add_label page'
description: 'Gets the add_label page with a form to add a new label. Access: USR'
tags:
- 'M05: Projects'
responses:
'200':
description: 'Ok. Show add_label page'
# cria um label nova
post:
operationId: R513
summary: 'R513: Creates a new label Action'
description: 'Processes the add_label page form submission. Access: USR'
tags:
- 'M05: Projects'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
color:
type: integer
required:
- color
- name
responses:
'302':
description: 'Redirect after processing the add_label form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New label was created. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to create a new label. Redirect to add_label form.'
value: '/add_label'
'400':
description: 'Bad Request. Back to add_label page.'
/add_label_class:
# Obter a page para criar/adicionar uma label_classas
get:
operationId: R514
summary: 'R514: Fetch add_label_class page'
description: 'Gets the add_label_class page with a form to add a new label. Access: COO'
tags:
- 'M05: Projects'
responses:
'200':
description: 'Ok. Show add_label_class page'
# adiciona/cria uma label_class nova a um label
post:
operationId: R515
summary: 'R515: Creates a new label class Action'
description: 'Processes the add_label_class page form submission. Access: COO'
tags:
- 'M05: Projects'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
required:
- name
responses:
'302':
description: 'Redirect after processing the add_label_class form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New label class was created. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to create a new label class. Redirect to add_label_class form.'
value: '/add_label_class'
'400':
description: 'Bad Request. Back to add_label_class page.'
# associa uma label a um task (separado pois varias tasks podem ter a mesma label) (alterar assginment)
/add_label_to_task:
post:
operationId: R516
summary: 'R516: Associates a label to a task'
description: 'Creates a new label_task instance with the given label_id and task_id. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: query
name: label_id
schema:
type: integer
required: true
- in: query
name: task_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
label_id:
type: integer
task_id:
type: integer
required:
- object
responses:
'302':
description: 'Redirect after processing the add_label_to_task action'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New label class was created. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to create a new label class. Redirect to board page.'
value: '/boards/{board_id}'
'400':
description: 'Bad Request. Back to board page.'
# associa uma label class a uma label
/add_labelClass_to_label:
post:
operationId: R517
summary: 'R517: Associates a label class to a label'
description: 'Creates a new label_label_class instance with the given label_id and label_class_id. Access: USR'
tags:
- 'M05: Projects'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
label_id:
type: integer
label_class_id:
type: integer
required:
- object
responses:
'302':
description: 'Redirect after processing the add_labelClass_to_label action'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New label class was created. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to create a new label class. Redirect to board page.'
value: '/boards/{board_id}'
'400':
description: 'Bad Request. Back to board page.'
# Adiciona um comment novo a uma task
/tasks/{task_id}/add_comment:
post:
operationId: R518
summary: 'R518: Adds a new comment to a task Action'
description: 'Processes the add_task page form submission. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: task_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
id:
type: integer
msg:
type: string
sent_date:
type: string
id_task:
type: integer
id_users:
type: integer
required:
- object
responses:
'302':
description: 'Redirect after processing the add_task form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'New task comment was added. Redirect to task page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to add new task comment. Redirect to add_task form.'
value: '/boards/{board_id}/column'
'400':
description: 'Bad Request. Back to add_task page.'
/api/project/{project_id}:
# fetches a project by ID
get:
operationId: R519
summary: 'R519: Fetch a project'
description: 'Gets a certain project via ID. Access: ADM'
tags:
- 'M05: Projects'
parameters:
- in: path
name: project_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Project fetched!β'
content:
application/json:
schema:
type: object
properties:
id:
type: integer
title:
type: string
description:
type: string
creation:
type: string
is_archived:
type: boolean
id_coordinator:
type: integer
# edits a project (including changing coordinator)
put:
operationId: R520
summary: 'R520: Edits a project Action'
description: 'Edits a project. Access: COO'
tags:
- 'M05: Projects'
parameters:
- in: path
name: project_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
title:
type: string
description:
type: string
is_archived:
type: boolean
id_coordinator:
type: integer
required:
- title
- is_achived
- id_coordinator
responses:
'302':
description: 'Redirect after processing to form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Project was edited. Redirect to projects page.'
value: 'asd' #REDIRECIONAR PARA a pagina onde estao os projetos do user (homepage)
302Error:
description: 'Failed to edit project. Redirect to add_project form.'
value: '/users/{user_id}/add_project'
'400':
description: 'Bad Request. Back to add_project form.'
/api/boards/{board_id}:
# fetches a board by ID
get:
operationId: R521
summary: 'R521: Fetch a board'
description: 'Gets a certain board via ID. Access: ADM'
tags:
- 'M05: Projects'
parameters:
- in: path
name: board_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. board fetched!β'
content:
application/json:
schema:
type: object
properties:
id:
type: integer
name:
type: string
id_project:
type: integer
# edits a board
put:
operationId: R522
summary: 'R522: Edits a board Action'
description: 'Edits a board. Access: COO'
tags:
- 'M05: Projects'
parameters:
- in: path
name: board_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
required:
- name
responses:
'302':
description: 'Redirect after processing to form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Board was edited. Redirect to project page.'
value: '/projects/{project_id}'
302Error:
description: 'Failed to edit board. Redirect to add_board form.'
value: '/project/{project_id}/add_board'
'400':
description: 'Bad Request. Back to add_board form.'
/api/columns/{column_id}:
# fetches a column by ID
get:
operationId: R523
summary: 'R523: Fetch a column'
description: 'Gets a certain column via ID. Access: ADM'
tags:
- 'M05: Projects'
parameters:
- in: path
name: column_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. column fetched!β'
content:
application/json:
schema:
type: object
properties:
id:
type: integer
name:
type: string
id_board:
type: integer
# edits a column
put:
operationId: R524
summary: 'R524: Edits a column Action'
description: 'Edits a column. Access: COO'
tags:
- 'M05: Projects'
parameters:
- in: path
name: column_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
required:
- object
responses:
'302':
description: 'Redirect after processing to form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Column was edited. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to edit column. Redirect to add_column form.'
value: '/boards/{board_id}/add_column'
'400':
description: 'Bad Request. Back to add_column form.'
/api/tasks/{task_id}:
# fetches a task by ID
get:
operationId: R525
summary: 'R525: Fetch a task'
description: 'Gets a certain task via ID. Access: ADM'
tags:
- 'M05: Projects'
parameters:
- in: path
name: task_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. task fetched!β'
content:
application/json:
schema:
type: object
properties:
id:
type: integer
name:
type: string
description:
type: string
creation_date:
type: string
due_date:
type: string
id_vertical:
type: integer
# edits a task
put:
operationId: R526
summary: 'R526: Edits a task Action'
description: 'Edits a task. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: task_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
description:
type: string
creation_date:
type: string
due_date:
type: string
required:
- name
responses:
'302':
description: 'Redirect after processing to form'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'task was edited. Redirect to board page.'
value: '/boards/{board_id}'
302Error:
description: 'Failed to edit task. Redirect to add_task form.'
value: '/columns/{column_id}/add_task'
'400':
description: 'Bad Request. Back to add_task form.'
/api/label/{label_id}:
# fetches a label by ID
get:
operationId: R527
summary: 'R527: Fetch a label'
description: 'Gets a certain label via ID. Access: ADM'
tags:
- 'M05: Projects'
parameters:
- in: path
name: label_id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. label fetched!β'
content:
application/json:
schema:
type: object
properties:
id:
type: integer
name:
type: string
color:
type: integer
# edits a label
put:
operationId: R528
summary: 'R528: Edits a label Action'
description: 'Edits a label. Access: USR'
tags:
- 'M05: Projects'
parameters:
- in: path
name: label_id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
color:
type: integer
required:
- color
- name
responses:
'302':
description: 'Redirect after processing to form'