Clone this repository:
git pull https://github.com/anatolio-deb/sellspoint
Create a virtual environment:
python3 -m venv venv
Activate a virtual environment:
source ./venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Apply the migrations:
python manage.py makemigrations && python manage.py migrate
Run the local development server:
python manage.py runserver
The API comes with two REST endpoints available.
- URL:
/api/sell-points/
- Methods available:
GET
- Accepts: a
phone_number
data field for an authorisation purposes - Returns: a list of Sell Points by an existing Worker(User)
- 400 — The request is missing a
phone_number
field - 404 — There’s no a Worker instance with a
phone_number
field coming in the request
- URL:
/api/visits/
- Methods available:
POST
- Accepts: a
phone_number
data field for an authorisation purposes,pk
of the Sells Point instance,longitude
andlatitude
data fields - Returns:
pk
of created Visit instance and thetime
field
- 400 — The request is missing a
phone_number
field - 404 — There’s no a Worker instance with a
phone_number
field coming in the request - 201 — The Visit instance is created