Class: Yardi::Validator::MissingProperty

Inherits:
Base
  • Object
show all
Defined in:
lib/yardi/validator/missing_property.rb

Overview

Make sure the property we’re trying to send a guestcard for is configured in Yardi’s system. For an example, @see invalid_property.xml

Constant Summary collapse

UNCONFIGURED_PROPERTY_REGEX =
/Invalid Yardi Property Code/i

Instance Method Summary collapse

Methods inherited from Base

#import_resident_id, #parse_date, #pms_prospect_request_params, #pms_resident_request_params, #remote_id, #send_pms_prospect_event, #send_pms_resident_event

Constructor Details

#initialize(action:, parsed_response:, params:) ⇒ MissingProperty

Returns a new instance of MissingProperty.

Parameters:

  • parsed_response (Hash<String, Object>)

    the XML response parsed into a Hash



13
14
15
16
17
# File 'lib/yardi/validator/missing_property.rb', line 13

def initialize(action:, parsed_response:, params:)
  @action = action
  @response = parsed_response
  @params = params
end

Instance Method Details

#validate!Object

Raises:



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/yardi/validator/missing_property.rb', line 21

def validate!
  return if valid_property?

  case action
  when 'GetResidents'
    send_pms_resident_event(lease: nil, resident_type: 'PRIMARY', params: params, error_message: message)
  when 'GetYardiGuestActivity_Search'
    send_pms_prospect_event(params: params, error_message: message)
  end
  raise Error::MissingProperty, message
end