EMPLOYEE
Endpoints
Search employees
GET /employee
Description: Returns all registered employees, with the ability to filter by name, email, id, store, among others.
Responses:
200 OK: Returns a list of employees.
Create employee
POST /employee
Description: Creates a new employee.
Responses:
200 OK: Employee successfully created.400 Bad Request: Invalid parameters.
Search employee by id
GET /employee/{id}
Description: Returns an employee by id.
Responses:
200 OK: Returns the employee.404 Not Found: Employee not found.
Edit employee
PUT /employee/{id}
Description: Edits an existing employee.
Responses:
200 OK: Employee successfully edited.422 Unprocessable Entity: Invalid parameters.
Deactivate employee
DELETE /employee/{id}
Description: Deactivates an existing employee.
Responses:
200 OK: Employee successfully deactivated.422 Unprocessable Entity: Employee not found.
Listing units linked to the employee
GET /employee/{id}/stores
Descrição: By using the ID generated when creating the employee (internal ID), it is possible to know which units are linked to the employee.
Respostas:
200 OK: Returns a list of employees.404 Not Found: Employee not found.
Edit the Relationship between Units and the Employee
PUT /employee/{ID}/stores
Descrição: You must use the ID generated during employee creation. Pass only the internal IDs of the units to associate with the employee. You must have access to the units you wish to modify (add or remove). The result of the request is the updated list of units linked to the employee.
Respostas:
200 OK: Returns a list of employees.401 Not Authorized: Not authorized.404 Not Found: Employee not found.
Listing groups linked to the employee
GET /employee/{id}/groups
Descrição: By using the ID generated when creating the employee (internal ID), it is possible to know which groups are linked to the employee.
Respostas:
200 OK: Returns a list of employees.404 Not Found: Employee not found.
Edit the Relationship between Groups and the Employee
PUT /employee/{id}/groups
Descrição: You must use the ID generated during employee creation. Pass only the internal group IDs to associate with the employee. You must have access to the groups you want to modify for the employee (add or remove). The result of the request is the updated list of groups linked to the employee.
Respostas:
200 OK: Returns a list of employees.401 Not Authorized: Not authorized.404 Not Found: Employee not found.