class Delivery < ApplicationRecord
	belongs_to :order_reservation

	def self.addDeliveryInfo(params,order_reservation_id)
		delivery = Delivery.new
		delivery.order_reservation_id = order_reservation_id
		delivery.provider = params[:provider]
		delivery.delivery_type = params[:delivery_type]
		delivery.township = params[:township]
		delivery.address = params[:address]
		delivery.direction_address = params[:address_direction]
		delivery.delivery_fee = params[:delivery_fee]
		delivery.remark = params[:delivery_note]
		delivery.save!
	end
end
