menu and menu item categories

This commit is contained in:
Min Zeya Phyo
2017-04-15 17:33:45 +06:30
parent 355f4fadb0
commit 63c5c97f24
24 changed files with 303 additions and 39 deletions

View File

@@ -0,0 +1,15 @@
class Api::Restaurant::BillController < Api::ApiController
#Create invoice based on booking
#Output and invoice
def create
end
private
def bill_params
params.permit(:booking_id, :order_id)
end
end

View File

@@ -0,0 +1,15 @@
class Api::Restaurant::MoveController < Api::ApiController
#Move between table
def update
end
private
# Use callbacks to share common setup or constraints between actions.
def move_params
params.permit(:booking_id, :order_id)
end
end

View File

@@ -0,0 +1,37 @@
class Api::Restaurant::MenuController < Api::ApiController
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id
def index
@menus = Menu.all
@current_menu = Menu.current_menu
end
#Description
# This API show current order details
# Input Params - menu_id
def show
@menu = menu_detail(params[:id])
end
private
def menu_detail (menu_id)
if (menu_id)
#Pull this menu
menu = Menu.find_by_id(menu_id)
return menu
else
Menu.current_menu
end
end
def menu_params()
params.permit(:id)
end
end

View File

@@ -4,7 +4,9 @@ class Api::Restaurant::MenuController < Api::ApiController
# Pull the default menu details and also other available (active) menus
# Input Params - order_id
def index
@menu = menu_detail()
@menus = Menu.all
@current_menu = Menu.current_menu
end
#Description
@@ -22,8 +24,7 @@ class Api::Restaurant::MenuController < Api::ApiController
menu = Menu.find_by_id(menu_id)
return menu
else
#Pull Default menu
Menu.current_menu
end
end

View File

@@ -0,0 +1,13 @@
class Api::Restaurant::MenuItemAttributesController < Api::ApiController
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id
def index
@menu_attributes = MenuItemAttribute.all
end
end

View File

@@ -0,0 +1,13 @@
class Api::Restaurant::MenuItemOptionsController < Api::ApiController
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id
def index
@menu_options = MenuItemOption.all
end
end

View File

@@ -0,0 +1,12 @@
class Api::Restaurant::MenuSoldOutController < Api::ApiController
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id
def index
end
end