Skip to content

Thangphan0102/wolt-engineering-internship-2024

Repository files navigation

Wolt engineering internship assignment 2024

Running the application

With Docker

Running the app

Run the app:

docker compose up

The API documentation is available at http://127.0.0.1:8000/docs.

Without Docker

Prerequisites:

  • Python 3.10 or later

Setting up the environment:

Create a virtual environment:

python3 -m venv venv

Activate the virtual environment:

  • Linux / MacOS:

    source .venv/bin/activate

Install the dependencies:

pip install -r dev-requirements.txt

Running the app:

uvicorn app.main:app

The API documentation is available at http://127.0.0.1:8000/docs.

Tests

pytest

Using the API

Available endpoint(s)

URL Method Functionality
api/v1/fees/calculate_fee POST Calculate the delivery fee

/api/v1

  • /fees

    • /calculate_fee

      Example request:

      Request body:

      {
      "cart_value": 790,
      "delivery_distance": 2235,
      "number_of_items": 4,
      "time": "2024-01-15T13:00:00Z"
      }

      Using curl:

      curl -X "POST" \
          "http://127.0.0.1:8000/api/v1/fees/calculate_fee" \
          -H "accept: application/json" \
          -H "Content-Type: application/json" \
          -d "{\"cart_value\": 790, \"delivery_distance\": 2235, \"number_of_items\": 4, \"time\": \"2024-01-15T13:00:00Z\"}"

      Example response:

      {"delivery_fee": 710}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published