update checking booking

This commit is contained in:
Aung Myo
2017-12-14 17:10:05 +06:30
parent fc45198542
commit 035d0851ee
6 changed files with 49 additions and 0 deletions

View File

@@ -5,8 +5,12 @@ class Api::CheckInProcessController < Api::ApiController
dining_facility = DiningFacility.find(params[:dining_id])
booking = dining_facility.get_current_checkout_booking
if !booking.nil?
DiningFacility.check_in_booking(params[:dining_id])
check_in_time = booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time }
else
render :json => { :status => false, :error_message => "No current booking!" }