Backend for campus store
- username: string
- email: string
- passwordHash: string
- orders: Id, ref -> Order
- isAdmin: boolean
- username: string
- email: string
- passwordHash: string
- orders: Id, ref -> Order
- name: string
- seller: Id, ref -> Seller
- price: number
- description: string
- image: string
- stock: number
- product: Id, ref -> Product
- seller: Id, ref -> Seller
- user: Id, ref -> user
- quantity: number
- confirmed: boolean
- delivered: boolean
- outForDelivery: boolean
req
- Body
- Required: { email, password }
res
- status: 201
- body: empty
req
- Body:
- Required: { email, password }
- Optional: { username, isAdmin }
res
- status: 200
- body: { token, user }
req
- Headers
- Authentication: Bearer token
- Body
- Required: email, password res
- status: 201
req
- Headers
- Authentication: Bearer token
res
- status: 200
- body: { orders }
res
- status: 200
- body: { [product] }
res
- status: 200
- body: { product }
req
- Headers
- Authentication: Bearer token
- Body
- Optional: { name, price, description, image, stock }
res
- status: 200
- body: { product }
req
- Headers
- Authentication: Bearer token
res
- status: 204
res
- status: 200
- body: { product }
req
- Headers
- Authentication: Bearer token
- Body
- Required: { quantity }
res
- status: 201
- body: { order }
req
- Headers
- Authentication: Bearer token
- Body
- Required: { name, price, description, image, stock }
res
- status: 201
- body: { product }
req
- Body
- Required: { email, password }
res
- status: 200
- body: { token, user }
req
- Headers
- Authentication: Bearer token
res
- status: 200
- body: { seller (populated) }
req
- Headers
- Authentication: Bearer token
res
- status: 200
- body: { seller (populated) }
req
- Headers
- Authentication: Bearer token
res
- status: 200
- body: { order }
req
- Headers
- Authentication: Bearer token
- body: { confirmed, delivered, outForDelivery }
res
- status: 200
- body: { order }