POST /localhost/restaurants
POST all restaurant
GET /localhost/restaurants
GET all restaurant
GET /localhost/restaurants/{restaurant}
GET a particular restaurant
DELETE /localhost/restaurants/{restaurant}
DELETE a particular restaurant
Resource Menu
POST /localhost/restaurants/{restaurant}/menu
POST the menu for particular restaurant
GET /localhost/restaurants/{restaurant}/menu
GET the full menu
Response:
{
food,
price
}
Resource User
POST /localhost/users
POST users
GET /localhost/users/{userId}
Resource Order
POST /localhost/users/{userId}/orders
POST a order
Require:
{
restaurant,
foodItem,
quantity,
note,
deliveryAddress
}
GET /localhost/users/{userId}/orders/{orderId}
GET a order
Response:
{
orderId,
foodItem,
quantity,
price,
orderTime,
orderStatus,
orderStatus
}
POST /localhost/users/{userId}/orders/{orderId}/pay
POST a payment
Request:
{
creditCardNumber,
expireDate,
securityCode
}
GET /localhost/users/{userId}/orders/{orderId}/pay/{paymentId}
Response:
{
paymentID,
timestamp,
estimateTime,
orderId,
orderStatus,
userId
}
Project Structure
Seen in Github folder
Test Cases
Seen in uploadTest.json
Explanations
Start the whole server user, restaurant and post the information
There are two databases order and payment
When customers post the order, it will store all information in the order database and it will go into the payment server. Payment server read the data from the order databases and store the payment data into the payment databases