class RealPage::Utils::SnowflakeEventTracker

Constants

IMPORT_PMS_PROSPECT_EVENT
IMPORT_PMS_RESIDENT_EVENT

Public Class Methods

track_pms_prospect_event( remote_lease_id: nil, resident_type:, request_params:, contact_date: nil, contact_source: nil, remote_prospect_id: nil, error: nil ) click to toggle source
# File lib/real_page/utils/snowflake_event_tracker.rb, line 68
def self.track_pms_prospect_event(
    remote_lease_id: nil,
    resident_type:,
    request_params:,
    contact_date: nil,
    contact_source: nil,
    remote_prospect_id: nil,
    error: nil
  )
  EventTracker.track_process_events(name: IMPORT_PMS_PROSPECT_EVENT) do |events|
    events.add_imported_event(
      EventTracker::ResourceFactory.build_pms_prospect(
        billing_import: EventTracker::BillingImportFactory.build_billing_import(
          property_id: request_params[:billing_config].property_id,
          billing_config_id: request_params[:billing_config].id,
          remote_id: request_params[:site_id],
          pms_type: 'real_page',
          import_id: request_params[:import_id],
          pmc_id: request_params[:pmc_id],
          service: RealPage.config.app_name
        ),
        remote_lease_id: remote_lease_id,
        import_resident_id: request_params[:import_resident_id] || '',
        resident_type: resident_type,
        api_name: 'ProspectSearch',
        request_params: EventTracker::ResourceFactory::PmsProspect.build_request_params(
          pmc_id: request_params[:pmc_id],
          remote_id: request_params[:site_id],
          prospect_id: request_params[:guest_card_id]
        ),
        contact_date: contact_date,
        contact_source: contact_source,
        remote_prospect_id: remote_prospect_id,
        move_in_report_type: 'real_page_api',
        error: error
      )
    )
  end
end
track_pms_resident_event( remote_lease_id: nil, import_resident_id:, resident_type:, api_name:, request_params:, move_in_date: nil, lease_to: nil, lease_from: nil, first_name_present: false, last_name_present: false, email_present: false, phones_count:, unit_name:, resident_id: nil, error: nil ) click to toggle source
# File lib/real_page/utils/snowflake_event_tracker.rb, line 11
def self.track_pms_resident_event(
    remote_lease_id: nil,
    import_resident_id:,
    resident_type:,
    api_name:,
    request_params:,
    move_in_date: nil,
    lease_to: nil,
    lease_from: nil,
    first_name_present: false,
    last_name_present: false,
    email_present: false,
    phones_count:,
    unit_name:,
    resident_id: nil,
    error: nil
  )
  EventTracker.track_process_events(name: IMPORT_PMS_RESIDENT_EVENT) do |events|
    events.add_imported_event(
      EventTracker::ResourceFactory.build_pms_resident(
        billing_import: EventTracker::BillingImportFactory.build_billing_import(
          property_id: request_params[:billing_config].property_id,
          billing_config_id: request_params[:billing_config].id,
          remote_id: request_params[:site_id],
          pms_type: 'real_page',
          import_id: request_params[:import_id],
          pmc_id: request_params[:pmc_id],
          service: RealPage.config.app_name
        ),
        remote_lease_id: remote_lease_id,
        import_resident_id: import_resident_id,
        resident_type: resident_type,
        api_name: api_name,
        request_params: EventTracker::ResourceFactory::PmsResident.build_request_params(
          start_date: (request_params[:start_date] || '').to_time,
          end_date: (request_params[:end_date] || '').to_time,
          prospect_id: request_params[:guest_card_id],
          pmc_id: request_params[:pmc_id],
          remote_id: request_params[:site_id],
          traffic_source_id: request_params[:traffic_source_id]
        ),
        move_in_date: move_in_date,
        lease_to: lease_to,
        lease_from: lease_from,
        first_name_present: first_name_present,
        last_name_present: last_name_present,
        email_present: email_present,
        phones_count: phones_count,
        unit_name: unit_name,
        resident_id: resident_id,
        move_in_report_type: 'real_page_api',
        error: error
      )
    )
  end
end