update seed generator and remove hard-coded customer id
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
class Api::ApiController < ActionController::API
|
||||
|
||||
include MultiTenancy
|
||||
include TokenVerification
|
||||
include ActionController::MimeResponds
|
||||
include ActionView::Rendering
|
||||
include Customers
|
||||
|
||||
# before_action :lookup_domain
|
||||
helper_method :current_token, :current_login_employee, :get_cashier
|
||||
|
||||
@@ -140,7 +140,7 @@ class Api::BillController < Api::ApiController
|
||||
@order = Order.new
|
||||
@order.source = "cashier"
|
||||
@order.order_type = "Takeaway"
|
||||
@order.customer_id = "CUS-000000000002" # for no customer id from mobile
|
||||
@order.customer_id = takeaway.customer_id # for no customer id from mobile
|
||||
@order.items = params[:order_items]
|
||||
@order.guest = params[:guest_info]
|
||||
@order.table_id = params[:table_id] # this is dining facilities's id
|
||||
|
||||
@@ -93,7 +93,7 @@ class Api::OrdersController < Api::ApiController
|
||||
@order = Order.new
|
||||
@order.source = params[:order_source]
|
||||
@order.order_type = params[:order_type]
|
||||
@order.customer_id = params[:customer_id] == ""? "CUS-000000000001" : params[:customer_id] # for no customer id from mobile
|
||||
@order.customer_id = params[:customer_id].present? ? params[:customer_id] : walkin.customer_id # for no customer id from mobile
|
||||
@order.items = params[:order_items]
|
||||
@order.guest = params[:guest_info]
|
||||
@order.table_id = params[:table_id] # this is dining facilities's id
|
||||
@@ -113,7 +113,7 @@ class Api::OrdersController < Api::ApiController
|
||||
end
|
||||
|
||||
@status, @booking = @order.generate
|
||||
|
||||
|
||||
if @status && @booking
|
||||
Order.process_order_queue(@order.order_id,@order.table_id,@order.source)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user