add alert_time_min in api/checkin and check for waiter login

This commit is contained in:
phyusin
2017-12-27 10:30:22 +06:30
parent 48fb5563f5
commit 3d235f9d69
6 changed files with 56 additions and 16 deletions

View File

@@ -11,7 +11,17 @@ class Api::CheckInProcessController < Api::ApiController
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 }
lookup_checkout_time = Lookup.collection_of("checkout_alert_time")
alert_time_min = 0
if !lookup_checkout_time.nil?
if lookup_checkout_time[0][0] == 'min'
alert_time_min = (lookup_checkout_time[0][1]).to_i
else
alert_time_min = 15
end
end
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time, :alert_time_min => alert_time_min }
else
render :json => { :status => false, :error_message => "No current booking!" }
end