module Yardi module Parameter # Wraps the user-related data that we pass to Yardi. class User attr_reader :beds, :contact_info, :first_name, :id, :last_name, :message, :move_in_date, :preference_notes, :preferred_floorplan_id, :preferred_unit_id, :price # @param beds [Integer] Number of beds the renter is interested in # @param contact_info [Parameter::ContactInfo] Renter contact information # @param first_name [String] Renter first name # @param id [Integer] ID of the renter in Apartment List database, user.id # @param last_name [String] Renter last name # @param message [String] Message from the renter to the property # @param move_in_date [Date] Renter move in date # @param preference_notes [String] Notes to be inserted into Comments node # of CustomerPreferences section of guest card # @param preferred_floorplan_id [String] ID of Yardi floorplan the renter # is interested in. MUST be a real floorplan on the property in Yardi's # system. The list of floorplans can be seen with a # UnitAvailability_Login request. # @param preferred_unit_id [String] ID of Yardi unit the renter is # interested in. If specified, it MUST be a real unit on the property in # Yardi's system. The list of units can be seen with a # UnitAvailability_Login request. This param is only required when # inserting a tour. # @param price [Integer] Renter budget def initialize( beds:, contact_info:, first_name:, id:, last_name:, message:, move_in_date:, preference_notes:, preferred_floorplan_id:, price:, preferred_unit_id: nil ) @beds = beds.nil? || beds == '' ? nil : beds.to_i @contact_info = contact_info @first_name = first_name @id = id @last_name = last_name @message = message @move_in_date = move_in_date @preference_notes = preference_notes @preferred_floorplan_id = preferred_floorplan_id @preferred_unit_id = preferred_unit_id @price = price.to_i > 0 ? price.to_i : nil end end end end