This app implements the app requested at Work at Olist challenge
- Clone this repo to your local machine
- After cloning, you should run
make build
- Then
make run
and we're good to go
Obs. The db.sqlite3 file within this repository contains some data that can be tested.
Just make test
- all tests should pass.
Alternatively you can access the app on Heroku via https://call-management.herokuapp.com/api/v1/
The base URL for access the API is at http://localhost:8000/api/v1/
You can access the brief API documentation at {base_url}/docs/
To start a call, just send a POST to {base_url}/calls
containing the data below
{
"source": // Source phone number following the format AAXXXXXXXXX
"destination": // Destination number following the format AAXXXXXXXXX
"timestamp": // Optional - The timestamp of when the call started, if not informed, will assume today.now().
}
You will receive a response containing the identifier for your call which must be used to end the call.
To end a call, send a PUT request to {base_url}/calls/{identifier}/end-call/
containing the data below
{
"identifier": // Identifier of the call
"timestamp": // Optional - The timestamp of when the call has_ended.
}
As response, you will receive a json containing the duration and the cost of this call. If the timestamp won't be informed, will assume now();
To get a bill report, send a GET request to {base_url}/bill/
informing the ?phone
and optionally &period
params, if &period
won't be informd, will assume the last closed period.
ASUS Core I5 8Gb Ram
Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial
- Python 3.5.2 (3.6.4 at Heroku)
- Django 1.11
- Django Rest Framework 3.3.1
- Django Rest Swagger
- psycopg2
- gunicorn
- Django Whitenoise
- flake8
- ipdb
- VSCode
- iPython
- Git / Github
- Heroku cli
- DBeaver