Skip to content

Latest commit

 

History

History
122 lines (82 loc) · 1.56 KB

REQUIREMENTS.md

File metadata and controls

122 lines (82 loc) · 1.56 KB

API Endpoints

Products

  • Index
  GET '/api/v1/store/products/'
  • Show
  GET '/api/v1/store/products/:pid'
  • Create : Authentication Added
  POST '/api/v1/store/products/'
  • Delete
  DELETE '/api/v1/store/products/:pid'

Users

  • Index: including Authentication
  GET '/api/v1/store/users'
  • Show
  GET '/api/v1/store/users/:uid'
  • Create
  POST '/api/v1/store/users/'
  • Delete
  DELETE '/api/v1/store/users/:uid'
  • Sign In
  GET '/api/v1/store/users/login'

Orders

All Routes include Authentication

  • Index
  GET '/api/v1/store/orders/'
  • Show
  GET '/api/v1/store/orders/:oid'
  • Create
  POST '/api/v1/store/orders/'
  • Delete
  DELETE '/api/v1/store/orders/:oid'
  • Current Orders by User
  GET '/api/v1/store/orders/users/:uid'

Data Shapes

Product

TABLE Products ( id SERIAL NOT NULL, name VARCHAR(100) NOT NULL, price INTEGER NOT NULL, category VARCHAR(100) NULL );

User

TABLE Users( id SERIAL NOT NULL, username VARCHAR(30) NOT NULL, firstname VARCHAR(20) NOT NULL, lastname VARCHAR(20) NOT NULL, password VARCHAR NOT NULL );

Orders

TABLE Orders ( id SERIAL NOT NULL, user_id INTEGER NOT NULL, status VARCHAR(20) NOT NULL, date DATE NOT NULL );

TABLE order_product ( id SERIAL NOT NULL, order_id INTEGER NOT NULL, prod_id INTEGER NOT NULL, quantity INTEGER NOT NULL );