ProjectManagmentTool/api/pmt.yml
2024-10-23 09:45:26 +02:00

262 lines
6.4 KiB
YAML

openapi: 3.0.0
info:
title: Project Management API
description: An API for Managing Internal tools
version: 1.0.0
servers:
- url: /api/v1
security:
- JWTAuth: []
components:
securitySchemes:
JWTAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
ProjectInfo:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
GetAllProjectsDTO:
type: array
items:
$ref: "#/components/schemas/ProjectInfo"
CreateProjectDTO:
type: object
properties:
name:
type: string
goal:
type: string
customerId:
type: integer
format: int64
administratorId:
type: integer
format: int64
start:
type: string
format: date-time
plannedEnd:
type: string
format: date-time
UpdateProjectDTO:
type: object
properties:
name:
type: string
goal:
type: string
customerId:
type: integer
format: int64
administratorId:
type: integer
format: int64
start:
type: string
format: date-time
plannedEnd:
type: string
format: date-time
end:
type: string
format: date-time
CreatedProjectDTO:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
goal:
type: string
customerId:
type: integer
format: int64
administratorId:
type: integer
format: int64
start:
type: string
format: date-time
plannedEnd:
type: string
format: date-time
AddEmployeeDTO:
type: object
properties:
employeeId:
type: integer
format: int64
qualificationId:
type: integer
format: int64
responses:
Unauthorized:
description: "Unauthorized"
NotFound:
description: "Not Found"
content:
text/plain:
schema:
type: string
Conflict:
description: "Conflict"
content:
text/plain:
schema:
type: string
UnprocessableContent:
description: "Unprocessable Content"
content:
text/plain:
schema:
type: string
InternalError:
description: "Internal Server Error"
content:
text/plain:
schema:
type: string
ServiceUnavailable:
description: "Service Unavailable"
content:
text/plain:
schema:
type: string
paths:
/project:
get:
operationId: "getAllProjects"
description: "Get a List of all Projects"
responses:
200:
description: "Returns a List of all Projects"
content:
application/json:
schema:
$ref: "#/components/schemas/GetAllProjectsDTO"
401:
$ref: "#/components/responses/Unauthorized"
500:
$ref: "#/components/responses/InternalError"
post:
operationId: "CreateProject"
description: "Creates a new Project"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateProjectDTO"
responses:
201:
description: "Project created successfully"
content:
application/json:
schema:
$ref: "#/components/schemas/CreatedProjectDTO"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
409:
$ref: "#/components/responses/Conflict"
422:
$ref: "#/components/responses/UnprocessableContent"
500:
$ref: "#/components/responses/InternalError"
503:
$ref: "#/components/responses/ServiceUnavailable"
/project/{id}:
post:
operationId: "addEmployee"
description: "Adds an employee to a specific Project"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AddEmployeeDTO"
responses:
204:
description: "Employee successfully added to the specific Project"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
409:
$ref: "#/components/responses/Conflict"
422:
$ref: "#/components/responses/UnprocessableContent"
500:
$ref: "#/components/responses/InternalError"
503:
$ref: "#/components/responses/ServiceUnavailable"
put:
operationId: "updateProject"
description: "Updates a project"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateProjectDTO"
responses:
204:
description: "Project updated successfully"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
409:
$ref: "#/components/responses/Conflict"
422:
$ref: "#/components/responses/UnprocessableContent"
500:
$ref: "#/components/responses/InternalError"
503:
$ref: "#/components/responses/ServiceUnavailable"
delete:
operationId: "deleteProject"
description: "Delete a specific Project"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
responses:
204:
description: "Deletes a specific Project"
401:
$ref: "#/components/responses/Unauthorized"
404:
description: "Project not found"
content:
text/plain:
schema:
type: string
500:
$ref: "#/components/responses/InternalError"