Skip to content

abayo-luc/SendIT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Maintainability Test Coverage

SendIT-API

A Social platform for sending Parcels in any location

Get Started

Installing dependencies
npm install

Create Development DB
npm run db:create

Run All migration
npm run db:migrate

Starting development server
npm start

Run the tests
npm run test

API -Endpoints

JSON object is expected to returned by each API end point, and their structure is below:

##Parcels GET /parcels

{
    "msg": "all parcels",
    "parcels": [
        {
            "id": 1,
            "pickupLocation": "Kigali",
            "destination": "Kigeme",
            "weight": 5,
            "quantity": 8,
            "userId": 1,
            "status": "in_transity",
            "createdAt": "2018-11-09T15:44:41.918Z"
        }
    ]
}

GET /parcels/<parcelId>

{
    "msg": "parcel found",
    "parcel": {
        "id": 1,
        "pickupLocation": "Kigali",
        "destination": "Kigeme",
        "weight": 5,
        "quantity": 8,
        "userId": 1,
        "status": "canceled",
        "createdAt": "2018-11-09T15:44:41.918Z"
    }
}

GET /users/<userId>/parcels

NB: Currently, to test this endpoint user 1 as userId

{
    "msg": "user pracles",
    "parcels": [
        {
            "id": 1,
            "pickupLocation": "Kigali",
            "destination": "Kigeme",
            "weight": 5,
            "quantity": 8,
            "userId": 1,
            "status": "canceled",
            "createdAt": "2018-11-09T15:44:41.918Z"
        }
    ]
}

PUT /parcels/<parcelId>/cancel

{
    "msg": "Parcel order canceled",
    "parcel": {
        "id": 1,
        "pickupLocation": "Kigali",
        "destination": "Kigeme",
        "weight": 5,
        "quantity": 8,
        "userId": 1,
        "status": "canceled",
        "createdAt": "2018-11-09T15:44:41.918Z"
    }
}

POST /parcels

required params are: pickupLocation, destination, weight, quantity.

{
    "msg": "Parcel created",
    "parcel": {
        "id": 1,
        "pickupLocation": "Kigali",
        "destination": "Kigeme",
        "weight": 5,
        "quantity": 8,
        "userId": 1,
        "status": "in_transity",
        "createdAt": "2018-11-09T15:44:41.918Z"
    }
}

About

The back-end of SendIT App, which is a courier service that helps users deliver parcels to different destinations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published