{
	"info": {
		"_postman_id": "48b72fdd-4adf-4900-9ea1-0e3e12bf02f7",
		"name": "Restaurant API",
		"description": "Response Codes:\n\n- 200: The request was successful.\n- 422: There was a validation error.\n- 4xx: There was an error from the client side.\n- 5xx: There was an error from the server side.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Restaurant",
			"item": [
				{
					"name": "List Restaurants",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text",
								"warning": ""
							}
						],
						"url": {
							"raw": "{{URL}}/restaurants/list",
							"host": [
								"{{URL}}"
							],
							"path": [
								"restaurants",
								"list"
							]
						}
					},
					"response": []
				},
				{
					"name": "Add Restaurant",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "name",
									"value": "Home Style",
									"type": "text"
								},
								{
									"key": "address_line_1",
									"value": "Mahatma Gandhi road",
									"type": "text"
								},
								{
									"key": "address_line_2",
									"value": "",
									"type": "text"
								},
								{
									"key": "pincode",
									"value": "360001",
									"type": "text"
								},
								{
									"key": "city",
									"value": "Rajkot",
									"type": "text"
								},
								{
									"key": "state_id",
									"value": "1479",
									"type": "text"
								},
								{
									"key": "country_id",
									"value": "95",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/restaurants/add",
							"host": [
								"{{URL}}"
							],
							"path": [
								"restaurants",
								"add"
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Restaurant",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "name",
									"value": "Home Style 2",
									"type": "text"
								},
								{
									"key": "address_line_1",
									"value": "Mahatma Gandhi road",
									"type": "text"
								},
								{
									"key": "address_line_2",
									"value": "",
									"type": "text"
								},
								{
									"key": "pincode",
									"value": "360001",
									"type": "text"
								},
								{
									"key": "city",
									"value": "Rajkot",
									"type": "text"
								},
								{
									"key": "state_id",
									"value": "1479",
									"type": "text"
								},
								{
									"key": "country_id",
									"value": "95",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/restaurants/update/5",
							"host": [
								"{{URL}}"
							],
							"path": [
								"restaurants",
								"update",
								"5"
							]
						}
					},
					"response": []
				},
				{
					"name": "Archive Restaurant",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"url": {
							"raw": "{{URL}}/restaurants/archive/5",
							"host": [
								"{{URL}}"
							],
							"path": [
								"restaurants",
								"archive",
								"5"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Menu Item",
			"item": [
				{
					"name": "Add Menu Item",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "name",
									"value": "Home Style",
									"type": "text"
								},
								{
									"key": "price",
									"value": "50",
									"description": "USD",
									"type": "text"
								},
								{
									"key": "description",
									"value": "",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/menu-items/add",
							"host": [
								"{{URL}}"
							],
							"path": [
								"menu-items",
								"add"
							]
						}
					},
					"response": []
				},
				{
					"name": "List Menu Items",
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": []
						},
						"url": {
							"raw": "{{URL}}/menu-items/list?restaurant_id=1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"menu-items",
								"list"
							],
							"query": [
								{
									"key": "restaurant_id",
									"value": "1"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Menu Item",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "6",
									"type": "text"
								},
								{
									"key": "name",
									"value": "Home Style 3",
									"type": "text"
								},
								{
									"key": "price",
									"value": "150",
									"type": "text"
								},
								{
									"key": "description",
									"value": "Test Desc",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/menu-items/update/2",
							"host": [
								"{{URL}}"
							],
							"path": [
								"menu-items",
								"update",
								"2"
							]
						}
					},
					"response": []
				},
				{
					"name": "Archive Menu Item",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"url": {
							"raw": "{{URL}}/menu-items/archive/2?restaurant_id=5",
							"host": [
								"{{URL}}"
							],
							"path": [
								"menu-items",
								"archive",
								"2"
							],
							"query": [
								{
									"key": "restaurant_id",
									"value": "5"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Table",
			"item": [
				{
					"name": "Add Table",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "number",
									"value": "1",
									"type": "text"
								},
								{
									"key": "extra_details",
									"value": "",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/tables/add",
							"host": [
								"{{URL}}"
							],
							"path": [
								"tables",
								"add"
							]
						}
					},
					"response": []
				},
				{
					"name": "List Tables",
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": []
						},
						"url": {
							"raw": "{{URL}}/tables/list?restaurant_id=1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"tables",
								"list"
							],
							"query": [
								{
									"key": "restaurant_id",
									"value": "1"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Table",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "5",
									"type": "text"
								},
								{
									"key": "number",
									"value": "2",
									"type": "text"
								},
								{
									"key": "extra_details",
									"value": "Seating capacity - 6",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/tables/update/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"tables",
								"update",
								"1"
							]
						}
					},
					"response": []
				},
				{
					"name": "Mark Table as Non operational",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/tables/mark-as-non-operational/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"tables",
								"mark-as-non-operational",
								"1"
							]
						}
					},
					"response": []
				},
				{
					"name": "Mark Table as Available",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/tables/mark-as-available/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"tables",
								"mark-as-available",
								"1"
							]
						}
					},
					"response": []
				},
				{
					"name": "Mark Table as Reserved",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/tables/mark-as-reserved/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"tables",
								"mark-as-reserved",
								"1"
							]
						}
					},
					"response": []
				},
				{
					"name": "Archive Table",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json",
								"warning": ""
							}
						],
						"url": {
							"raw": "{{URL}}/tables/archive/1?restaurant_id=5",
							"host": [
								"{{URL}}"
							],
							"path": [
								"tables",
								"archive",
								"1"
							],
							"query": [
								{
									"key": "restaurant_id",
									"value": "5"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Orders",
			"item": [
				{
					"name": "Book a Table",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/orders/book-a-table/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"orders",
								"book-a-table",
								"1"
							]
						}
					},
					"response": []
				},
				{
					"name": "Fetch open orders",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{URL}}/orders/list-open?restaurant_id=1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"orders",
								"list-open"
							],
							"query": [
								{
									"key": "restaurant_id",
									"value": "1"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Fetch completed orders",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{URL}}/orders/list-completed?restaurant_id=1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"orders",
								"list-completed"
							],
							"query": [
								{
									"key": "restaurant_id",
									"value": "1"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Fetch Order details",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{URL}}/orders/details/1?restaurant_id=1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"orders",
								"details",
								"1"
							],
							"query": [
								{
									"key": "restaurant_id",
									"value": "1"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Complete Order",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/orders/complete/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"orders",
								"complete",
								"1"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Order Items",
			"item": [
				{
					"name": "Order Items",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "menu_items[0][id]",
									"value": "2",
									"description": "If the menu item is already a part of order items, the quantity will be incremented accordingly.",
									"type": "text"
								},
								{
									"key": "menu_items[0][quantity]",
									"value": "1",
									"type": "text"
								},
								{
									"key": "menu_items[1][id]",
									"value": "3",
									"type": "text"
								},
								{
									"key": "menu_items[1][quantity]",
									"value": "2",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/order-items/add/3",
							"host": [
								"{{URL}}"
							],
							"path": [
								"order-items",
								"add",
								"3"
							]
						}
					},
					"response": []
				},
				{
					"name": "Change Order Items Quantity",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "menu_items[0][id]",
									"value": "1",
									"type": "text"
								},
								{
									"key": "menu_items[0][quantity]",
									"value": "1",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/order-items/change-quantity/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"order-items",
								"change-quantity",
								"1"
							]
						}
					},
					"response": []
				},
				{
					"name": "Remove Order Items",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{Token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "restaurant_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "menu_item_ids[0]",
									"value": "2",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{URL}}/order-items/remove/1",
							"host": [
								"{{URL}}"
							],
							"path": [
								"order-items",
								"remove",
								"1"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Register",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"",
							"pm.collectionVariables.set(\"Token\", jsonData.token);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text",
						"warning": ""
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "name",
							"value": "estT",
							"type": "text"
						},
						{
							"key": "email",
							"value": "test@test.com",
							"type": "text"
						},
						{
							"key": "password",
							"value": "123456",
							"type": "text"
						},
						{
							"key": "password_confirmation",
							"value": "123456",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{URL}}/register",
					"host": [
						"{{URL}}"
					],
					"path": [
						"register"
					]
				}
			},
			"response": []
		},
		{
			"name": "Login",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"",
							"pm.collectionVariables.set(\"Token\", jsonData.token);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"type": "text",
						"value": "application/json",
						"warning": ""
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "email",
							"value": "test@test.com",
							"type": "text"
						},
						{
							"key": "password",
							"value": "123456",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{URL}}/login",
					"host": [
						"{{URL}}"
					],
					"path": [
						"login"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Countries",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{Token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"type": "text",
						"value": "application/json",
						"warning": ""
					}
				],
				"url": {
					"raw": "{{URL}}/get-countries",
					"host": [
						"{{URL}}"
					],
					"path": [
						"get-countries"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get States",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{Token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"type": "text",
						"value": "application/json",
						"warning": ""
					}
				],
				"url": {
					"raw": "{{URL}}/get-states",
					"host": [
						"{{URL}}"
					],
					"path": [
						"get-states"
					]
				}
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "URL",
			"value": "http://restaurant_api.local/api"
		},
		{
			"key": "Token",
			"value": "1|1hByBdqLqSQPA3dGpPZJLU7uAAE4TgVaDU9DxkNi"
		}
	]
}