This application allows interviewers and candidates to submit their time availabilities for the next week (only) through its RESTful API. Based on the time availabilities of interviewers and candidates, this application calculates the mutually agreeable interview time slots.
$ cd interview_scheduler
$ sudo -H pip install -r requirements.txt
This application has been developed and test on Ubuntu 16.04 LTS OS using Python2.7. For other OS platform, few instructions might need to be adapted.
$ cd interview_scheduler
$ export PYTHONPATH=$PWD
$ python run_scheduler.py
$ curl -d '{}' -H "Content-Type: application/json" -X POST http://localhost:5000/reset_scheduler
URI: http://localhost:5000/reset_scheduler
Method: POST
Content-Type: application/json
Body:
{ }
Response:
{
"Status": "Content of previous week is deleted from DBs. Application is now ready for use."
}
$ curl -d '{"name":"Candidate Name", "email":"[email protected]", "day": "Monday", "start_time": "13:20", "end_time": "14:00"}' -H "Content-Type: application/json" -X POST http://localhost:5000/candidate_schedule
URI: http://localhost:5000/candidate_schedule
Method: POST
Content-Type: application/json
Body:
{
"name": "Candidate Name",
"email": "[email protected]",
"day": "Monday",
"start_time": "13:20",
"end_time": "14:00"
}
Response:
{
"candidate_id": 1,
"day": "Monday",
"end_time": "14:00",
"start_time": "13:20"
}
A candidate can submit multiple time availabilities in the similar manner.
$ curl -X GET http://localhost:5000/candidate_schedule
URI: http://localhost:5000/candidate_schedule
Method: GET
Response:
{
"candidates_schedules": [
{
"candidate_id": 1,
"day": "Monday",
"end_time": "14:00",
"start_time": "13:20"
}
]
}
$ curl -d '{"name":"Interviewer Name", "email":"[email protected]", "day": "Monday", "start_time": "13:20", "end_time": "14:00"}' -H "Content-Type: application/json" -X POST http://localhost:5000/emp_schedule
URI: http://localhost:5000/emp_schedule
Method: POST
Content-Type: application/json
Body:
{
"name": "Interviewer Name",
"email": "[email protected]",
"day": "Monday",
"start_time": "13:20",
"end_time": "14:00"
}
Response:
{
"day": "Monday",
"emp_id": 1,
"end_time": "14:00",
"start_time": "13:20"
}
An interviewer can submit multiple time availabilities in the similar manner.
$ curl -X GET http://localhost:5000/emp_schedule
URI: http://localhost:5000/emp_schedule
Method: GET
Response:
{
"employees_schedules": [
{
"day": "Monday",
"emp_id": 1,
"end_time": "14:00",
"start_time": "13:20"
}
]
}
$ curl -d '{"candidate_email": "[email protected]", "interviewers_email": "[email protected], [email protected]"}' -H "Content-Type: application/json" -X POST http://localhost:5000/schedule_interview
URI: http://localhost:5000/schedule_interview
Method: POST
Content-Type: application/json
Body:
{
"candidate_email": "[email protected]",
"interviewers_email": "[email protected], [email protected]"
}
A sample of response returned by above POST RPC:
{
"candidate_email": "[email protected]",
"day": "Monday",
"end_time": "14:30",
"interviewers_emails": "[email protected], [email protected]",
"start_time": "12:30"
}
$ curl -X GET http://localhost:5000/schedule_interview
URI: http://localhost:5000/schedule_interview
Method: GET
Response:
{
"scheduled_interviews": [
{
"candidate_email": "[email protected]",
"day": "Monday",
"end_time": "14:30",
"interviewers_emails": "[email protected], [email protected]",
"start_time": "12:30"
}
]
}
400, 403, 404, 409, 500
First run the application server in a terminal and execute the following command in another terminal.
$ cd interview_scheduler
$ sh demo_usecase_run.sh
$ cd interview_scheduler
$ python -m unittest discover
All fields anticipates values in string format.
- "name": Name of a candidate or an interviewer, e.g; "Test Test".
- "email": We trust users to provide a valid email address, e.g; "[email protected]".
- "day": The value must belongs to one of these - "Monday", "Tuesday", "Wednesday", "Thursday", or "Friday".
- "start_time" and "end_time": Provide these values in 24 hours HH:MM format, e.g; "05:30"
- "candidate_email": It must be a string
- "interviewers_emails": The email addresses of interviewers should be seprated by comma