From 2a35474ed32511b544433457cca6dd72f5a62729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20K=C3=BCck?= Date: Thu, 17 Oct 2024 11:09:19 +0200 Subject: [PATCH] PMT-4: Add AddEmpployeeDTO and endpoint specification --- api/pmt.yml | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/api/pmt.yml b/api/pmt.yml index a354e49..1fc561d 100644 --- a/api/pmt.yml +++ b/api/pmt.yml @@ -68,6 +68,15 @@ components: plannedEnd: type: string format: date-time + AddEmployeeDTO: + type: object + properties: + employeeId: + type: integer + format: int64 + qualificationId: + type: integer + format: int64 responses: Unauthorized: description: "Unauthorized" @@ -77,6 +86,12 @@ components: text/plain: schema: type: string + NotAcceptable: + description: "Not Acceptable" + content: + text/plain: + schema: + type: string Conflict: description: "Conflict" content: @@ -147,6 +162,26 @@ paths: /project/{id}: + post: + operationId: "addEmployee" + description: "Adds an employee to a specific Project" + parameters: + - in: path + name: id + content: + application/json: + schema: + $ref: "#/components/schemas/AddEmployeeDTO" + responses: + 204: + description: "Employee successfully added to the specific Project" + 404: + $ref: "#/components/responses/NotFound" + 406: + $ref: "#/components/responses/NotAcceptable" + 409: + $ref: "#/components/responses/Conflict" + delete: operationId: "deleteProject" description: "Delete a specific Project" @@ -169,20 +204,4 @@ paths: schema: type: string 500: - $ref: "#/components/responses/InternalError" - - /project/{id}/employee/{employeeId}: - post: - operationId: "addEmployee" - description: "Adds an employee to a specific Project" - parameters: - - in: path - name: id - responses: - 204: - description: "Employee successfully added to the specific Project" - 409: - $ref: "#/components/responses/Conflict" - 404: - $ref: "#/components/responses/NotFound" - + $ref: "#/components/responses/InternalError" \ No newline at end of file