Hire Employee
Hire client as an employee in gym. You can only hire an employee if you're ADMIN.
Body Required
-
client_id number
Id of the client in database (you can get it via GET /client)
-
employee_type string
Employee's job posting
-
left_at string(date)
Employee's firing date (can be undefined)
POST
/employee
curl \
-X POST http://63.141.232.244:25540/v0/employee \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"client_id":42.0,"employee_type":"string","left_at":"2024-05-04"}'
Request examples
{
"client_id": 42.0,
"employee_type": "string",
"left_at": "2024-05-04"
}
Response examples (200)
{
"success": true,
"employee": {
"client_id": 1,
"employee_id": 1,
"employee_type": "ADMIN",
"left_at": "2024-10-15T19:12:03Z",
"hired_at": "2024-10-10T18:36:47Z"
}
}
Response examples (400)
{
"success": false,
"error": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"client_id"
],
"message": "Required"
}
]
}
Response examples (401)
{
"success": false,
"error": "Unauthorized"
}
Response examples (429)
{
"success": false,
"error": "Too many requests, please try again later"
}