Doof App is a Node.js-based RESTful API. The goal is to manage information about restaurants and their respective menus.
id
: stringfirstName
: stringlastName
: stringemail
: stringpassword
: stringaddress
: string
Endpoint: POST /consumer
Request Body:
{
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"address": "string"
}
Response: Returns a single consumer.
Endpoint: POST /consumer/auth
Request Body:
{
"email": "string",
"password": "string"
}
Response: Returns a bearer token.
Endpoint: GET /consumer
Response: Returns an array of consumers.
REQUIRES CONSUMER BEARER TOKEN
Endpoint: PUT /consumer
Request Body:
Optional
{
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"address": "string"
}
Response: Returns a single consumer.
REQUIRES CONSUMER BEARER TOKEN
Endpoint: Delete /consumer
Response:
true
if deleted
false
if not deleted
id
: stringfirstName
: stringlastName
: stringemail
: stringpassword
: stringrestaurants
: Restaurant[]
Endpoint: POST /owner
Request Body:
{
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string"
}
Response: Returns a single owner.
Endpoint: POST /owner/auth
Request Body:
{
"email": "string",
"password": "string"
}
Response: Returns a bearer token.
Endpoint: GET /owner
Response: Returns an array of owners.
REQUIRES OWNER BEARER TOKEN
Endpoint: PUT /owner
Request Body:
Optional
{
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string"
}
Response: Returns a single owner.
REQUIRES OWNER BEARER TOKEN
Endpoint: Delete /owner
Also deletes all restaurants associated to its Owner
Response:
true
if deleted
false
if not deleted
id
: stringname
: stringprice
: numbercategory
: ProductCategoryimageUrl
: stringrestaurantId
: stringisDiscount
: booleandiscountPrice
?: numberdiscountStart
?: DatetimediscountEnd
?: DatetimediscountText
?: string
REQUIRES OWNER BEARER TOKEN
Endpoint: POST /product
Request Body:
{
"name": "string",
"price": "number",
"category": "ProductCategory",
"imageUrl": "string",
"restaurantId": "string",
"isDiscount": "boolean",
_OPTIONAL_
"discountPrice": "number",
"discountTime": "Date",
"discountText": "string"
}
Response: Returns a single product.
REQUIRES OWNER BEARER TOKEN
Endpoint: PUT /product/${productId}
Request Body:
Optional
{
"name": "string",
"price": "number",
"category": "ProductCategory",
"imageUrl": "string",
"restaurantId": "string",
"isDiscount": "boolean",
"discountPrice": "number",
"discountTime": "Date",
"discountText": "string"
}
Response: Returns a single product.
REQUIRES OWNER BEARER TOKEN
Endpoint: Delete /product/${productId}
Response:
true
if deleted
false
if not deleted
id
: stringname
: stringaddress
: stringimageUrl
: stringweekOpeningTime
: DateweekClosingTime
: DateweekendOpeningTime
: DateweekendClosingTime
: DateownerId
: string
Endpoint: GET /restaurant
Response: Returns an array of restaurants.
REQUIRES OWNER BEARER TOKEN
Endpoint: POST /restaurant
Request Body:
{
"name": "string",
"address": "string",
"imageUrl": "string",
"weekOpeningTime": "Date",
"weekClosingTime": "Date",
"weekendOpeningTime": "Date"
"weekendClosingTime": "Date"
Response: Returns a single restaurant.
REQUIRES OWNER BEARER TOKEN
Endpoint: PUT /restaurant/${restaurantId}
Request Body:
Optional
{
"name": "string",
"address": "string",
"imageUrl": "string",
"weekOpeningTime": "Date",
"weekClosingTime": "Date",
"weekendOpeningTime": "Date"
"weekendClosingTime": "Date"
}
Response: Returns a single restaurant.
REQUIRES OWNER BEARER TOKEN
Endpoint: Delete /restaurant/${restaurantId}
Response:
true
if deleted
false
if not deleted
id
: stringcreatedAt
: DateupdatedAt
: Datestate
: OrderStateconsumerId
: stringrestaurantId
: stringproducts
: Product[ ]
REQUIRES OWNER BEARER TOKEN
Endpoint: GET /order/${restaurantId}
Response: Returns an array of orders made to a single restaurant.
REQUIRES CONSUMER BEARER TOKEN
Endpoint: POST /order/${restaurantId}
Request Body:
{
"ids": "string[ ]"
}
Response: Returns a single order.
REQUIRES OWNER BEARER TOKEN
Endpoint: PUT /order/${orderId}
Request Body:
{
"state": "OrderState"
}
Response: Returns a single order