foodcourt apis for app

This commit is contained in:
Thein Lin Kyaw
2022-07-08 16:06:12 +06:30
parent 7485486868
commit 063345eae3
37 changed files with 785 additions and 171 deletions

View File

@@ -0,0 +1,25 @@
class Api::Foodcourt::BillsController < Api::ApiController
def create
Sale.transaction do
if shift = ShiftSale.current_open_shift(current_login_employee)
if booking = Booking.find(params[:booking_id])
cashier = Employee.find(shift.employee_id)
order = booking.orders.first
if @sale_data = booking.sale
@status = true
elsif @sale_data = Sale.generate_invoice_from_booking(booking, current_login_employee, cashier, order.source, params[:current_checkin_induties_count])
@status = true
else
@status = false
end
end
else
@status = false
@error_message = "No Current Open Shift"
end
end
end
end