order submission and order queue submission basic done
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class Api::Restaurant::OrdersController < ActionController::API
|
||||
class Api::OrdersController < ActionController::API
|
||||
#before :authenticate_token
|
||||
|
||||
#Description
|
||||
@@ -19,13 +19,15 @@ class Api::Restaurant::OrdersController < ActionController::API
|
||||
# Output Params
|
||||
# Status [Success | Error | System Error] , order_id, error_message (*)
|
||||
def create
|
||||
Rails.logger.debug "Order Source - " + params[:order_source]
|
||||
Rails.logger.debug "Table ID - " + params[:table_id]
|
||||
|
||||
# begin
|
||||
@order = Order.new
|
||||
@order.source = params[:order_source]
|
||||
@order.order_type = params[:order_type]
|
||||
@order.customer_id = params[:customer_id]
|
||||
json_hash = params[:order_items]
|
||||
@order.items = json_hash
|
||||
@order.items = params[:order_items]
|
||||
@order.guest = params[:guest_info]
|
||||
@order.table_id = params[:table_id]
|
||||
@order.new_booking = true
|
||||
@@ -38,7 +40,8 @@ class Api::Restaurant::OrdersController < ActionController::API
|
||||
@order.booking_id = params[:booking_id]
|
||||
end
|
||||
|
||||
@status = @order.generate
|
||||
@status = @order.generate
|
||||
|
||||
# rescue Exception => error
|
||||
# @status = false
|
||||
# @error_messages = "Exception has occurs on System"
|
||||
@@ -59,5 +62,9 @@ class Api::Restaurant::OrdersController < ActionController::API
|
||||
|
||||
end
|
||||
|
||||
|
||||
def order_params
|
||||
params.permits(:order_source, :booking_id,:order_type,
|
||||
:customer_id,:guest_info, :table_id, :room_id,
|
||||
order_items: [:item_code, :qty, :option, :remark])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user