real_page 2.3.1 → 2.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +20 -0
- data/Gemfile +1 -1
- data/README.md +3 -0
- data/lib/real_page/model/lease.rb +1 -0
- data/lib/real_page/model/prospect.rb +1 -0
- data/lib/real_page/utils/snowflake_event_tracker.rb +13 -11
- data/lib/real_page/validator/move_in_report.rb +23 -5
- data/lib/real_page/validator/prospects_data.rb +18 -4
- data/lib/real_page/validator/request_errors.rb +5 -1
- data/lib/real_page/validator/request_fault.rb +7 -1
- data/lib/real_page/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 962d05d8387236a255f8f0fff3737dbefef4fbf77e659d8c29e42cc2f7790bc6
|
4
|
+
data.tar.gz: ff840760a1bf4cca6c5de287aa62f6cbae8e230149605b261630fa335b0efde0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93e3815c06b588b269d78cd9e0418e15d737c509e3f4e03bff3f50ea32ecad57b3fe074c57a1d555859cc785fe0709252a4f8eead0dc24b279e77a37075adb12
|
7
|
+
data.tar.gz: 31c826347cd8315749c519f6e68c8484358933dc90780c1812146d809ba0a38af20a114b3cf75171b4060a64c34b24befa3fdc17a453bd69f807bff61063a618
|
data/CHANGELOG.txt
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
Version 2.3.6, 2021-06-23
|
2
|
+
-------------------------
|
3
|
+
Update eventing gem: add unit_name, resident_id, move_in_report_type
|
4
|
+
|
5
|
+
Version 2.3.5, 2021-05-04
|
6
|
+
-------------------------
|
7
|
+
Add import_resident_id to prospect model
|
8
|
+
|
9
|
+
Version 2.3.4, 2021-04-23
|
10
|
+
-------------------------
|
11
|
+
Fix import_resident_id bug
|
12
|
+
|
13
|
+
Version 2.3.3, 2021-04-22
|
14
|
+
-------------------------
|
15
|
+
Add import_resident_id to lease model
|
16
|
+
|
17
|
+
Version 2.3.2, 2021-04-15
|
18
|
+
-------------------------
|
19
|
+
Fix date format
|
20
|
+
|
1
21
|
Version 2.3.1, 2021-04-13
|
2
22
|
-------------------------
|
3
23
|
Fix request_params_start_date/end_date data type and remote_prospect_id mapping
|
data/Gemfile
CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in real_page.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'event_tracker', git: 'https://github.com/apartmentlist/eventing.git', glob: 'clients/ruby/event_tracker.gemspec', tag: 'rb1.
|
6
|
+
gem 'event_tracker', git: 'https://github.com/apartmentlist/eventing.git', glob: 'clients/ruby/event_tracker.gemspec', tag: 'rb1.28.0'
|
data/README.md
CHANGED
@@ -201,6 +201,7 @@ The response from [GetLeasesByTrafficSource](#realpagerequestgetleasesbytraffics
|
|
201
201
|
* `type` [String]
|
202
202
|
* `unit_id` [String]
|
203
203
|
* `unit_number` [String]
|
204
|
+
* `import_resident_id` [String]
|
204
205
|
|
205
206
|
The allowed values of `leasetype` are set as constants in the `RealPage::Model::Lease::Type` module:
|
206
207
|
|
@@ -275,6 +276,8 @@ The main object representing a renter. It will be found on a
|
|
275
276
|
* `site_id` [Integer]
|
276
277
|
* `ssn_encrypted` [String]
|
277
278
|
* `ssn` [String]
|
279
|
+
* `import_resident_id` [String]
|
280
|
+
|
278
281
|
|
279
282
|
#### RealPage::Model::Quote
|
280
283
|
|
@@ -10,7 +10,9 @@ module RealPage
|
|
10
10
|
|
11
11
|
def self.track_pms_resident_event(
|
12
12
|
remote_lease_id: nil,
|
13
|
+
import_resident_id:,
|
13
14
|
resident_type:,
|
15
|
+
api_name:,
|
14
16
|
request_params:,
|
15
17
|
move_in_date: nil,
|
16
18
|
lease_to: nil,
|
@@ -19,6 +21,8 @@ module RealPage
|
|
19
21
|
last_name_present: false,
|
20
22
|
email_present: false,
|
21
23
|
phones_count:,
|
24
|
+
unit_name:,
|
25
|
+
resident_id: nil,
|
22
26
|
error: nil
|
23
27
|
)
|
24
28
|
EventTracker.track_process_events(name: IMPORT_PMS_RESIDENT_EVENT) do |events|
|
@@ -34,13 +38,13 @@ module RealPage
|
|
34
38
|
service: RealPage.config.app_name
|
35
39
|
),
|
36
40
|
remote_lease_id: remote_lease_id,
|
37
|
-
import_resident_id: import_resident_id
|
41
|
+
import_resident_id: import_resident_id,
|
38
42
|
resident_type: resident_type,
|
39
|
-
api_name:
|
43
|
+
api_name: api_name,
|
40
44
|
request_params: EventTracker::ResourceFactory::PmsResident.build_request_params(
|
41
45
|
start_date: (request_params[:start_date] || '').to_time,
|
42
|
-
end_date: (request_params[:
|
43
|
-
prospect_id: request_params[:
|
46
|
+
end_date: (request_params[:end_date] || '').to_time,
|
47
|
+
prospect_id: request_params[:guest_card_id],
|
44
48
|
pmc_id: request_params[:pmc_id],
|
45
49
|
remote_id: request_params[:site_id],
|
46
50
|
traffic_source_id: request_params[:traffic_source_id]
|
@@ -52,6 +56,9 @@ module RealPage
|
|
52
56
|
last_name_present: last_name_present,
|
53
57
|
email_present: email_present,
|
54
58
|
phones_count: phones_count,
|
59
|
+
unit_name: unit_name,
|
60
|
+
resident_id: resident_id,
|
61
|
+
move_in_report_type: 'real_page_api',
|
55
62
|
error: error
|
56
63
|
)
|
57
64
|
)
|
@@ -80,7 +87,7 @@ module RealPage
|
|
80
87
|
service: RealPage.config.app_name
|
81
88
|
),
|
82
89
|
remote_lease_id: remote_lease_id,
|
83
|
-
import_resident_id:
|
90
|
+
import_resident_id: request_params[:import_resident_id] || '',
|
84
91
|
resident_type: resident_type,
|
85
92
|
api_name: 'ProspectSearch',
|
86
93
|
request_params: EventTracker::ResourceFactory::PmsProspect.build_request_params(
|
@@ -91,17 +98,12 @@ module RealPage
|
|
91
98
|
contact_date: contact_date,
|
92
99
|
contact_source: contact_source,
|
93
100
|
remote_prospect_id: remote_prospect_id,
|
101
|
+
move_in_report_type: 'real_page_api',
|
94
102
|
error: error
|
95
103
|
)
|
96
104
|
)
|
97
105
|
end
|
98
106
|
end
|
99
|
-
|
100
|
-
private
|
101
|
-
|
102
|
-
def self.import_resident_id(import_id)
|
103
|
-
"#{import_id}-#{SecureRandom.alphanumeric(15)}"
|
104
|
-
end
|
105
107
|
end
|
106
108
|
end
|
107
109
|
end
|
@@ -11,6 +11,7 @@ module RealPage
|
|
11
11
|
def initialize(response, request_params, request_name)
|
12
12
|
@response = response
|
13
13
|
@request_params = request_params
|
14
|
+
@request_name = request_name
|
14
15
|
end
|
15
16
|
|
16
17
|
def validate!
|
@@ -20,21 +21,26 @@ module RealPage
|
|
20
21
|
|
21
22
|
private
|
22
23
|
|
23
|
-
attr_reader :response, :request_params
|
24
|
+
attr_reader :response, :request_params, :request_name
|
24
25
|
|
25
26
|
def send_successful_response_data_to_snowflake
|
26
27
|
leases.each do |lease|
|
28
|
+
lease['importresidentid'] = import_resident_id
|
27
29
|
Utils::SnowflakeEventTracker.track_pms_resident_event(
|
28
30
|
remote_lease_id: lease['leaseid'],
|
31
|
+
import_resident_id: lease['importresidentid'],
|
29
32
|
resident_type: 'PRIMARY',
|
33
|
+
api_name: request_name,
|
30
34
|
request_params: request_params,
|
31
|
-
move_in_date:
|
32
|
-
lease_to:
|
33
|
-
lease_from:
|
35
|
+
move_in_date: format_date(lease['moveindate']),
|
36
|
+
lease_to: format_date(lease['leaseenddate']),
|
37
|
+
lease_from: format_date(lease['leasebegindate']),
|
34
38
|
first_name_present: !lease['firstname'].blank?,
|
35
39
|
last_name_present: !lease['lastname'].blank?,
|
36
40
|
email_present: !lease['email'].blank?,
|
37
|
-
phones_count: phones_count(lease)
|
41
|
+
phones_count: phones_count(lease),
|
42
|
+
unit_name: lease['unitnumber'],
|
43
|
+
resident_id: lease['residentmemberid']
|
38
44
|
)
|
39
45
|
end
|
40
46
|
end
|
@@ -60,6 +66,18 @@ module RealPage
|
|
60
66
|
end
|
61
67
|
count
|
62
68
|
end
|
69
|
+
|
70
|
+
def format_date(field)
|
71
|
+
return nil if field.blank?
|
72
|
+
|
73
|
+
# The date string from the response data is in the format of "6/1/2015 12:00:00 AM"
|
74
|
+
datetime_format = '%m/%d/%Y %I:%M:%S %p'
|
75
|
+
DateTime.strptime(field, datetime_format).to_time.utc
|
76
|
+
end
|
77
|
+
|
78
|
+
def import_resident_id
|
79
|
+
"#{request_params[:import_id]}-#{SecureRandom.alphanumeric(15)}"
|
80
|
+
end
|
63
81
|
end
|
64
82
|
end
|
65
83
|
end
|
@@ -11,6 +11,7 @@ module RealPage
|
|
11
11
|
def initialize(response, request_params, request_name)
|
12
12
|
@response = response
|
13
13
|
@request_params = request_params
|
14
|
+
@request_name = request_name
|
14
15
|
@guest_cards = guest_cards
|
15
16
|
end
|
16
17
|
|
@@ -21,7 +22,7 @@ module RealPage
|
|
21
22
|
|
22
23
|
private
|
23
24
|
|
24
|
-
attr_reader :response, :request_params, :guest_cards
|
25
|
+
attr_reader :response, :request_params, :request_name, :guest_cards
|
25
26
|
|
26
27
|
def send_data_to_snowflake
|
27
28
|
guest_cards.each do |guest_card|
|
@@ -33,13 +34,17 @@ module RealPage
|
|
33
34
|
|
34
35
|
def send_roommates_data_to_snowflake(prospects)
|
35
36
|
prospects.each do |prospect|
|
37
|
+
prospect['ImportResidentId'] = import_resident_id
|
36
38
|
Utils::SnowflakeEventTracker.track_pms_resident_event(
|
39
|
+
import_resident_id: prospect['ImportResidentId'],
|
37
40
|
resident_type: 'ROOMMATE',
|
41
|
+
api_name: request_name,
|
38
42
|
request_params: request_params,
|
39
43
|
first_name_present: !prospect['FirstName'].blank?,
|
40
44
|
last_name_present: !prospect['LastName'].blank?,
|
41
45
|
email_present: !prospect['Email'].blank?,
|
42
|
-
phones_count: phones_count(prospect)
|
46
|
+
phones_count: phones_count(prospect),
|
47
|
+
unit_name: ''
|
43
48
|
)
|
44
49
|
end
|
45
50
|
end
|
@@ -47,9 +52,9 @@ module RealPage
|
|
47
52
|
def send_prospects_data_to_snowflake(prospects, guest_card)
|
48
53
|
prospects.each do |prospect|
|
49
54
|
Utils::SnowflakeEventTracker.track_pms_prospect_event(
|
50
|
-
resident_type: '
|
55
|
+
resident_type: 'PRIMARY',
|
51
56
|
request_params: request_params,
|
52
|
-
contact_date:
|
57
|
+
contact_date: format_date(guest_card['CreateDate']),
|
53
58
|
contact_source: guest_card['PrimaryLeadSource'],
|
54
59
|
remote_prospect_id: guest_card['GuestCardID']
|
55
60
|
)
|
@@ -88,6 +93,15 @@ module RealPage
|
|
88
93
|
end
|
89
94
|
phone_numbers_hash.select { |phone_number| !phone_number['Number'].blank? }.length
|
90
95
|
end
|
96
|
+
|
97
|
+
def format_date(field)
|
98
|
+
return nil if field.blank?
|
99
|
+
DateTime.parse(field).to_time
|
100
|
+
end
|
101
|
+
|
102
|
+
def import_resident_id
|
103
|
+
"#{request_params[:import_id]}-#{SecureRandom.alphanumeric(15)}"
|
104
|
+
end
|
91
105
|
end
|
92
106
|
end
|
93
107
|
end
|
@@ -41,6 +41,7 @@ module RealPage
|
|
41
41
|
def initialize(response, request_params, request_name)
|
42
42
|
@response = response
|
43
43
|
@request_params = request_params
|
44
|
+
@request_name = request_name
|
44
45
|
end
|
45
46
|
|
46
47
|
# @raise [RealPage::Error::RequestFault] if the response has an error
|
@@ -53,7 +54,7 @@ module RealPage
|
|
53
54
|
|
54
55
|
private
|
55
56
|
|
56
|
-
attr_reader :response, :request_params
|
57
|
+
attr_reader :response, :request_params, :request_name
|
57
58
|
|
58
59
|
def contents
|
59
60
|
body = response['s:Envelope']['s:Body']
|
@@ -82,9 +83,12 @@ module RealPage
|
|
82
83
|
|
83
84
|
def send_request_error_to_snowflake
|
84
85
|
Utils::SnowflakeEventTracker.track_pms_resident_event(
|
86
|
+
import_resident_id: request_params[:import_id] || '',
|
87
|
+
api_name: request_name,
|
85
88
|
resident_type: 'PRIMARY',
|
86
89
|
request_params: request_params,
|
87
90
|
phones_count: 0,
|
91
|
+
unit_name: '',
|
88
92
|
error: error_messages
|
89
93
|
)
|
90
94
|
end
|
@@ -64,9 +64,12 @@ module RealPage
|
|
64
64
|
|
65
65
|
def send_move_in_report_error_to_snowflake
|
66
66
|
Utils::SnowflakeEventTracker.track_pms_resident_event(
|
67
|
+
import_resident_id: request_params[:import_id] || '',
|
68
|
+
api_name: request_name,
|
67
69
|
resident_type: 'PRIMARY',
|
68
70
|
request_params: request_params,
|
69
71
|
phones_count: 0,
|
72
|
+
unit_name: '',
|
70
73
|
error: error_message
|
71
74
|
)
|
72
75
|
end
|
@@ -78,16 +81,19 @@ module RealPage
|
|
78
81
|
|
79
82
|
def send_roommate_error_to_snowflake
|
80
83
|
Utils::SnowflakeEventTracker.track_pms_resident_event(
|
84
|
+
import_resident_id: request_params[:import_id] || '',
|
85
|
+
api_name: request_name,
|
81
86
|
resident_type: 'ROOMMATE',
|
82
87
|
request_params: request_params,
|
83
88
|
phones_count: 0,
|
89
|
+
unit_name: '',
|
84
90
|
error: error_message
|
85
91
|
)
|
86
92
|
end
|
87
93
|
|
88
94
|
def send_prospect_error_to_snowflake
|
89
95
|
Utils::SnowflakeEventTracker.track_pms_prospect_event(
|
90
|
-
resident_type: '
|
96
|
+
resident_type: 'PRIMARY',
|
91
97
|
request_params: request_params,
|
92
98
|
error: error_message
|
93
99
|
)
|
data/lib/real_page/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: real_page
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Collier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -283,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
283
|
- !ruby/object:Gem::Version
|
284
284
|
version: '0'
|
285
285
|
requirements: []
|
286
|
-
|
287
|
-
rubygems_version: 2.7.6.2
|
286
|
+
rubygems_version: 3.1.6
|
288
287
|
signing_key:
|
289
288
|
specification_version: 4
|
290
289
|
summary: A ruby client for RealPage Exchange
|