Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 1309127

Browse files
phoenix303sharathkumaranbu
authored andcommitted
Bug fix - Implement GET endpoints for Project members & attachments
Bug fixes
1 parent 9d96a7f commit 1309127

File tree

18 files changed

+972
-11198
lines changed

18 files changed

+972
-11198
lines changed

docs/Project API.postman_collection.json

Lines changed: 132 additions & 369 deletions
Large diffs are not rendered by default.

docs/swagger.yaml

Lines changed: 119 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -25,74 +25,6 @@ securityDefinitions:
2525
name: Authorization
2626
in: header
2727
paths:
28-
'/projects/db':
29-
get:
30-
tags:
31-
- project
32-
operationId: findProjectsDB
33-
security:
34-
- Bearer: []
35-
description: Retrieve projects that match the filter directly from database
36-
responses:
37-
'200':
38-
description: A list of projects
39-
schema:
40-
type: array
41-
items:
42-
$ref: '#/definitions/Project'
43-
headers:
44-
X-Next-Page:
45-
type: integer
46-
description: The index of the next page
47-
X-Page:
48-
type: integer
49-
description: The index of the current page (starting at 1)
50-
X-Per-Page:
51-
type: integer
52-
description: The number of items to list per page
53-
X-Prev-Page:
54-
type: integer
55-
description: The index of the previous page
56-
X-Total:
57-
type: integer
58-
description: The total number of items
59-
X-Total-Pages:
60-
type: integer
61-
description: The total number of pages
62-
Link:
63-
type: string
64-
description: Pagination link header.
65-
'401':
66-
description: Unauthorized
67-
schema:
68-
$ref: '#/definitions/ErrorModel'
69-
'400':
70-
description: Bad request
71-
schema:
72-
$ref: '#/definitions/ErrorModel'
73-
'500':
74-
description: Internal Server Error
75-
schema:
76-
$ref: '#/definitions/ErrorModel'
77-
parameters:
78-
- $ref: '#/parameters/pageParam'
79-
- $ref: '#/parameters/perPageParam'
80-
- $ref: '#/parameters/idQueryParam'
81-
- $ref: '#/parameters/statusQueryParam'
82-
- $ref: '#/parameters/typeQueryParam'
83-
- $ref: '#/parameters/memberOnlyQueryParam'
84-
- $ref: '#/parameters/keywordQueryParam'
85-
- $ref: '#/parameters/nameQueryParam'
86-
- $ref: '#/parameters/codeQueryParam'
87-
- $ref: '#/parameters/customerQueryParam'
88-
- $ref: '#/parameters/managerQueryParam'
89-
- name: sort
90-
required: false
91-
description: >
92-
sort projects by status, name, type, createdAt, updatedAt. Default
93-
is createdAt asc
94-
in: query
95-
type: string
9628
'/projects':
9729
get:
9830
tags:
@@ -312,6 +244,30 @@ paths:
312244
schema:
313245
$ref: '#/definitions/ErrorModel'
314246
'/projects/{projectId}/attachments':
247+
get:
248+
tags:
249+
- project attachments
250+
description: Retrieve project attachments
251+
security:
252+
- Bearer: []
253+
responses:
254+
'200':
255+
description: list of project attachments
256+
schema:
257+
type: array
258+
items:
259+
$ref: '#/definitions/ProjectAttachment'
260+
'401':
261+
description: Unauthorized
262+
schema:
263+
$ref: '#/definitions/ErrorModel'
264+
'500':
265+
description: Internal Server Error
266+
schema:
267+
$ref: '#/definitions/ErrorModel'
268+
parameters:
269+
- $ref: '#/parameters/projectIdParam'
270+
operationId: listProjectAttachment
315271
post:
316272
tags:
317273
- project attachments
@@ -347,6 +303,37 @@ paths:
347303
schema:
348304
$ref: '#/definitions/ErrorModel'
349305
'/projects/{projectId}/attachments/{id}':
306+
get:
307+
tags:
308+
- project attachments
309+
description: Download project attachment
310+
security:
311+
- Bearer: []
312+
responses:
313+
'200':
314+
description: a project attachment
315+
schema:
316+
$ref: '#/definitions/ProjectAttachment'
317+
'401':
318+
description: Unauthorized
319+
schema:
320+
$ref: '#/definitions/ErrorModel'
321+
'404':
322+
description: Not found
323+
schema:
324+
$ref: '#/definitions/ErrorModel'
325+
'500':
326+
description: Internal Server Error
327+
schema:
328+
$ref: '#/definitions/ErrorModel'
329+
parameters:
330+
- $ref: '#/parameters/projectIdParam'
331+
- in: path
332+
name: id
333+
required: true
334+
description: The id of attachment to download
335+
type: integer
336+
operationId: downloadProjectAttachment
350337
patch:
351338
tags:
352339
- project attachments
@@ -428,6 +415,40 @@ paths:
428415
schema:
429416
$ref: '#/definitions/ErrorModel'
430417
'/projects/{projectId}/members':
418+
get:
419+
tags:
420+
- project members
421+
description: Retrieve project members
422+
security:
423+
- Bearer: []
424+
responses:
425+
'200':
426+
description: list of project members
427+
schema:
428+
type: array
429+
items:
430+
$ref: '#/definitions/ProjectMember'
431+
'400':
432+
description: Bad request
433+
schema:
434+
$ref: '#/definitions/ErrorModel'
435+
'401':
436+
description: Unauthorized
437+
schema:
438+
$ref: '#/definitions/ErrorModel'
439+
'500':
440+
description: Internal Server Error
441+
schema:
442+
$ref: '#/definitions/ErrorModel'
443+
parameters:
444+
- $ref: '#/parameters/projectIdParam'
445+
- name: role
446+
required: false
447+
description: >
448+
member role
449+
in: query
450+
type: string
451+
operationId: listProjectMember
431452
post:
432453
tags:
433454
- project members
@@ -463,6 +484,36 @@ paths:
463484
schema:
464485
$ref: '#/definitions/ErrorModel'
465486
'/projects/{projectId}/members/{id}':
487+
get:
488+
tags:
489+
- project members
490+
description: Get project member
491+
security:
492+
- Bearer: []
493+
responses:
494+
'200':
495+
description: a project member
496+
schema:
497+
$ref: '#/definitions/ProjectMember'
498+
'401':
499+
description: Unauthorized
500+
schema:
501+
$ref: '#/definitions/ErrorModel'
502+
'404':
503+
description: Not found
504+
schema:
505+
$ref: '#/definitions/ErrorModel'
506+
'500':
507+
description: Internal Server Error
508+
schema:
509+
$ref: '#/definitions/ErrorModel'
510+
parameters:
511+
- $ref: '#/parameters/projectIdParam'
512+
- in: path
513+
name: id
514+
required: true
515+
type: integer
516+
operationId: getProjectMember
466517
delete:
467518
tags:
468519
- project members
@@ -542,55 +593,6 @@ paths:
542593
required: true
543594
schema:
544595
$ref: '#/definitions/UpdateProjectMember'
545-
'/projects/{projectId}/phases/db':
546-
parameters:
547-
- $ref: '#/parameters/projectIdParam'
548-
get:
549-
tags:
550-
- phase
551-
operationId: findProjectPhasesDB
552-
security:
553-
- Bearer: []
554-
description: >-
555-
Retrieve all project phases directly from database. All users who can edit project can access
556-
this endpoint.
557-
parameters:
558-
- name: fields
559-
required: false
560-
type: string
561-
in: query
562-
description: |
563-
Comma separated list of project phase fields to return.
564-
- name: sort
565-
required: false
566-
description: >
567-
sort project phases by startDate, endDate, status, order. Default is
568-
startDate asc
569-
in: query
570-
type: string
571-
responses:
572-
'200':
573-
description: A list of project phases
574-
schema:
575-
type: array
576-
items:
577-
$ref: '#/definitions/ProjectPhase'
578-
'400':
579-
description: Bad request
580-
schema:
581-
$ref: '#/definitions/ErrorModel'
582-
'401':
583-
description: Unauthorized
584-
schema:
585-
$ref: '#/definitions/ErrorModel'
586-
'403':
587-
description: Forbidden
588-
schema:
589-
$ref: '#/definitions/ErrorModel'
590-
'500':
591-
description: Internal Server Error
592-
schema:
593-
$ref: '#/definitions/ErrorModel'
594596
'/projects/{projectId}/phases':
595597
parameters:
596598
- $ref: '#/parameters/projectIdParam'
@@ -802,42 +804,6 @@ paths:
802804
description: Internal Server Error
803805
schema:
804806
$ref: '#/definitions/ErrorModel'
805-
'/projects/{projectId}/phases/{phaseId}/products/db':
806-
parameters:
807-
- $ref: '#/parameters/projectIdParam'
808-
- $ref: '#/parameters/phaseIdParam'
809-
get:
810-
tags:
811-
- phase product
812-
operationId: findPhaseProductsDB
813-
security:
814-
- Bearer: []
815-
description: >-
816-
Retrieve all phase products directly from database. All users who can edit project can access
817-
this endpoint.
818-
responses:
819-
'200':
820-
description: A list of phase products
821-
schema:
822-
type: array
823-
items:
824-
$ref: '#/definitions/PhaseProduct'
825-
'400':
826-
description: Bad request
827-
schema:
828-
$ref: '#/definitions/ErrorModel'
829-
'401':
830-
description: Unauthorized
831-
schema:
832-
$ref: '#/definitions/ErrorModel'
833-
'403':
834-
description: Forbidden
835-
schema:
836-
$ref: '#/definitions/ErrorModel'
837-
'500':
838-
description: Internal Server Error
839-
schema:
840-
$ref: '#/definitions/ErrorModel'
841807
'/projects/{projectId}/phases/{phaseId}/products':
842808
parameters:
843809
- $ref: '#/parameters/projectIdParam'

0 commit comments

Comments
 (0)