menu, table,rooms, orders structure

This commit is contained in:
Min Zeya Phyo
2017-04-03 21:26:22 +06:30
parent 40423c12d3
commit 30b4a0f5ff
60 changed files with 536 additions and 101 deletions

View File

@@ -0,0 +1,9 @@
class Api::AuthenticateController < ActionController::API
def create
end
def destroy
end
end

View File

@@ -0,0 +1,10 @@
class Api::CustomersController < ActionController::API
#List all active customers by name
def index
end
#Show customer by ID
def show
end
end

View File

@@ -0,0 +1,24 @@
class Api::Restaurant::InvoiceController < ActionController::API
before :authenticate_token
#Description
# This API show current order details
# Input Params - order_id
def show
order = Order.find(params[:order_id])
order.order_items
end
# Description
# This API allow new invoice creation
# Input Params
# order_id
# Output Params
# Status [Success | Error | System Error] , order_id, error_message (*)
def create
end
end

View File

@@ -0,0 +1,29 @@
class Api::Restaurant::MenuController < ActionController::API
before :authenticate_token
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id
def index
menu_detail()
end
#Description
# This API show current order details
# Input Params - menu_id
def show
menu_detail(params[:menu_id])
end
private
def menu_detail
if (menu_id)
#Pull this menu
else
#Pull Default menu
end
end
end

View File

@@ -0,0 +1,36 @@
class Api::Restaurant::OrderController < ActionController::API
before :authenticate_token
#Description
# This API show current order details
# Input Params - order_id
def show
order = Order.find(params[:order_id])
order.order_items
end
# Description
# This API allow new order creation
# Input Params
# order_source [* default - emenu] | table_id (*require for Dine-In) | order_type [* Default - Dine-in]
# | guest_info (optional) | customer_id (optional)
# order_items {[item_code, item_instance_code , qty, option, variants]}
# Output Params
# Status [Success | Error | System Error] , order_id, error_message (*)
def create
end
# Description
# This API - allow order to add new items to existing orders, does not allow you to remove confirm items
# Update customer info, Guest Info
# Input Params
# order_id , order_items {[item_code, item_instance_code , qty, option, variants]}
def update
end
end

View File

@@ -0,0 +1,21 @@
class Api::Restaurant::RoomsController < ActionController::API
def index
render json: SeatTable.order("order_by")
end
# Description
# This API full the current status of table and if there is order attached to this table - Order_ID will be return
# Output
# status: {available, cleaning, occupied, reserved}, order_id : <current_order_id>
def show
end
#Input Params
# table_id: table_id
# Output
# status: error | success, error_message: <Problem with moving table>
def update
end
end

View File

@@ -1,5 +0,0 @@
class Api::Restaurant::SeatTablesController < ActionController::API
def index
render json: SeatTable.order("order_by")
end
end

View File

@@ -0,0 +1,21 @@
class Api::Restaurant::SeatingsController < ActionController::API
def index
render json: Zone.order("order_by")
end
# Description
# This API full the current status of table and if there is order attached to this table - Order_ID will be return
# Output
# status: {available, cleaning, occupied, reserved}, order_id : <current_order_id>
def show
end
#Input Params
# table_id: table_id
# Output
# status: error | success, error_message: <Problem with moving table>
def update
end
end

View File

@@ -0,0 +1,21 @@
class Api::Restaurant::TakeawaysController < ActionController::API
def index
render json: SeatTable.order("order_by")
end
# Description
# This API full the current status of table and if there is order attached to this table - Order_ID will be return
# Output
# status: {available, cleaning, occupied, reserved}, order_id : <current_order_id>
def show
end
#Input Params
# table_id: table_id
# Output
# status: error | success, error_message: <Problem with moving table>
def update
end
end

View File

@@ -1,4 +1,5 @@
class Api::Restaurant::ZonesController < ActionController::API
def index
render json: Zone.where("is_active = true")
end