Skip to content

alaahatem/Delivery-Service

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript of a Delivery API

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Order Management API Documentation

This document outlines the endpoints and their functionalities for the Order Management API.

Endpoints

1. Create Order

  • Method: POST
  • Endpoint: /order
  • Description: Create a new order with pickup and dropoff details along with package information.
  • Request Body:
    {
      "dropoff": {
        "address": "Oudenoord 330",
        "city": "Utrecht",
        "country": "Netherlands",
        "email": "[email protected]",
        "name": "Name",
        "zipcode": "1234 AB",
        "phonenumber": "+31612795443"
      },
      "pickup": {
        "address": "Oudenoord 330",
        "city": "Utrecht",
        "country": "Netherlands",
        "email": "[email protected]",
        "phonenumber": "+31612795443",
        "zipcode": "5678 XZ",
        "name": "Name"
      },
      "packages": [
        {
          "height": 50,
          "length": 20,
          "width": 10,
          "weight": 50
        },
        {
          "height": 10,
          "length": 10,
          "width": 10,
          "weight": 5
        }
      ]
    }
    

2. Update Order Status

  • Method: PUT
  • Endpoint: /order/:id
  • Description: Update the status of an existing order.
  • Request Body:
    {
      "status": "PICKED_UP" 
    }

3. Search Orders

  • Method: GET
  • Endpoint: /order?address="O"&zipcode="1234 AB"
  • Description: Search for orders based on partial address and full zipcode.
  • Query Parameters:
    • address: Partial address to search for.
    • zipcode: Full zipcode to match.
  • Response: Returns the list of orders matching the search criteria.

Test

# unit tests
$ npm run test

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published