real_page 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa8265c4b5a8552f52f2e226c134b97fcb4d421834021e5a26ed7cab8987feab
4
- data.tar.gz: a4a4245d3a1ccd7cec3a48b9238ce40da674f005422a714256f722d506585464
3
+ metadata.gz: ec3c8dbb758a70f4acf1fbabfe1690840990574f16c3413a7a3b044dacaba7de
4
+ data.tar.gz: 424461f45ad3491fef2a44308f2a8cd9fd1950d3d6ad22053cdc39d66d5c4da7
5
5
  SHA512:
6
- metadata.gz: 4dcbf8f67e43dfd017a5e16faf312121315b117ea1555920e17a9d2dadd2e7490ccf0be115075adb394d4f57d31cc975a0893b3915c54c98da06bf112458eea2
7
- data.tar.gz: 97d9761e4ac388cd0fbc0fb9a40640056e3ec3f00a870efda6b2dae0a3386873489c0cc99afec915818fc9e4a84d2732aa08bb904336ddbfe502fc6a4c8d32c5
6
+ metadata.gz: cc136e628d7e89d73ef978729b7b34f22895aee9abc8808460a00561bd70f5f24ec00b51bbc327e657ca57c63bb27faf7f9762851e5354c383f62f88eeb6b509
7
+ data.tar.gz: e697684c9264cb3cb5c763438fe2d7e0c5fd588add956788a95d7b613b3c99c132781afd5aa562d93c17a14c2b2eaae7c6d1b9f62940b12eece63ca4bfb14293
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,7 @@
1
+ Version 2.3.2, 2021-04-15
2
+ -------------------------
3
+ Fix date format
4
+
1
5
  Version 2.3.1, 2021-04-13
2
6
  -------------------------
3
7
  Fix request_params_start_date/end_date data type and remote_prospect_id mapping
@@ -39,7 +39,7 @@ module RealPage
39
39
  api_name: 'GetLeasesByTrafficSource',
40
40
  request_params: EventTracker::ResourceFactory::PmsResident.build_request_params(
41
41
  start_date: (request_params[:start_date] || '').to_time,
42
- end_date: (request_params[:start_date] || '').to_time,
42
+ end_date: (request_params[:end_date] || '').to_time,
43
43
  prospect_id: request_params[:prospect_id],
44
44
  pmc_id: request_params[:pmc_id],
45
45
  remote_id: request_params[:site_id],
@@ -28,9 +28,9 @@ module RealPage
28
28
  remote_lease_id: lease['leaseid'],
29
29
  resident_type: 'PRIMARY',
30
30
  request_params: request_params,
31
- move_in_date: DateTime.strptime(lease['moveindate'], '%m/%d/%y').to_time,
32
- lease_to: DateTime.strptime(lease['leaseenddate'], '%m/%d/%y').to_time,
33
- lease_from: DateTime.strptime(lease['leasebegindate'], '%m/%d/%y').to_time,
31
+ move_in_date: format_date(lease['moveindate']),
32
+ lease_to: format_date(lease['leaseenddate']),
33
+ lease_from: format_date(lease['leasebegindate']),
34
34
  first_name_present: !lease['firstname'].blank?,
35
35
  last_name_present: !lease['lastname'].blank?,
36
36
  email_present: !lease['email'].blank?,
@@ -60,6 +60,14 @@ module RealPage
60
60
  end
61
61
  count
62
62
  end
63
+
64
+ def format_date(field)
65
+ return nil if field.blank?
66
+
67
+ # The date string from the response data is in the format of "6/1/2015 12:00:00 AM"
68
+ datetime_format = '%m/%d/%Y %I:%M:%S %p'
69
+ DateTime.strptime(field, datetime_format).to_time.utc
70
+ end
63
71
  end
64
72
  end
65
73
  end
@@ -49,7 +49,7 @@ module RealPage
49
49
  Utils::SnowflakeEventTracker.track_pms_prospect_event(
50
50
  resident_type: 'ROOMMATE',
51
51
  request_params: request_params,
52
- contact_date: DateTime.parse(guest_card['DateContact']).to_time,
52
+ contact_date: format_date(guest_card['DateContact']),
53
53
  contact_source: guest_card['PrimaryLeadSource'],
54
54
  remote_prospect_id: guest_card['GuestCardID']
55
55
  )
@@ -88,6 +88,11 @@ module RealPage
88
88
  end
89
89
  phone_numbers_hash.select { |phone_number| !phone_number['Number'].blank? }.length
90
90
  end
91
+
92
+ def format_date(field)
93
+ return nil if field.blank?
94
+ DateTime.parse(field).to_time
95
+ end
91
96
  end
92
97
  end
93
98
  end
@@ -1,3 +1,3 @@
1
1
  module RealPage
2
- VERSION = '2.3.1'
2
+ VERSION = '2.3.2'
3
3
  end
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.1
4
+ version: 2.3.2
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-04-13 00:00:00.000000000 Z
11
+ date: 2021-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday