PMT-26: Define Endpoint

This commit is contained in:
Rajbir Singh 2024-10-23 13:16:39 +02:00 committed by Dominik Säume
parent 9fe23f3e90
commit 933ac666a8

View file

@ -77,6 +77,45 @@ components:
qualificationId: qualificationId:
type: integer type: integer
format: int64 format: int64
Employee:
type: object
properties:
id:
type: integer
format: int64
lastName:
type: string
firstName:
type: string
street:
type: string
postcode:
maxLength: 5
minLength: 5
type: string
city:
type: string
phone:
type: string
skillSet:
type: array
items:
$ref: '#/components/schemas/Qualification'
Qualification:
type: object
properties:
skill:
type: string
id:
type: integer
format: int64
ProjectEmployeesDTO:
type: object
properties:
employees:
type: array
items:
$ref: "#/components/schemas/Employee"
responses: responses:
Unauthorized: Unauthorized:
description: "Unauthorized" description: "Unauthorized"
@ -167,10 +206,10 @@ paths:
format: int64 format: int64
required: true required: true
requestBody: requestBody:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/AddEmployeeDTO" $ref: "#/components/schemas/AddEmployeeDTO"
responses: responses:
204: 204:
description: "Employee successfully added to the specific Project" description: "Employee successfully added to the specific Project"
@ -179,7 +218,7 @@ paths:
404: 404:
$ref: "#/components/responses/NotFound" $ref: "#/components/responses/NotFound"
409: 409:
$ref: "#/components/responses/Conflict" $ref: "#/components/responses/Conflict"
422: 422:
$ref: "#/components/responses/UnprocessableContent" $ref: "#/components/responses/UnprocessableContent"
500: 500:
@ -241,3 +280,26 @@ paths:
$ref: "#/components/responses/InternalError" $ref: "#/components/responses/InternalError"
503: 503:
$ref: "#/components/responses/ServiceUnavailable" $ref: "#/components/responses/ServiceUnavailable"
/project/{id}/employees:
get:
description: "getAllEmployees"
operationId: "Get a List of all Employees from a specific Project"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
responses:
200:
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectEmployeesDTO"
description: 'Get a List of all Employees from a specific Project '
404:
$ref: '#/components/responses/NotFound'
500:
$ref: "#/components/responses/InternalError"