entrata 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/entrata/client.rb +13 -1
- data/lib/entrata/request/send_general_leads.rb +89 -0
- data/lib/entrata/request/send_reactivate_leads.rb +1 -1
- data/lib/entrata/test_client.rb +6 -1
- data/lib/entrata/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b67937a35dbe94da3aba8e507c91ce2071c501f4d6749b13c5cb8a61259bb01a
|
|
4
|
+
data.tar.gz: 18c7849a9e00d6a56f49d2b96258a42cee3a3aa59ec872e4aa102253df832128
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63f260606f1f0304ac1d53f582a20164eedd85e8fb7d4e20b5b778800b393c297827799287a759f0c8400f1b4a98e9c2108415461a7192d446d90e197404346b
|
|
7
|
+
data.tar.gz: 85c40e922e28e6322db5a92508238a326fd2d2e74c393a1448b75726ba67913a11ee06a4b601d7e05737f9bce20dea62aab61420d11fd5cf92c67e99ab710417
|
data/README.md
CHANGED
|
@@ -17,6 +17,8 @@ Ruby client for Entrata API
|
|
|
17
17
|
* 1.0.4 Make entrata gem compatible with Ruby 3 syntax updates
|
|
18
18
|
* 1.0.5 No functional changes. Updating build pipeline to publish to GitHub Packages.
|
|
19
19
|
* 1.1.0 Adding services to manage lea lite inactive and reactive guestcard requests.
|
|
20
|
+
* 1.2.0 Adding services to manage lea lite general guestcard requests.
|
|
21
|
+
* 1.2.1 Using mountain time in reactivate guestcard flow.
|
|
20
22
|
|
|
21
23
|
## Installation
|
|
22
24
|
|
data/lib/entrata/client.rb
CHANGED
|
@@ -5,8 +5,9 @@ require 'entrata/request/get_client_info'
|
|
|
5
5
|
require 'entrata/request/get_ils_properties_data'
|
|
6
6
|
require 'entrata/request/get_property_info'
|
|
7
7
|
require 'entrata/request/process_property_activation'
|
|
8
|
-
require 'entrata/request/
|
|
8
|
+
require 'entrata/request/send_general_leads'
|
|
9
9
|
require 'entrata/request/send_inactive_leads'
|
|
10
|
+
require 'entrata/request/send_lead_details'
|
|
10
11
|
require 'entrata/request/send_reactivate_leads'
|
|
11
12
|
|
|
12
13
|
# Client to access all API resources through
|
|
@@ -79,6 +80,17 @@ module Entrata
|
|
|
79
80
|
).perform
|
|
80
81
|
end
|
|
81
82
|
|
|
83
|
+
def send_general_leads(customer:, lead_source_id:, preferences:, property_id:)
|
|
84
|
+
byebug
|
|
85
|
+
Request::SendGeneralLeads.new(
|
|
86
|
+
conn: basic_auth_conn,
|
|
87
|
+
customer: customer,
|
|
88
|
+
lead_source_id: lead_source_id,
|
|
89
|
+
preferences: preferences,
|
|
90
|
+
property_id: property_id
|
|
91
|
+
).perform
|
|
92
|
+
end
|
|
93
|
+
|
|
82
94
|
def send_reactivate_leads(applicant_id:, application_id:, customer:, preferences:, property_id:)
|
|
83
95
|
Request::SendReactivateLeads.new(
|
|
84
96
|
conn: basic_auth_conn,
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
require 'entrata/request/base'
|
|
2
|
+
|
|
3
|
+
module Entrata
|
|
4
|
+
module Request
|
|
5
|
+
# the general Entrata API that we have access to through the drive team.
|
|
6
|
+
# Used for adding leads through the general API that don't go through the inactive/reactivate flow
|
|
7
|
+
class SendGeneralLeads < Base
|
|
8
|
+
# Preferences are optional for inserting a lead into Entrata.
|
|
9
|
+
def after_initialize(customer:, lead_source_id:, preferences:, property_id:)
|
|
10
|
+
@customer = customer
|
|
11
|
+
@lead_source_id = lead_source_id
|
|
12
|
+
@preferences = preferences
|
|
13
|
+
@property_id = property_id
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def resource_auth
|
|
17
|
+
{ type: 'basic' }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def resource_name
|
|
21
|
+
'sendLeads'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def resource_path
|
|
25
|
+
'/api/leads'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def body
|
|
29
|
+
{
|
|
30
|
+
auth: resource_auth,
|
|
31
|
+
requestId: '15', # used in all requests for Lea(SA) product
|
|
32
|
+
method: {
|
|
33
|
+
name: resource_name,
|
|
34
|
+
params: resource_params
|
|
35
|
+
}
|
|
36
|
+
}.to_json
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def resource_params
|
|
40
|
+
# all dates and times used in the API are assumed to be in Mountain Time (MST or MDT)
|
|
41
|
+
five_minutes_ago = 5.minutes.ago.in_time_zone('America/Denver').strftime('%m/%d/%YT%H:%M:%S')
|
|
42
|
+
{
|
|
43
|
+
propertyId: property_id, # Entrata remote property ID
|
|
44
|
+
doNotSendConfirmationEmail: '1', # Suppress email to renter - need to validate
|
|
45
|
+
isWaitList: '0',
|
|
46
|
+
prospects: {
|
|
47
|
+
prospect: [
|
|
48
|
+
{
|
|
49
|
+
leadSource: {
|
|
50
|
+
originatingLeadSourceId: lead_source_id # ApartmentList source ID to be acquired during onboarding
|
|
51
|
+
},
|
|
52
|
+
createdDate: five_minutes_ago, # Now - 5 minutes
|
|
53
|
+
customers: { # Renter details
|
|
54
|
+
customer: [
|
|
55
|
+
{
|
|
56
|
+
name: {
|
|
57
|
+
firstName: customer.first_name,
|
|
58
|
+
lastName: customer.last_name
|
|
59
|
+
},
|
|
60
|
+
phone: {
|
|
61
|
+
cellPhoneNumber: customer.phone
|
|
62
|
+
},
|
|
63
|
+
email: customer.email
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
customerPreferences: {
|
|
68
|
+
desiredMoveInDate: formatted_move_in_date,
|
|
69
|
+
comment: preferences.comments,
|
|
70
|
+
desiredNumBedrooms: preferences.beds
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
private
|
|
79
|
+
|
|
80
|
+
attr_reader :customer, :preferences, :property_id, :lead_source_id
|
|
81
|
+
|
|
82
|
+
# Entrata needs mm/dd/yyyy format for move in dates and will respond with
|
|
83
|
+
# an error if we send them a format they don't like.
|
|
84
|
+
def formatted_move_in_date
|
|
85
|
+
preferences.move_in_date.strftime('%m/%d/%Y')
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -39,7 +39,7 @@ module Entrata
|
|
|
39
39
|
|
|
40
40
|
def resource_params
|
|
41
41
|
# all dates and times used in the API are assumed to be in Mountain Time (MST or MDT)
|
|
42
|
-
five_minutes_ago = 5.minutes.ago.strftime('%m/%d/%YT%H:%M:%S')
|
|
42
|
+
five_minutes_ago = 5.minutes.ago.in_time_zone('America/Denver').strftime('%m/%d/%YT%H:%M:%S')
|
|
43
43
|
{
|
|
44
44
|
propertyId: property_id, # Entrata remote property ID
|
|
45
45
|
doNotSendConfirmationEmail: '1', # Suppress email to renter - need to validate
|
data/lib/entrata/test_client.rb
CHANGED
|
@@ -61,7 +61,12 @@ module Entrata
|
|
|
61
61
|
|
|
62
62
|
def send_inactive_leads(customer:, lead_source_id:, leasing_agent_id:, preferences:, property_id:)
|
|
63
63
|
raise_forced_failure! if property_id == 'fail'
|
|
64
|
-
StaticFileFetcher.parsed_response_for('
|
|
64
|
+
StaticFileFetcher.parsed_response_for('send_inactive_leads')
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def send_general_leads(customer:, lead_source_id:, preferences:, property_id:)
|
|
68
|
+
raise_forced_failure! if property_id == 'fail'
|
|
69
|
+
StaticFileFetcher.parsed_response_for('send_general_leads')
|
|
65
70
|
end
|
|
66
71
|
|
|
67
72
|
def send_reactivate_leads(applicant_id:, application_id:, customer:, preferences:, property_id:)
|
data/lib/entrata/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: entrata
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Richard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-10-
|
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -136,6 +136,7 @@ files:
|
|
|
136
136
|
- lib/entrata/request/get_ils_properties_data.rb
|
|
137
137
|
- lib/entrata/request/get_property_info.rb
|
|
138
138
|
- lib/entrata/request/process_property_activation.rb
|
|
139
|
+
- lib/entrata/request/send_general_leads.rb
|
|
139
140
|
- lib/entrata/request/send_inactive_leads.rb
|
|
140
141
|
- lib/entrata/request/send_lead_details.rb
|
|
141
142
|
- lib/entrata/request/send_reactivate_leads.rb
|