root_insurance 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/root_insurance/api/claim.rb +3 -3
- data/lib/root_insurance/api/payment.rb +5 -5
- data/lib/root_insurance/api/{policy_holder.rb → policyholder.rb} +10 -10
- data/lib/root_insurance/client.rb +2 -2
- data/lib/root_insurance/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83e11151b5e0dfc73c7c6bb39f3cdffe7f6eaa8d
|
4
|
+
data.tar.gz: 5994e4790ce33bc2e9d84fd02714c6847d07e823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00cd75bcdf23ada86c37514f49cfbc975f12c703f94b452cb30af76b1542654b26182c260570d537610f981c9d68753a0943f9c19bd43d8a79f147ee87d28a59
|
7
|
+
data.tar.gz: 7a36f4b2fa357d39465404e95996e7dc1ffdc957d61af07dc3e0583832487c6d2b5015a546b32f1cfcd4325da29b932954981109c00797b3c501bfafa02512a6
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# 1.9.0 - Release date: 2018-01-06
|
4
|
+
* Changed all instances of policy_holder to policyholder to be more consistent
|
5
|
+
|
6
|
+
|
3
7
|
# 1.8.0 - Release date: 2018-17-05
|
4
8
|
* Removed old replace_policy method
|
5
9
|
* Add support to filter on id number when listing policy holders
|
@@ -35,7 +35,7 @@ module RootInsurance::Api
|
|
35
35
|
# Open a claim
|
36
36
|
#
|
37
37
|
# @param [String] policy_id The ID of the policy under which the claim is being made. (optional)
|
38
|
-
# @param [String]
|
38
|
+
# @param [String] policyholder_id The ID of the policyholder for whom the claim is being made. (optional)
|
39
39
|
# @param [String] incident_type A description of the incident type. (optional)
|
40
40
|
# @param [String] incident_cause A description of the cause of the incident. (optional)
|
41
41
|
# @param [String] incident_date The date on the which the incident occured. (optional)
|
@@ -61,11 +61,11 @@ module RootInsurance::Api
|
|
61
61
|
# key1: "value 1"
|
62
62
|
# key2: "value 2"})
|
63
63
|
#
|
64
|
-
def open_claim(policy_id: nil,
|
64
|
+
def open_claim(policy_id: nil, policyholder_id: nil, incident_type: nil, incident_cause: nil,
|
65
65
|
incident_date: nil, app_data: nil, claimant: nil, requested_amount: nil)
|
66
66
|
data = {
|
67
67
|
policy_id: policy_id,
|
68
|
-
|
68
|
+
policyholder_id: policyholder_id,
|
69
69
|
incident_type: incident_type,
|
70
70
|
incident_cause: incident_cause,
|
71
71
|
incident_date: incident_date,
|
@@ -3,7 +3,7 @@ module RootInsurance::Api
|
|
3
3
|
|
4
4
|
# Create a payment method
|
5
5
|
#
|
6
|
-
# @param [String]
|
6
|
+
# @param [String] policyholder_id The unique identifier of the policy holder.
|
7
7
|
# @param [String] type The payment method type. Curently only +'debit_order'+ is supported. If omitted, defaults to +'debit_order'+ (optional)
|
8
8
|
# @param [Hash] bank_details Bank details to use for the debit order. See below for details.
|
9
9
|
# @param [String] policy_ids The date on the which the incident occured. (optional)
|
@@ -24,10 +24,10 @@ module RootInsurance::Api
|
|
24
24
|
# account_number: "123456789"
|
25
25
|
# }
|
26
26
|
# client.create_payment_method(
|
27
|
-
#
|
28
|
-
# bank_details:
|
27
|
+
# policyholder_id: "128ba0c0-3f6a-4f8b-9b40-e2066b02b59e",
|
28
|
+
# bank_details: bank_details)
|
29
29
|
#
|
30
|
-
def create_payment_method(
|
30
|
+
def create_payment_method(policyholder_id:, type: 'debit_order', bank_details: {}, policy_ids: nil)
|
31
31
|
validate_bank_details(bank_details)
|
32
32
|
|
33
33
|
data = {
|
@@ -41,7 +41,7 @@ module RootInsurance::Api
|
|
41
41
|
data.merge!(policy_ids: [policy_ids])
|
42
42
|
end
|
43
43
|
|
44
|
-
post("policyholders/#{
|
44
|
+
post("policyholders/#{policyholder_id}/payment-methods", data)
|
45
45
|
end
|
46
46
|
|
47
47
|
# Link a payment method to a policy
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module RootInsurance::Api
|
2
|
-
module
|
2
|
+
module Policyholder
|
3
3
|
# Create a policy holder
|
4
4
|
#
|
5
5
|
# @param [Hash] id Hash containing policyholder's identification number, type and country. See below for details.
|
@@ -28,7 +28,7 @@ module RootInsurance::Api
|
|
28
28
|
# email: 'erlich@avaito.com',
|
29
29
|
# app_data: {company: 'Aviato'})
|
30
30
|
#
|
31
|
-
def
|
31
|
+
def create_policyholder(id:, first_name:, last_name:, email: nil, date_of_birth: nil, cellphone: nil, app_data: nil)
|
32
32
|
raise ArgumentError.new('id needs to be a hash') unless id.is_a? Hash
|
33
33
|
|
34
34
|
data = {
|
@@ -51,8 +51,8 @@ module RootInsurance::Api
|
|
51
51
|
# @return [Array<Hash>]
|
52
52
|
#
|
53
53
|
# @example
|
54
|
-
# client.
|
55
|
-
def
|
54
|
+
# client.list_policyholders(id_number: "128ba0c0-3f6a-4f8b-9b40-e2066b02b59e", included_objects: :policies)
|
55
|
+
def list_policyholders(id_number: nil, included_objects: nil)
|
56
56
|
query = {
|
57
57
|
include: format_included_objects(included_objects),
|
58
58
|
id_number: id_number
|
@@ -68,9 +68,9 @@ module RootInsurance::Api
|
|
68
68
|
# @return [Hash]
|
69
69
|
#
|
70
70
|
# @example
|
71
|
-
# client.
|
71
|
+
# client.get_policyholder(id: "128ba0c0-3f6a-4f8b-9b40-e2066b02b59e", included_objects: :policies)
|
72
72
|
#
|
73
|
-
def
|
73
|
+
def get_policyholder(id:, included_objects: nil)
|
74
74
|
query = {
|
75
75
|
include: format_included_objects(included_objects),
|
76
76
|
}.reject { |_, v| v.nil? }
|
@@ -91,12 +91,12 @@ module RootInsurance::Api
|
|
91
91
|
# [country (string)] The ISO Alpha-2 country code of the country of the cellphone number.
|
92
92
|
#
|
93
93
|
# @example
|
94
|
-
# client.
|
94
|
+
# client.update_policyholders(
|
95
95
|
# id: 'bf1ada91-eecb-4f47-9bfa-1258bb1e0055',
|
96
96
|
# cellphone: {number: '07741011337', country: 'ZA'},
|
97
97
|
# app_data: {company: 'Pied Piper'})
|
98
98
|
#
|
99
|
-
def
|
99
|
+
def update_policyholder(id:, email: nil, cellphone: nil, app_data: nil)
|
100
100
|
data = {
|
101
101
|
email: email,
|
102
102
|
cellphone: cellphone,
|
@@ -112,9 +112,9 @@ module RootInsurance::Api
|
|
112
112
|
# @return [Array<Hash>]
|
113
113
|
#
|
114
114
|
# @example
|
115
|
-
# client.
|
115
|
+
# client.list_policyholder_events(id: "128ba0c0-3f6a-4f8b-9b40-e2066b02b59e")
|
116
116
|
#
|
117
|
-
def
|
117
|
+
def list_policyholder_events(id:)
|
118
118
|
get("policyholders/#{id}/events")
|
119
119
|
end
|
120
120
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'httparty'
|
2
2
|
|
3
3
|
require 'root_insurance/api/quote'
|
4
|
-
require 'root_insurance/api/
|
4
|
+
require 'root_insurance/api/policyholder'
|
5
5
|
require 'root_insurance/api/application'
|
6
6
|
require 'root_insurance/api/policy'
|
7
7
|
require 'root_insurance/api/claim'
|
@@ -10,7 +10,7 @@ require 'root_insurance/api/payment'
|
|
10
10
|
|
11
11
|
class RootInsurance::Client
|
12
12
|
include RootInsurance::Api::Quote
|
13
|
-
include RootInsurance::Api::
|
13
|
+
include RootInsurance::Api::Policyholder
|
14
14
|
include RootInsurance::Api::Application
|
15
15
|
include RootInsurance::Api::Policy
|
16
16
|
include RootInsurance::Api::Claim
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: root_insurance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Root Wealth
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -144,7 +144,7 @@ files:
|
|
144
144
|
- lib/root_insurance/api/claim.rb
|
145
145
|
- lib/root_insurance/api/payment.rb
|
146
146
|
- lib/root_insurance/api/policy.rb
|
147
|
-
- lib/root_insurance/api/
|
147
|
+
- lib/root_insurance/api/policyholder.rb
|
148
148
|
- lib/root_insurance/api/quote.rb
|
149
149
|
- lib/root_insurance/client.rb
|
150
150
|
- lib/root_insurance/exceptions.rb
|