root_insurance 1.7.3 → 1.7.4
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/CHANGELOG.md +4 -0
- data/lib/root_insurance/api/call.rb +20 -0
- data/lib/root_insurance/api/claim.rb +106 -0
- data/lib/root_insurance/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e3ae3ca5078705c6a87fa245c3acefad9dcfca
|
4
|
+
data.tar.gz: 8f4d396c8d8d09d664807f94c1c96b0dd838c114
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec930d343623b1626cb5bbadce8149aa25e33a50c24d9b73e3fe771b48d95dd5b747a1aa5cbd494868e0e3e5d5f86ed9b8b0d94bad3c363ba44953ae6eaa9a5d
|
7
|
+
data.tar.gz: aa96a45de85da0eaf866d8c9088c501fd30f3b35a380280a2057e2bfb23d2b7fd94dddd938fbf4d6e7504fd57e78b102d0ee6c93f29de43db761d1f7a4d10552
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,33 @@
|
|
1
1
|
module RootInsurance::Api
|
2
2
|
module Call
|
3
|
+
# List all the logged calls
|
4
|
+
#
|
5
|
+
# @return [Hash]
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# client.list_calls
|
3
9
|
def list_calls
|
4
10
|
get(:calls)
|
5
11
|
end
|
6
12
|
|
13
|
+
# Get a specific call
|
14
|
+
#
|
15
|
+
# @param [String] id The unique identifier of the call
|
16
|
+
# @return [Hash]
|
17
|
+
#
|
18
|
+
# @example
|
19
|
+
# client.get_call(id: 'd3d13c48-4dc3-4816-8d01-de3215878225')
|
7
20
|
def get_call(id:)
|
8
21
|
get("calls/#{id}")
|
9
22
|
end
|
10
23
|
|
24
|
+
# List a call's events
|
25
|
+
#
|
26
|
+
# @param [String] id The unique identifier of the call
|
27
|
+
# @return [Hash]
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
# client.list_call_events(id: 'd3d13c48-4dc3-4816-8d01-de3215878225')
|
11
31
|
def list_call_events(id:)
|
12
32
|
get("calls/#{id}/events")
|
13
33
|
end
|
@@ -2,6 +2,16 @@ require 'mimemagic'
|
|
2
2
|
|
3
3
|
module RootInsurance::Api
|
4
4
|
module Claim
|
5
|
+
|
6
|
+
# List all claims
|
7
|
+
#
|
8
|
+
# @param [String, Symbol] status Either +:open+, +:closed+, +:finalized+, +:acknowledged+ or +:all+. If omitted defaults to +:all+
|
9
|
+
# @param [String, Symbol] approval Either +:approved+, +:repudiated+, +:'ex-gratia'+, +:'no-claim'+, +:pending+ or +:all+. If omitted defaults to +:all+
|
10
|
+
# @return [Array<Hash>]
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
# client.list_claims(status: :open)
|
14
|
+
#
|
5
15
|
def list_claims(status: nil, approval: nil)
|
6
16
|
query = {
|
7
17
|
claim_status: status,
|
@@ -11,10 +21,46 @@ module RootInsurance::Api
|
|
11
21
|
get(:claims, query)
|
12
22
|
end
|
13
23
|
|
24
|
+
# Get a specific claim
|
25
|
+
#
|
26
|
+
# @param [String] id The claim's id
|
27
|
+
# @return [Hash]
|
28
|
+
# @example
|
29
|
+
# client.get_claim(id: 'd3d13c48-4dc3-4816-8d01-de3215878225')
|
30
|
+
#
|
14
31
|
def get_claim(id:)
|
15
32
|
get("claims/#{id}")
|
16
33
|
end
|
17
34
|
|
35
|
+
# Open a claim
|
36
|
+
#
|
37
|
+
# @param [String] policy_id The ID of the policy under which the claim is being made. (optional)
|
38
|
+
# @param [String] policy_holder_id The ID of the policyholder for whom the claim is being made. (optional)
|
39
|
+
# @param [String] incident_type A description of the incident type. (optional)
|
40
|
+
# @param [String] incident_cause A description of the cause of the incident. (optional)
|
41
|
+
# @param [String] incident_date The date on the which the incident occured. (optional)
|
42
|
+
# @param [String] app_data An object containing additional custom data for the claim. (optional)
|
43
|
+
# @param [String] claimant Object containing claimants's first name, last name, email and/or cellphone. See below for details. (optional)
|
44
|
+
# @param [String] requested_amount The requested payout amount (in cents) for the claim. (optional)
|
45
|
+
# @return [Hash]
|
46
|
+
#
|
47
|
+
## == Claimant
|
48
|
+
# [first_name (string)] The name of the claimant
|
49
|
+
# [last_name (string)] The last name of the claimant
|
50
|
+
# [email (string)] The claimant's email address
|
51
|
+
# [cellphone (string)] The claimant's cellphone number
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
# client.open_claim(
|
55
|
+
# policy_id: "8349345c-a6c5-4bf9-8ebb-6bbfc1628715",
|
56
|
+
# incident_type: "Theft",
|
57
|
+
# incident_cause: "Device stolen during burglary",
|
58
|
+
# incident_date: "2017-10-16T10:12:02.872Z",
|
59
|
+
# requested_amount: 13000000,
|
60
|
+
# app_data: {
|
61
|
+
# key1: "value 1"
|
62
|
+
# key2: "value 2"})
|
63
|
+
#
|
18
64
|
def open_claim(policy_id: nil, policy_holder_id: nil, incident_type: nil, incident_cause: nil,
|
19
65
|
incident_date: nil, app_data: nil, claimant: nil, requested_amount: nil)
|
20
66
|
data = {
|
@@ -31,6 +77,25 @@ module RootInsurance::Api
|
|
31
77
|
post(:claims, data)
|
32
78
|
end
|
33
79
|
|
80
|
+
# Update a claim
|
81
|
+
#
|
82
|
+
# @param [String] claim_id The unique identifier of the claim.
|
83
|
+
# @param [String] incident_type A description of the incident type. (optional)
|
84
|
+
# @param [String] incident_cause A description of the cause of the incident. (optional)
|
85
|
+
# @param [String] incident_date The date on the which the incident occured. (optional)
|
86
|
+
# @param [String] app_data An object containing additional custom data for the claim. (optional)
|
87
|
+
# @param [String] requested_amount The requested payout amount (in cents) for the claim. (optional)
|
88
|
+
# @return [Hash]
|
89
|
+
#
|
90
|
+
# @example
|
91
|
+
# client.update_claim(
|
92
|
+
# claim_id: "d3d13c48-4dc3-4816-8d01-de3215878225",
|
93
|
+
# incident_type: "Theft",
|
94
|
+
# incident_cause: "Device stolen during burglary",
|
95
|
+
# incident_date: "2017-10-16T10:12:02.872Z",
|
96
|
+
# app_data: {key3: "value 3"},
|
97
|
+
# requested_amount: 13000000)
|
98
|
+
#
|
34
99
|
def update_claim(claim_id:, incident_type: nil, incident_cause: nil, incident_date: nil,
|
35
100
|
app_data: nil, requested_amount: nil)
|
36
101
|
data = {
|
@@ -44,23 +109,64 @@ module RootInsurance::Api
|
|
44
109
|
patch("claims/#{claim_id}", data)
|
45
110
|
end
|
46
111
|
|
112
|
+
# Link a claim and a policy
|
113
|
+
#
|
114
|
+
# @param [String] claim_id The unique identifier of the claim.
|
115
|
+
# @param [String] policy_id The unique identifier of the policy.
|
116
|
+
# @return [Hash]
|
117
|
+
#
|
118
|
+
# @example
|
119
|
+
# client.link_policy_to_claim(claim_id: "d3d13c48-4dc3-4816-8d01-de3215878225", policy_id: "8349345c-a6c5-4bf9-8ebb-6bbfc1628715")
|
120
|
+
#
|
47
121
|
def link_policy_to_claim(claim_id:, policy_id:)
|
48
122
|
data = {policy_id: policy_id}
|
49
123
|
|
50
124
|
post("claims/#{claim_id}/policy", data)
|
51
125
|
end
|
52
126
|
|
127
|
+
|
128
|
+
# Link a claim and a policy holder
|
129
|
+
#
|
130
|
+
# @param [String] claim_id The unique identifier of the claim.
|
131
|
+
# @param [String] policyholder_id The unique identifier of the policy holder.
|
132
|
+
# @return [Hash]
|
133
|
+
#
|
134
|
+
# @example
|
135
|
+
# client.link_policyholder_to_claim(claim_id: "d3d13c48-4dc3-4816-8d01-de3215878225", policyholder_id: "808f75dc-cb8a-4808-93e9-e13f8eea84de")
|
136
|
+
#
|
53
137
|
def link_policyholder_to_claim(claim_id:, policyholder_id:)
|
54
138
|
data = {policyholder_id: policyholder_id}
|
55
139
|
|
56
140
|
post("claims/#{claim_id}/policyholder", data)
|
57
141
|
end
|
58
142
|
|
143
|
+
# List all claim events
|
144
|
+
#
|
145
|
+
# @param [String] claim_id The unique identifier of the claim.
|
146
|
+
# @return [Array<Hash>]
|
147
|
+
#
|
148
|
+
# @example
|
149
|
+
# client.list_claim_events(claim_id: "d3d13c48-4dc3-4816-8d01-de3215878225")
|
150
|
+
#
|
59
151
|
def list_claim_events(id: nil, claim_id: nil)
|
60
152
|
claim_id = claim_id || id
|
61
153
|
get("claims/#{claim_id}/events")
|
62
154
|
end
|
63
155
|
|
156
|
+
# Create a claim attachment
|
157
|
+
#
|
158
|
+
# The file data can be passed using either +path+, +file+, +bytes+ or +base64+.
|
159
|
+
#
|
160
|
+
# @param [String] claim_id The unique identifier of the claim
|
161
|
+
# @param [String] path The full path to the file's location
|
162
|
+
# @param [File] file instance of a File object
|
163
|
+
# @param [String] bytes The raw butes of the file
|
164
|
+
# @param [String] base64 The base64 encoded file
|
165
|
+
# @param [String] file_name The file's name (only required when not using +path+ or +file+)
|
166
|
+
# @param [String] file_type The file's mime type (only required when using +base64+)
|
167
|
+
# @param [String] description A description of the file
|
168
|
+
# @return [Hash]
|
169
|
+
#
|
64
170
|
def create_claim_attachment(claim_id:, path: nil, file: nil, bytes: nil, base64: nil, file_name: nil, file_type: nil, description: '')
|
65
171
|
data = if path
|
66
172
|
claim_attachment_from_path(path)
|