Just a simple project developed for the conclusion work of the Systems Development course at SENAI - Cimatec
Created with the aim of digitizing processes that were previously done manually, the expectation is to generate greater reliability, time savings and practicality for our client.
.NET 8
git clone https://github.com/Pauloocm/Splan.Api.git
This documentation provides details about the endpoints available in the Splan API.
- Endpoint:
POST /Authentication/Register
- Description: Endpoint allows users to register with a valid email and password.
- Request Body: JSON representing an
AdminLoginCommand
. - Response: 200 OK - Registration successful. / 400 Bad Request - Invalid email or password.
POST /Authentication/Register
Content-Type: application/json
{
"email": "[email protected]",
"password": "Pinkman123"
}
- Endpoint:
POST /Authentication
- Description: Endpoint allows users to log in with a valid email and password..
- Request Body: JSON representing an
AdminLoginCommand
. - Response: 200 OK - Login successful / 400 Bad Request - Invalid email or password.
POST /Authentication
Content-Type: application/json
{
"email": "[email protected]",
"password": "Pinkman123"
}
- Endpoint:
POST /Add
- Description: Endpoint allows users to add a project using a provided command.
- Request Body: JSON representing an
AddProjectCommand
. - Response: 200 OK - Project added successfully, returns the project ID / 400 Bad Request - Invalid or missing project details
POST /Add
Content-Type: application/json
{
"name": "ProjectName",
"company": "CompanyName",
"startDate": "2023-01-01",
"expirationDate": "2023-12-31",
"status": true
}
- Endpoint:
PUT /Update
- Description: Endpoint allows users to update a project using a provided command.
- Request Body: JSON representing an
UpdateProjectCommand
. - Response: 200 OK - Project updated successfully / 400 Bad Request - Invalid or missing project details
PUT /Update
Content-Type: application/json
{
"id": 1,
"name": "UpdatedProjectName",
"company": "UpdatedCompanyName",
"startDate": "2023-01-01",
"expirationDate": "2023-12-31",
"status": true
}
- Endpoint:
GET
- Description: Endpoint allows users to retrieve a list of projects.
- Response: 200 OK - List of projects retrieved successfully / 204 No Content - No projects found
- Endpoint:
DELETE
- Description: Endpoint allows users to delete a project using a provided command.
- Request Body: JSON representing an
DeleteProjectCommand
. - Response: 200 OK - Project deleted successfully / 400 Bad Request - Invalid or missing project ID
DELETE
Content-Type: application/json
{
"id": 1
}
- Endpoint:
GET /Dashboard/{projectId}
- Description: Endpoint allows users to retrieve dashboard information for a specified project.
- Response: 200 OK - Dashboard information retrieved successfully / 400 Bad Request - Invalid project ID / 404 Not Found - Project not found or no dashboard information available.
GET /Dashboard/{projectId}
Content-Type: application/json
{}
- Endpoint:
POST /Employees/{projectId}
- Description: Endpoint allows users to add an employee to a project using a provided command and project ID.
- Request Body: JSON representing an
AddEmployeeCommand
. - Response: 200 OK - Employee added to the project successfully, returns the employee key / 400 Bad Request - Invalid or missing employee details or project ID
POST /Employees/{projectId}
Content-Type: application/json
{
"name": "EmployeeName",
"function": "Developer",
"educationDegree": "Bachelor",
"hiringRegimeId": 1,
"isCoordinator": false,
"classification": "Junior"
}
- Endpoint:
PUT /Employees
- Description: Endpoint allows users to update employee details in a project using a provided command and project ID.
- Request Body: JSON representing an
UpdateEmployeeCommand
. - Response: 200 OK - Employee details updated successfully / 400 Bad Request - Invalid or missing employee details or project ID
PUT /Employees
Content-Type: application/json
{
"employeeId": "EmployeeId",
"name": "UpdatedEmployeeName",
"function": "UpdatedDeveloper",
"educationDegree": "Master",
"hiringRegimeId": 2,
"isCoordinator": true,
"classification": "Senior"
}
- Endpoint:
GET /GetById/{projectId}/{employeeId}
- Description: Endpoint allows users to return a employee by project Id and their ID.
- Query Parameter:
employeeId
(Guid) - Response: 200 OK - Return employee successfully / 400 Bad Request - Invalid emplyoee ID or project ID
GET /GetById/{projectId}/{employeeId}
Content-Type: application/json
{
"employeeId": "1"
}
- Endpoint:
GET /Employees/{projectId}
- Description: Endpoint allows users to retrieve a list of employees within a specified project.
- Response: 200 OK - List of employees retrieved successfully / 400 Bad Request - Invalid project ID / 404 Not Found - Project not found
GET /Employees/{projectID}
Content-Type: application/json
- Endpoint:
DELETE /Employees/{projectId}
- Description: Endpoint allows users to remove an employee from a specified project.
- Request Body: JSON representing a
DeleteEmployeeCommand
. - Response: 200 OK - Employee deleted successfully / 400 Bad Request - Invalid employee ID or project ID
DELETE /Employees/{projectId}
Content-Type: application/json
{
"EmployeeId": "1"
}
- Endpoint:
POST /Phases/{projectId}
- Description: Endpoint allows users to add a phase to a specified project.
- Request Body: JSON representing an
AddPhaseCommand
. - Response: 200 OK - Phase added to the project successfully, returns the phase ID / 400 Bad Request - Invalid or missing phase details or project ID
POST /Phases/{projectId}
Content-Type: application/json
{
"stage": "PhaseStage",
"description": "PhaseDescription",
"startDate": "2023-01-01",
"endDate": "2023-12-31"
}
- Endpoint:
PUT /Phases/{projectId}
- Description: Endpoint allows users to update phase details within a specified project.
- Request Body: JSON representing an
UpdatePhaseCommand
. - Response: 200 OK - Phase details updated successfully / 400 Bad Request - Invalid or missing phase details or project ID
PUT /Phases/{projectId}
Content-Type: application/json
{
"PhaseId": "1",
"stage": "PhaseStage",
"description": "PhaseDescription",
"startDate": "2023-01-01",
"endDate": "2023-12-31"
}
- Endpoint:
GET /ListPhases/{projectId}
- Description: Endpoint allows users to retrieve a list of phases within a specified project.
- Response: 200 OK - List of phases retrieved successfully / 400 Bad Request - Invalid project ID / 404 - Not Found - Project not found.
GET /ListPhases/{projectId}
Content-Type: application/json
{}
- Endpoint:
DELETE /Phases/{projectId}
- Description: Endpoint allows users to remove a phase from a specified project.
- Request Body: JSON representing an
DeletePhaseCommand
. - Response: 200 OK - Phase deleted successfully / 400 Bad Request - Invalid or missing phase details or project ID
DELETE /Phases/{projectId}
Content-Type: application/json
{
"PhaseId": "1",
}
- Endpoint:
POST /Finances/{projectId}
- Description: Endpoint allows users to add a finance item to a specified project.
- Request Body: JSON representing an
AddFinanceItemCommand
. - Response: 200 OK - Finance item added to the project successfully / 400 Bad Request - Invalid or missing phase details or project ID
POST /Finances/{projectId}
Content-Type: application/json
{
"name": "ItemName",
"date": "2023-01-01",
"value": 100.0,
"supplier": "SupplierName"
}
- Endpoint:
GET /Finances/{projectId}
- Description: Endpoint allows users to retrieve a list of finance items within a specified project.
- Response: 200 OK - List of finance items retrieved successfully / 400 Bad Request - Invalid project ID / 404 Not Found - Project not found.
GET /Finances/{projectId}
Content-Type: application/json
{}
- Endpoint:
PUT /Finances/{projectId}
- Description: Endpoint allows users to add a finance item to a specified project.
- Request Body: JSON representing an
UpdateFinanceItemCommand
. - Response: 200 OK - Finance item details updated successfully / 400 Bad Request - Invalid or missing finance item details or project ID
PUT /Finances/{projectId}
Content-Type: application/json
{
"financeItemId": "ItemID",
"name": "UpdatedItemName",
"date": "2023-01-01",
"value": 150.0,
"supplier": "UpdatedSupplierName"
}
- Endpoint:
DELETE /Finances/{projectId}
- Description: Endpoint allows users to remove a finance item from a specified project.
- Request Body: JSON representing an
DeleteFinanceItemCommand
. - Response: 200 OK - Finance item deleted successfully / 400 Bad Request - Invalid or missing finance item details or project ID
DELETE /Finances/{projectId}
Content-Type: application/json
{
"financeItemId": "ItemID"
}
- Endpoint:
POST /UploadPdf
- Description: Endpoint allows users to upload a PDF file.
- Request Form: PDF file
- Request Body: JSON representing an
AddPdfViewModel
. - Response: 200 OK - File uploaded successfully, returns the PDF ID / 400 Bad Request - No file uploaded, invalid file format, or missing required
POST /UploadPdf
Content-Type: application/json
{
"name": "pdfName",
"financeItemId": "1"
}
- Endpoint:
GET /DownloadPdf
- Description: Endpoint allows users to upload a PDF file.
- Request Body: JSON representing an
financeItemId
. - Response: 200 OK - File downloaded successfully, returns the PDF file / 400 Bad Request - Invalid or missing ItemId / 404 Not Found - PDF file or associated item not found.
GET /DownloadPdf
Content-Type: application/json
{
"financeItemId": "1"
}
- Endpoint:
POST /Rhfinances/{projectId}
- Description: Endpoint allows users to add finance information from an employee to a specified project.
- Request Body: JSON representing an
AddRhFinanceFromEmployee
. - Response: 200 OK - File downloaded successfully, returns the PDF file / 400 Bad Request - Invalid or missing ItemId / 404 Not Found - PDF file or associated item not found.
POST /Rhfinances/{projectId}
Content-Type: application/json
{
"employeeId": "1",
"contractDateMonth": "2023-01-01",
"valuePerHour": 25.0,
"hoursWorkedMonth": 160
}
- Endpoint:
GET /Rhfinances/{projectId}
- Description: Endpoint allows users to list finance information related to employees in a specified project.
- Response: 200 OK - Finance information related to employees listed successfully / 400 Bad Request - Invalid project ID / 404 Not Found - Project not found.
GET /Rhfinances/{projectId}
Content-Type: application/json
{}
- Endpoint:
PUT /Rhfinances/{projectId}
- Description: Endpoint allows users to update finance information related to employees in a specified project.
- Request Body: JSON representing an
UpdateRhFinanceCommand
. - Response: 200 OK - Finance information related to employees updated successfully / 400 Bad Request - Invalid project ID / 404 Not Found - Project not found.
PUT /Rhfinances/{projectId}
Content-Type: application/json
{
"employeeId": "1",
"contractDateMonth": "2023-01-01",
"valuePerHour": 30.0,
"hoursWorkedMonth": 180
}