Create POST /visits endpoint which creates a row in the Visit table for the actual visit and also rows in the Order table for all the dishes ordered during the visit along with their rating, review etc.
The request body for this endpoint will look as follows:
{
"user_id": 1,
"restaurant_id": 23086,
"date": "2024-10-17",
"time": "<choose format that you like>",
"orders": [
{
"dishId": 1,
"rating": 4.7,
"review_text": "The best pizza ever!"
},
...
]
}
This takes in a user_id for which the visit has to be created. This is okay for now and will be replaced by an actual API auth mechanism later. You may use user_id=1 which is a test user which already exists in the DB for testing the endpoint
Please remember to update the openapi.yaml and openapi.json files to document the above changes!
Create POST /visits endpoint which creates a row in the Visit table for the actual visit and also rows in the Order table for all the dishes ordered during the visit along with their rating, review etc.
The request body for this endpoint will look as follows:
This takes in a
user_id
for which the visit has to be created. This is okay for now and will be replaced by an actual API auth mechanism later. You may useuser_id
=1
which is a test user which already exists in the DB for testing the endpointPlease remember to update the openapi.yaml and openapi.json files to document the above changes!