class Api::VerificationsController < Api::ApiController
	def new
		phone_number = params[:phone_number]

		#TODO - user generate
		cus = Customer.new
		@cus = cus.draft_customer(params, rand(1000..9999))
	    if @cus.verify_status == false
	    	VerifyNumber.send_message(phone_number, @cus.pin_code)
	    	@result = true
	    end
	end

	def update
		phone_number = params[:phone_number]
		pin_code = params[:pin_code]
		@cus = Customer.find_by_contact_no(phone_number)
		if !@cus.nil? && @cus.pin_code.to_i == pin_code.to_i
			@cus.verify_status = true
			@cus.save
			@result = true
		end
	end

end
