Class: Entrata::Request::SendReactivateLeads
- Inherits:
-
Base
- Object
- Base
- Entrata::Request::SendReactivateLeads
show all
- Defined in:
- lib/entrata/request/send_reactivate_leads.rb
Overview
Schedule a manual follow up for NOW to move the guest card to the “contact needed” tab and log the handoff reason
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #perform, #perform_with_curl
Instance Method Details
#after_initialize(applicant_id:, application_id:, customer:, preferences:, property_id:) ⇒ Object
Preferences are optional for inserting a lead into Entrata.
8
9
10
11
12
13
14
|
# File 'lib/entrata/request/send_reactivate_leads.rb', line 8
def after_initialize(applicant_id:, application_id:, customer:, preferences:, property_id:)
@applicant_id = applicant_id
@application_id = application_id
@customer = customer
@preferences = preferences
@property_id = property_id
end
|
#body ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/entrata/request/send_reactivate_leads.rb', line 28
def body
{
auth: resource_auth,
requestId: '15', method: {
name: resource_name,
version: 'r2',
params: resource_params
}
}.to_json
end
|
#resource_auth ⇒ Object
16
17
18
|
# File 'lib/entrata/request/send_reactivate_leads.rb', line 16
def resource_auth
{ type: 'basic' }
end
|
#resource_name ⇒ Object
20
21
22
|
# File 'lib/entrata/request/send_reactivate_leads.rb', line 20
def resource_name
'updateLeads'
end
|
#resource_params ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/entrata/request/send_reactivate_leads.rb', line 40
def resource_params
five_minutes_ago = 5.minutes.ago.in_time_zone('America/Denver').strftime('%m/%d/%YT%H:%M:%S')
{
propertyId: property_id, doNotSendConfirmationEmail: '1', isWaitList: '0',
prospects: {
prospect: [
{
applicationId: application_id, customers: { customer: [
{
applicantId: applicant_id
}
]
},
events: {
event: [
{
typeId: '8', date: five_minutes_ago, comments: preferences.
},
{
typeId: '15', date: five_minutes_ago,
notes: 'Contact needed',
scheduleDateTime: five_minutes_ago
}
]
}
}
]
}
}
end
|
#resource_path ⇒ Object
24
25
26
|
# File 'lib/entrata/request/send_reactivate_leads.rb', line 24
def resource_path
'/api/leads'
end
|