ProjectManagmentTool/api/pmt.yml

475 lines
12 KiB
YAML
Raw Normal View History

2024-09-12 22:01:00 +00:00
openapi: 3.0.0
info:
title: Project Management API
description: An API for Managing Internal tools
version: 1.0.0
servers:
- url: /api/v1
2024-09-27 10:17:17 +00:00
security:
- JWTAuth: []
2024-09-12 22:01:00 +00:00
components:
2024-09-27 10:17:17 +00:00
securitySchemes:
JWTAuth:
type: http
scheme: bearer
bearerFormat: JWT
2024-10-02 06:48:15 +00:00
schemas:
ProjectInfo:
2024-09-12 22:01:00 +00:00
type: object
2024-10-02 06:48:15 +00:00
properties:
id:
type: integer
format: int64
name:
2024-09-12 22:01:00 +00:00
type: string
2024-10-02 06:48:15 +00:00
GetAllProjectsDTO:
type: array
items:
$ref: "#/components/schemas/ProjectInfo"
2024-10-24 07:50:16 +00:00
GetAllProjectInfoDTO:
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
realEnd:
type: string
format: date-time
2024-10-07 13:53:26 +00:00
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
2024-10-23 07:44:58 +00:00
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
2024-10-07 13:53:26 +00:00
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
2024-10-24 07:44:46 +00:00
Project:
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
realEnd:
type: string
format: date-time
2024-10-21 10:58:41 +00:00
AddEmployeeDTO:
type: object
properties:
employeeId:
type: integer
format: int64
qualificationId:
type: integer
format: int64
2024-10-23 11:16:39 +00:00
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"
2024-10-24 07:44:46 +00:00
EmployeeProjectsDTO:
type: object
properties:
projects:
type: array
items:
$ref: '#/components/schemas/Project'
2024-09-12 22:01:00 +00:00
responses:
2024-10-07 13:53:26 +00:00
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
2024-09-12 22:01:00 +00:00
InternalError:
description: "Internal Server Error"
content:
text/plain:
schema:
type: string
ServiceUnavailable:
description: "Service Unavailable"
content:
text/plain:
schema:
type: string
2024-09-12 22:01:00 +00:00
paths:
2024-10-02 06:48:15 +00:00
/project:
2024-09-12 22:01:00 +00:00
get:
2024-10-02 06:48:15 +00:00
operationId: "getAllProjects"
description: "Get a List of all Projects"
2024-09-12 22:01:00 +00:00
responses:
200:
description: "Returns a List of all Projects"
2024-09-12 22:01:00 +00:00
content:
application/json:
schema:
2024-10-02 06:48:15 +00:00
$ref: "#/components/schemas/GetAllProjectsDTO"
401:
2024-10-07 13:53:26 +00:00
$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"
2024-09-12 22:01:00 +00:00
500:
2024-10-09 08:49:49 +00:00
$ref: "#/components/responses/InternalError"
503:
$ref: "#/components/responses/ServiceUnavailable"
2024-10-23 07:44:58 +00:00
2024-10-09 08:49:49 +00:00
/project/{id}:
2024-10-24 07:50:16 +00:00
get:
operationId: "getProjectInfo"
description: "Get a list of all Project Informations"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
responses:
200:
description: "Project Info recieved"
content:
application/json:
schema:
$ref: "#/components/schemas/GetAllProjectInfoDTO"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalError"
503:
$ref: "#/components/responses/ServiceUnavailable"
2024-10-21 10:58:41 +00:00
post:
operationId: "addEmployee"
description: "Adds an employee to a specific Project"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
requestBody:
2024-10-23 11:16:39 +00:00
content:
application/json:
schema:
$ref: "#/components/schemas/AddEmployeeDTO"
2024-10-21 10:58:41 +00:00
responses:
204:
description: "Employee successfully added to the specific Project"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
409:
2024-10-23 11:16:39 +00:00
$ref: "#/components/responses/Conflict"
2024-10-21 10:58:41 +00:00
422:
$ref: "#/components/responses/UnprocessableContent"
500:
$ref: "#/components/responses/InternalError"
503:
$ref: "#/components/responses/ServiceUnavailable"
2024-10-23 07:44:58 +00:00
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"
2024-10-09 08:49:49 +00:00
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"
2024-10-09 08:49:49 +00:00
404:
$ref: "#/components/responses/NotFound"
2024-10-09 08:49:49 +00:00
500:
$ref: "#/components/responses/InternalError"
/project/{id}/completed:
post:
operationId: "completeProject"
description: "Complete a specific project"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
responses:
204:
description: "Completed"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalError"
2024-10-22 12:32:09 +00:00
/project/{id}/employee/{employeeId}:
delete:
operationId: "removeEmployeeFromProject"
description: "Removes an employee from a Project"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
- in: path
name: employeeId
schema:
type: integer
format: int64
required: true
responses:
204:
description: "Deletes the employee from the Project"
401:
$ref: "#/components/responses/Unauthorized"
404:
2024-10-23 09:27:37 +00:00
$ref: "#/components/responses/NotFound"
2024-10-22 12:32:09 +00:00
409:
$ref: "#/components/responses/Conflict"
500:
$ref: "#/components/responses/InternalError"
503:
$ref: "#/components/responses/ServiceUnavailable"
2024-10-23 11:16:39 +00:00
/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"
2024-10-24 07:44:46 +00:00
/employye/{id}/projects:
get:
description: "getAllProjects"
operationId: "Get a List of all Projects from a specific Employee"
parameters:
- in: path
name: id
schema:
type: integer
format: int64
required: true
responses:
200:
content:
application/json:
schema:
$ref: "#/components/schemas/EmployeeProjectsDTO"
description: 'Get a List of all Projects from a specific Employee'
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'