advisors_command_client 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/advisors_command_client.rb +3 -2
- data/lib/advisors_command_client/models/account.rb +24 -0
- data/lib/advisors_command_client/models/base.rb +9 -2
- data/lib/advisors_command_client/models/contact.rb +11 -0
- data/lib/advisors_command_client/models/contact_collection.rb +1 -1
- data/lib/advisors_command_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2cf9cbecdca43888a75b83cd87ef502a89e0140
|
4
|
+
data.tar.gz: f3e0b3d261e5b0733eafc3545214846bc97d94e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a94f164598dad808cda68835069d39a3cb754e30e481c22143b478d87720ec7f49b9ad70e949231e90b79a3a118cf3374ea91de86cf2434ed73c7080a1454d4f
|
7
|
+
data.tar.gz: c2e0c437e029dce1ce7789ec7842605202cae5049868dd30b471fd18ac77027b39814f7bf165a76c3bab16b36ec21482b25e1ec0ccdea53301cfd2267274de83
|
@@ -3,6 +3,7 @@ require "advisors_command_client/version"
|
|
3
3
|
require 'advisors_command_client/connection'
|
4
4
|
require 'advisors_command_client/models/base'
|
5
5
|
require 'advisors_command_client/models/contact'
|
6
|
+
require 'advisors_command_client/models/account'
|
6
7
|
require 'advisors_command_client/models/contact_collection'
|
7
8
|
|
8
9
|
module AdvisorsCommandClient
|
@@ -10,8 +11,8 @@ module AdvisorsCommandClient
|
|
10
11
|
end
|
11
12
|
|
12
13
|
class Client
|
13
|
-
TEST_URL = "https://qa.advisorscommand.com/api/rest/
|
14
|
-
PROD_URL = "https://advisorscommand.com/api/rest/
|
14
|
+
TEST_URL = "https://qa.advisorscommand.com/api/rest/latest"
|
15
|
+
PROD_URL = "https://advisorscommand.com/api/rest/latest"
|
15
16
|
attr_reader :connection
|
16
17
|
|
17
18
|
def initialize(username, api_key, options = {})
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module AdvisorsCommandClient
|
2
|
+
module Models
|
3
|
+
class Account < Base
|
4
|
+
attribute :id, Integer
|
5
|
+
attribute :contact, AdvisorsCommandClient::Models::Contact
|
6
|
+
attribute :ssn_tax_id, String
|
7
|
+
attribute :drivers_license, String
|
8
|
+
attribute :drivers_license_expiration_date, DateTime
|
9
|
+
attribute :drivers_license_issue_date, DateTime
|
10
|
+
attribute :drivers_license_issue_state, String
|
11
|
+
attribute :passport_number, String
|
12
|
+
attribute :income, Float
|
13
|
+
attribute :net_worth, Float
|
14
|
+
attribute :savings, Float
|
15
|
+
attribute :ira401k, Float
|
16
|
+
attribute :monthly_salary, Float
|
17
|
+
attribute :monthly_expense, Float
|
18
|
+
attribute :salary_increase_percent, Integer
|
19
|
+
|
20
|
+
attribute :retirement_age, Integer
|
21
|
+
attribute :marital_status, String
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -3,8 +3,15 @@ module AdvisorsCommandClient
|
|
3
3
|
class Base
|
4
4
|
include Virtus.model
|
5
5
|
|
6
|
-
def self.load(hash)
|
7
|
-
|
6
|
+
def self.load(hash, connection = nil)
|
7
|
+
hash = deep_underscore_params(hash)
|
8
|
+
new(hash, connection)
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(args, connection = nil)
|
12
|
+
super(args)
|
13
|
+
@original_hash = args
|
14
|
+
@connection = connection
|
8
15
|
end
|
9
16
|
|
10
17
|
#JSON comes back as SnakeCase.
|
@@ -20,6 +20,17 @@ module AdvisorsCommandClient
|
|
20
20
|
def full_name
|
21
21
|
[first_name, middle_name, last_name].compact.join(' ')
|
22
22
|
end
|
23
|
+
|
24
|
+
def accounts
|
25
|
+
@accounts ||= @original_hash['accounts'].map do |id|
|
26
|
+
resp = @connection.get("accounts/#{id}")
|
27
|
+
if resp.success?
|
28
|
+
AdvisorsCommandClient::Models::Account.load(resp.body)
|
29
|
+
else
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
23
34
|
end
|
24
35
|
end
|
25
36
|
end
|
@@ -19,7 +19,7 @@ module AdvisorsCommandClient
|
|
19
19
|
def find(contact_id)
|
20
20
|
resp = @connection.get("contacts/#{contact_id}")
|
21
21
|
if resp.success?
|
22
|
-
return AdvisorsCommandClient::Models::Contact.load(resp.body)
|
22
|
+
return AdvisorsCommandClient::Models::Contact.load(resp.body, @connection)
|
23
23
|
else
|
24
24
|
return nil
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: advisors_command_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Ostrowski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- bin/setup
|
157
157
|
- lib/advisors_command_client.rb
|
158
158
|
- lib/advisors_command_client/connection.rb
|
159
|
+
- lib/advisors_command_client/models/account.rb
|
159
160
|
- lib/advisors_command_client/models/base.rb
|
160
161
|
- lib/advisors_command_client/models/contact.rb
|
161
162
|
- lib/advisors_command_client/models/contact_collection.rb
|