13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/yardi/utils/test_data_fetcher.rb', line 13
def self.guest_card_activity(property_id, prospect)
search_by = case prospect
when -> (p) { p.yardi_prospect_id }
{ '/prospect_id/' => prospect.yardi_prospect_id }
when -> (p) { p.email }
{ '/email/' => prospect.email.gsub(/\./,'') }
when -> (p) { p.first_name } && -> (p) { p.last_name }
{ '/name/' => prospect.first_name + ' ' + prospect.last_name }
when -> (p) { p.phone }
{ '/phone/' => prospect.phone }
end
file_path = GUESTCARD_ACTIVITY_PATH + property_id.to_s + search_by.keys.first + search_by[search_by.keys.first] + '.xml'
GoogleCloudStorage.read_file(file_path: file_path)
end
|