check time
This commit is contained in:
@@ -49,7 +49,7 @@ class Api::CheckInProcessController < Api::ApiController
|
||||
arr_time = checkout_time[0].split("-")
|
||||
start_time = Time.parse(arr_time[0].strip).utc.getlocal.strftime("%H:%M%p")
|
||||
end_time = Time.parse(arr_time[1].strip).utc.getlocal.strftime("%H:%M%p")
|
||||
if start_time <= checkout_at.strftime("%H:%M%p") && checkout_at.strftime("%H:%M%p") <= end_time
|
||||
if start_time <= today.strftime("%H:%M%p") && today.strftime("%H:%M%p") <= end_time
|
||||
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Api::OrderReservationController < Api::ApiController
|
||||
skip_before_action :authenticate
|
||||
class Api::OrderReservation::OrderReservationController < Api::ApiController
|
||||
# skip_before_action :authenticate
|
||||
|
||||
def check_customer
|
||||
customer_name = params[:name]
|
||||
@@ -8,11 +8,10 @@ class Api::OrderReservationController < Api::ApiController
|
||||
customer_gender = params[:gender]
|
||||
customer_addr = params[:address]
|
||||
customer_membership_id = params[:membership_id]
|
||||
customer_membership_type = params[:membership_type]
|
||||
customer_date_of_birth = params[:date_of_birth]
|
||||
customer_id = 0
|
||||
|
||||
check_customer = Customer.find_by_email_and_contact_no_and_membership_id_and_membership_type(customer_email,customer_contact_no,customer_membership_id,customer_membership_type)
|
||||
check_customer = Customer.find_by_email_and_contact_no_and_membership_id(customer_email,customer_contact_no,customer_membership_id)
|
||||
if !check_customer.nil?
|
||||
customer_id = check_customer.customer_id
|
||||
else
|
||||
@@ -24,11 +23,13 @@ class Api::OrderReservationController < Api::ApiController
|
||||
customer.address = customer_addr
|
||||
customer.date_of_birth = Time.parse(customer_date_of_birth).strftime("%Y-%m-%d")
|
||||
customer.membership_id = customer_membership_id
|
||||
customer.membership_type = customer_membership_type
|
||||
customer.save!
|
||||
customer.customer_type = "Doemal"
|
||||
customer.tax_profiles = ["2"]
|
||||
customer.save
|
||||
|
||||
customer_id = customer.id
|
||||
end
|
||||
|
||||
render :json => { :status => true, :data => { customer_id : customer_id} }
|
||||
render :json => { :status => true, :data => { :customer_id => customer_id} }
|
||||
end
|
||||
end
|
||||
@@ -9,10 +9,10 @@ class Customer < ApplicationRecord
|
||||
has_many :orders
|
||||
has_many :sales
|
||||
|
||||
validates_presence_of :name, :contact_no, :email,:card_no
|
||||
validates_presence_of :name, :contact_no, :email #,:card_no
|
||||
validates :contact_no, uniqueness: true, numericality: true
|
||||
validates :email, uniqueness: true,format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }
|
||||
validates :card_no, uniqueness: true
|
||||
# validates :card_no, uniqueness: true
|
||||
# validates :paypar_account_no, uniqueness: true
|
||||
|
||||
paginates_per 50
|
||||
|
||||
0
app/views/api/order_reservation/index.json.jbuilder
Normal file
0
app/views/api/order_reservation/index.json.jbuilder
Normal file
Reference in New Issue
Block a user