This project is build using Nodejs (Express, Objection.js, Knex)
Features: 2. Display list of orders for user. Consists of order details and status states. 2. Create new orders for user. 3. Make payment for the orders.
Installation:
- run
npm run reset
at root directory of the project. Make sure to create database first and add those details to.env
before you run this command. Please refer to.env.example
on creating your own.env
. - run
npm run start
to start the service - For creating few mocking data, run
npm run test
(Not Ready yet). - Please create a mock user before starting
APP-deployment: TBD
Usage API:
- get all users
GET /api/users?page[number]=1&page[size]=10,filter[email]=123@abc.com
- get user by id
GET /api/users/:id
- create new users
POST /api/users
{
username: 'Jack Sparrow',
email: 'jack@blackpearl.com',
password: '1234Jack',
payment_credentials: {
card_number: 1234...,
cvv_number: 123,
date_expiry: 12/20
}
}
- get all orders
GET /api/order?page[number]=1,page[size]=10
- get order by id
GET /api/orders/:id
- create new order
POST /api/orders
{
title: 'ORDER-A',
descriptions: 'new ship',
user_id: 1
}
- update an order
POST /api/orders/:id
{
title: 'ORDER-A',
descriptions: 'new ship',
user_id: 1
}
- delete an order
DELETE /api/orders/:id
- Retry payment for an order
POST /api/orders/:id/retry_payment