menu and menu item categories
This commit is contained in:
15
app/controllers/api/bill_controller.rb
Normal file
15
app/controllers/api/bill_controller.rb
Normal 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
|
||||
15
app/controllers/api/move_controller.rb
Normal file
15
app/controllers/api/move_controller.rb
Normal 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
|
||||
37
app/controllers/api/restaurant/menu_categories.rb
Normal file
37
app/controllers/api/restaurant/menu_categories.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
12
app/controllers/api/restaurant/menu_sold_out.rb
Normal file
12
app/controllers/api/restaurant/menu_sold_out.rb
Normal 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
|
||||
Reference in New Issue
Block a user