add extra minutes in api/check_in

This commit is contained in:
phyusin
2017-12-28 17:48:56 +06:30
parent 06acf3acb9
commit 90525b9391

View File

@@ -11,6 +11,8 @@ 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")
extra_minutes = (booking.checkout_at - booking.reserved_at) / 1.minutes
lookup_checkout_time = Lookup.collection_of("checkout_alert_time")
alert_time_min = 0
if !lookup_checkout_time.nil?
@@ -21,7 +23,7 @@ class Api::CheckInProcessController < Api::ApiController
end
end
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time, :alert_time_min => alert_time_min }
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time, :alert_time_min => alert_time_min, :extra_minutes => extra_minutes }
else
render :json => { :status => false, :error_message => "No current booking!" }
end