finapps 5.4.1 → 6.3.0
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/.github/workflows/ci.yaml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/verify-pr-labeled.yml +1 -1
- data/.rubocop.yml +1 -0
- data/finapps.gemspec +2 -3
- data/lib/finapps.rb +3 -0
- data/lib/finapps/rest/client.rb +3 -0
- data/lib/finapps/rest/consumer_login_tokens.rb +12 -0
- data/lib/finapps/rest/consumers.rb +1 -1
- data/lib/finapps/rest/documents_orders.rb +8 -8
- data/lib/finapps/rest/documents_uploads.rb +1 -1
- data/lib/finapps/rest/operator_change_password_email.rb +12 -0
- data/lib/finapps/rest/operator_login_tokens.rb +12 -0
- data/lib/finapps/rest/operators.rb +1 -1
- data/lib/finapps/rest/orders.rb +14 -14
- data/lib/finapps/rest/screenings.rb +3 -3
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/alert_definitions_spec.rb +1 -1
- data/spec/rest/alert_occurrences_spec.rb +1 -1
- data/spec/rest/consumer_login_tokens_spec.rb +47 -0
- data/spec/rest/consumers_portfolios_spec.rb +1 -1
- data/spec/rest/consumers_spec.rb +14 -14
- data/spec/rest/operator_change_password_email_spec.rb +33 -0
- data/spec/rest/operators_login_tokens_spec.rb +43 -0
- data/spec/rest/operators_spec.rb +1 -1
- data/spec/rest/orders_spec.rb +24 -24
- data/spec/rest/portfolio_reports_spec.rb +1 -1
- data/spec/rest/portfolios_available_consumers_spec.rb +1 -1
- data/spec/rest/portfolios_consumers_spec.rb +1 -1
- data/spec/support/fake_api.rb +33 -0
- data/spec/support/fixtures/consumer_login_token.json +23 -0
- data/spec/support/fixtures/operator_login_token.json +18 -0
- metadata +59 -68
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7266aadcc1504a05cf4417d5baa37bea3a70b190568aac2a6b74f817f71febc8
|
4
|
+
data.tar.gz: 33dd9d6926956a0c90d2cd22784ccc8767d52562e136db9e330f41a0fee8b82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f516163b74e56120837b6c38150f72dc598d214554942c0c9d45eeb7ef8dda0f4f8f57be5b37f2b69c255ce151363de5e9c1fcd68f6f0a9f83ce2e9b96407a9f
|
7
|
+
data.tar.gz: d4e8b744c64ea42c79aadeb2fc7513eba325fb0084f5ae253c48d8cf8f09c57880beb7cc4b2ddaf946ee6628b16c6faf86f1caaede3bf2d246f81c26972b1e89
|
data/.github/workflows/ci.yaml
CHANGED
data/.rubocop.yml
CHANGED
data/finapps.gemspec
CHANGED
@@ -20,15 +20,14 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = Dir['spec/**/*.rb']
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_runtime_dependency 'finapps_core', '~>
|
23
|
+
spec.add_runtime_dependency 'finapps_core', '~> 6.0', '>= 6.0.0'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.16'
|
26
26
|
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.10', '>= 3.10.0'
|
28
|
-
spec.add_development_dependency 'rubocop', '~> 1.9', '>= 1.9.1'
|
29
28
|
spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.2'
|
30
29
|
spec.add_development_dependency 'rubocop-rake', '~> 0.5', '>= 0.5.1'
|
31
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 2.
|
30
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.4', '>= 2.4.0'
|
32
31
|
spec.add_development_dependency 'simplecov', '~> 0.21', '>= 0.21.2'
|
33
32
|
spec.add_development_dependency 'simplecov-console', '~> 0.9'
|
34
33
|
spec.add_development_dependency 'sinatra', '~> 2.1', '>= 2.1.0'
|
data/lib/finapps.rb
CHANGED
@@ -6,6 +6,7 @@ require 'faraday_middleware'
|
|
6
6
|
require 'finapps_core'
|
7
7
|
require 'finapps/rest/version'
|
8
8
|
require 'finapps/rest/consumers'
|
9
|
+
require 'finapps/rest/consumer_login_tokens'
|
9
10
|
require 'finapps/rest/sessions'
|
10
11
|
require 'finapps/rest/order_tokens'
|
11
12
|
require 'finapps/rest/orders'
|
@@ -14,7 +15,9 @@ require 'finapps/rest/order_statuses'
|
|
14
15
|
require 'finapps/rest/order_notifications'
|
15
16
|
require 'finapps/rest/password_resets'
|
16
17
|
require 'finapps/rest/operators'
|
18
|
+
require 'finapps/rest/operator_login_tokens'
|
17
19
|
require 'finapps/rest/operators_password_resets'
|
20
|
+
require 'finapps/rest/operator_change_password_email'
|
18
21
|
require 'finapps/rest/products'
|
19
22
|
require 'finapps/rest/order_assignments'
|
20
23
|
require 'finapps/rest/client'
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -10,6 +10,7 @@ module FinApps
|
|
10
10
|
alert_definitions
|
11
11
|
alert_occurrences
|
12
12
|
consumers
|
13
|
+
consumer_login_tokens
|
13
14
|
consumers_portfolios
|
14
15
|
documents_orders
|
15
16
|
documents_orders_notifications
|
@@ -24,7 +25,9 @@ module FinApps
|
|
24
25
|
order_statuses
|
25
26
|
order_tokens
|
26
27
|
operators
|
28
|
+
operator_login_tokens
|
27
29
|
operators_password_resets
|
30
|
+
operator_change_password_email
|
28
31
|
password_resets
|
29
32
|
plaid_webhooks
|
30
33
|
plaid_consumer_institutions
|
@@ -75,28 +75,28 @@ module FinApps
|
|
75
75
|
return {} unless term
|
76
76
|
|
77
77
|
query = with_space_search(term).concat(name_search(term))
|
78
|
-
{
|
78
|
+
{'$or': query}
|
79
79
|
end
|
80
80
|
|
81
81
|
def name_search(term)
|
82
82
|
search_arr = []
|
83
83
|
if /\s/.match?(term)
|
84
84
|
term.split.each do |t|
|
85
|
-
search_arr.append(
|
86
|
-
search_arr.append(
|
85
|
+
search_arr.append('applicant.first_name': t)
|
86
|
+
search_arr.append('applicant.last_name': t)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
search_arr
|
90
90
|
end
|
91
91
|
|
92
92
|
def with_space_search(term)
|
93
|
-
[{
|
94
|
-
{
|
95
|
-
{
|
96
|
-
{
|
93
|
+
[{'applicant.email': term},
|
94
|
+
{'applicant.first_name': term},
|
95
|
+
{'applicant.last_name': term},
|
96
|
+
{'applicant.external_id': term},
|
97
97
|
{
|
98
98
|
reference_no: {
|
99
|
-
|
99
|
+
'$regex': "^#{term}", '$options': 'i'
|
100
100
|
}
|
101
101
|
}]
|
102
102
|
end
|
data/lib/finapps/rest/orders.rb
CHANGED
@@ -66,28 +66,28 @@ module FinApps
|
|
66
66
|
return {} unless term
|
67
67
|
|
68
68
|
query = search_query_object(term).concat(consumer_name_query(term))
|
69
|
-
{
|
69
|
+
{'$or': query}
|
70
70
|
end
|
71
71
|
|
72
72
|
def consumer_name_query(term)
|
73
73
|
search_arr = []
|
74
74
|
if /\s/.match?(term)
|
75
75
|
term.split.each do |t|
|
76
|
-
search_arr.append(
|
77
|
-
search_arr.append(
|
76
|
+
search_arr.append('applicant.first_name': t)
|
77
|
+
search_arr.append('applicant.last_name': t)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
search_arr
|
81
81
|
end
|
82
82
|
|
83
83
|
def search_query_object(term)
|
84
|
-
[{public_id: {
|
85
|
-
{
|
86
|
-
{
|
87
|
-
{
|
84
|
+
[{public_id: {'$regex': "^#{term}", '$options': 'i'}},
|
85
|
+
{'assignment.last_name': term},
|
86
|
+
{'applicant.first_name': term},
|
87
|
+
{'applicant.last_name': term},
|
88
88
|
{
|
89
|
-
|
90
|
-
|
89
|
+
'requestor.reference_no': {
|
90
|
+
'$regex': "^#{term}", '$options': 'i'
|
91
91
|
}
|
92
92
|
}]
|
93
93
|
end
|
@@ -95,7 +95,7 @@ module FinApps
|
|
95
95
|
def status_query(status)
|
96
96
|
if status
|
97
97
|
if status.is_a?(Array)
|
98
|
-
{status: {
|
98
|
+
{status: {'$in': status.map(&:to_i)}}
|
99
99
|
else
|
100
100
|
{status: status.to_i}
|
101
101
|
end
|
@@ -107,7 +107,7 @@ module FinApps
|
|
107
107
|
def assignment_query(assignment)
|
108
108
|
# translate "" to null assignment
|
109
109
|
if assignment
|
110
|
-
{
|
110
|
+
{'assignment.operator_id': assignment.empty? ? nil : assignment}
|
111
111
|
else
|
112
112
|
{}
|
113
113
|
end
|
@@ -124,9 +124,9 @@ module FinApps
|
|
124
124
|
def relation_query(relation, search_term)
|
125
125
|
if !search_term && !nil_or_empty?(relation)
|
126
126
|
{
|
127
|
-
|
128
|
-
{public_id: {
|
129
|
-
{original_order_id: {
|
127
|
+
'$or': [
|
128
|
+
{public_id: {'$in': relation}},
|
129
|
+
{original_order_id: {'$in': relation}}
|
130
130
|
]
|
131
131
|
}
|
132
132
|
else
|
@@ -62,13 +62,13 @@ module FinApps
|
|
62
62
|
return {} unless term
|
63
63
|
|
64
64
|
query = search_query_object(term)
|
65
|
-
{
|
65
|
+
{'$or': query}
|
66
66
|
end
|
67
67
|
|
68
68
|
def search_query_object(term)
|
69
69
|
[
|
70
|
-
{
|
71
|
-
{
|
70
|
+
{'consumer.public_id': term},
|
71
|
+
{'consumer.email': term}
|
72
72
|
]
|
73
73
|
end
|
74
74
|
end
|
data/lib/finapps/version.rb
CHANGED
@@ -53,7 +53,7 @@ RSpec.describe FinApps::REST::AlertOccurrences do
|
|
53
53
|
list
|
54
54
|
url =
|
55
55
|
"#{versioned_api_path}/portfolio/alerts/occurrences?" \
|
56
|
-
|
56
|
+
'filter=%7B%22portfolio_id%22:%22valid_id%22%7D&page=2&requested=25&sort=-created_date'
|
57
57
|
expect(WebMock).to have_requested(:get, url)
|
58
58
|
end
|
59
59
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helpers/client'
|
4
|
+
|
5
|
+
RSpec.describe FinApps::REST::ConsumerLoginTokens do
|
6
|
+
context 'when initialized with valid FinApps::Client object' do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
subject(:consumer_login_tokens) { described_class.new(client) }
|
9
|
+
|
10
|
+
describe '#create' do
|
11
|
+
let(:results) { create[0] }
|
12
|
+
let(:error_messages) { create[1] }
|
13
|
+
|
14
|
+
context 'when missing params' do
|
15
|
+
let(:create) { consumer_login_tokens.create(nil) }
|
16
|
+
|
17
|
+
error = FinAppsCore::MissingArgumentsError
|
18
|
+
it { expect { create }.to raise_error(error) }
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when invalid params are provided' do
|
22
|
+
let(:create) { consumer_login_tokens.create(params: 'invalid') }
|
23
|
+
|
24
|
+
it { expect { create }.not_to raise_error }
|
25
|
+
it('results is nil') { expect(results).to be_nil }
|
26
|
+
|
27
|
+
it('error messages array is populated') do
|
28
|
+
expect(error_messages.first.downcase).to eq('invalid request body')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'when valid params are provided' do
|
33
|
+
let(:create) { consumer_login_tokens.create(params: 'valid') }
|
34
|
+
|
35
|
+
it { expect { create }.not_to raise_error }
|
36
|
+
it('returns an array') { expect(create).to be_a(Array) }
|
37
|
+
it { expect(results).to have_key(:public_id) }
|
38
|
+
it { expect(results).to have_key(:external_id) }
|
39
|
+
it { expect(results).to have_key(:tenant_id) }
|
40
|
+
it { expect(results).to have_key(:role) }
|
41
|
+
it { expect(results).to have_key(:memo) }
|
42
|
+
it { expect(results).to have_key(:token) }
|
43
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -56,7 +56,7 @@ RSpec.describe FinApps::REST::ConsumersPortfolios do
|
|
56
56
|
list
|
57
57
|
url =
|
58
58
|
"#{versioned_api_path}/consumers/#{id}/portfolios?page=2&" \
|
59
|
-
|
59
|
+
'requested=25&sort=-created_date'
|
60
60
|
expect(WebMock).to have_requested(:get, url)
|
61
61
|
end
|
62
62
|
end
|
data/spec/rest/consumers_spec.rb
CHANGED
@@ -119,11 +119,11 @@ RSpec.describe FinApps::REST::Consumers do
|
|
119
119
|
it 'builds query and sends proper request' do
|
120
120
|
list
|
121
121
|
filter = '{"$or":['\
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
122
|
+
'{"external_id":"term"},'\
|
123
|
+
'{"email":"term"},'\
|
124
|
+
'{"first_name":"term"},'\
|
125
|
+
'{"last_name":"term"}'\
|
126
|
+
']}'
|
127
127
|
query = "?filter=#{filter}&page=2&requested=25&sort=date_created"
|
128
128
|
url = "#{versioned_api_path}/consumers#{query}"
|
129
129
|
expect(WebMock).to have_requested(:get, url)
|
@@ -142,15 +142,15 @@ RSpec.describe FinApps::REST::Consumers do
|
|
142
142
|
it 'treats space as start of a new query for first and last name' do
|
143
143
|
list
|
144
144
|
filter = '{"$or":['\
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
145
|
+
'{"external_id":"Two terms"},'\
|
146
|
+
'{"email":"Two terms"},'\
|
147
|
+
'{"first_name":"Two terms"},'\
|
148
|
+
'{"last_name":"Two terms"},'\
|
149
|
+
'{"first_name":"Two"},'\
|
150
|
+
'{"last_name":"Two"},'\
|
151
|
+
'{"first_name":"terms"},'\
|
152
|
+
'{"last_name":"terms"}'\
|
153
|
+
']}'
|
154
154
|
query = "?filter=#{filter}&page=2&requested=25&sort=date_created"
|
155
155
|
url = "#{versioned_api_path}/consumers#{query}"
|
156
156
|
expect(WebMock).to have_requested(:get, url)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helpers/client'
|
4
|
+
|
5
|
+
RSpec.describe FinApps::REST::OperatorChangePasswordEmail do
|
6
|
+
context 'when initialized with valid FinApps::Client object' do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
subject(:operators_change_password_email) do
|
9
|
+
described_class.new(client)
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#create' do
|
13
|
+
let(:results) { create[0] }
|
14
|
+
let(:error_messages) { create[1] }
|
15
|
+
|
16
|
+
context 'when missing params' do
|
17
|
+
let(:create) { subject.create(nil) }
|
18
|
+
|
19
|
+
it do
|
20
|
+
expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'with valid params' do
|
25
|
+
let(:create) { subject.create(email: 'valid email') }
|
26
|
+
|
27
|
+
it('doesn\'t raise an error') { expect { create }.not_to raise_error }
|
28
|
+
it('doesn\'t have a response') { expect(results).to be_nil }
|
29
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helpers/client'
|
4
|
+
|
5
|
+
RSpec.describe FinApps::REST::OperatorLoginTokens do
|
6
|
+
context 'when initialized with valid FinApps::Client object' do
|
7
|
+
include SpecHelpers::Client
|
8
|
+
subject(:operator_login_tokens) { described_class.new(client) }
|
9
|
+
|
10
|
+
describe '#create' do
|
11
|
+
let(:results) { create[0] }
|
12
|
+
let(:error_messages) { create[1] }
|
13
|
+
|
14
|
+
context 'when missing params' do
|
15
|
+
let(:create) { subject.create(nil) }
|
16
|
+
|
17
|
+
error = FinAppsCore::MissingArgumentsError
|
18
|
+
it { expect { create }.to raise_error(error) }
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when invalid params are provided' do
|
22
|
+
let(:create) { subject.create(params: 'invalid') }
|
23
|
+
|
24
|
+
it { expect { create }.not_to raise_error }
|
25
|
+
it('results is nil') { expect(results).to be_nil }
|
26
|
+
|
27
|
+
it('error messages array is populated') do
|
28
|
+
expect(error_messages.first.downcase).to eq('invalid request body')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'when valid params are provided' do
|
33
|
+
let(:create) { subject.create(params: 'valid') }
|
34
|
+
|
35
|
+
it { expect { create }.not_to raise_error }
|
36
|
+
it('returns an array') { expect(create).to be_a(Array) }
|
37
|
+
it { expect(results).to have_key(:public_id) }
|
38
|
+
it { expect(results).to have_key(:role) }
|
39
|
+
it('returns no error messages') { expect(error_messages).to be_empty }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/spec/rest/operators_spec.rb
CHANGED
@@ -61,7 +61,7 @@ RSpec.describe FinApps::REST::Operators do
|
|
61
61
|
list
|
62
62
|
url =
|
63
63
|
"#{versioned_api_path}/operators?filter=%7B%22last_name%22:%22term%22," \
|
64
|
-
|
64
|
+
'%22role%22:2%7D&page=2&requested=25&sort=date_created'
|
65
65
|
expect(WebMock).to have_requested(:get, url)
|
66
66
|
end
|
67
67
|
end
|
data/spec/rest/orders_spec.rb
CHANGED
@@ -133,13 +133,13 @@ RSpec.describe FinApps::REST::Orders do
|
|
133
133
|
it 'builds query and sends proper request' do
|
134
134
|
list
|
135
135
|
url = "#{versioned_api_path}/orders?"\
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
136
|
+
'filter=%7B%22$or%22:%5B%7B%22public_id%22:%7B%22$regex%22:%22%5E'\
|
137
|
+
'term%22,%22$options%22:%22i%22%7D%7D,%7B%22assignment.last_name%22:%22'\
|
138
|
+
'term%22%7D,%7B%22applicant.first_name%22:%22term%22%7D,%7B%22'\
|
139
|
+
'applicant.last_name%22:%22term%22%7D,%7B%22requestor.reference_no'\
|
140
|
+
'%22:%7B%22$regex%22:%22%5Eterm%22,%22$options%22:%22i%22%7D%7D%5D,%22'\
|
141
|
+
'status%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.operator_id%22:%22'\
|
142
|
+
'valid_operator%22,%22consumer_id%22:%22valid_consumer_id%22%7D&page=2&requested=25&sort=status'
|
143
143
|
expect(WebMock).to have_requested(:get, url)
|
144
144
|
end
|
145
145
|
|
@@ -147,12 +147,12 @@ RSpec.describe FinApps::REST::Orders do
|
|
147
147
|
params[:searchTerm] = nil
|
148
148
|
list
|
149
149
|
url = "#{versioned_api_path}/orders?"\
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
150
|
+
'filter=%7B%22status%22:%7B%22$in%22:%5B1,7%5D%7D,' \
|
151
|
+
'%22assignment.operator_id%22:%22valid_operator%22,'\
|
152
|
+
'%22consumer_id%22:%22valid_consumer_id%22,' \
|
153
|
+
'%22$or%22:%5B%7B%22public_id%22:%7B%22$in%22:%5B%22valid_order_id%22%5D%7D%7D,'\
|
154
|
+
'%7B%22original_order_id%22:%7B%22$in%22:%5B%22valid_order_id%22%5D%7D%7D%5D%7D&'\
|
155
|
+
'page=2&requested=25&sort=status'
|
156
156
|
expect(WebMock).to have_requested(:get, url)
|
157
157
|
end
|
158
158
|
|
@@ -160,16 +160,16 @@ RSpec.describe FinApps::REST::Orders do
|
|
160
160
|
params[:searchTerm] = 'Spacing Out'
|
161
161
|
list
|
162
162
|
url = "#{versioned_api_path}/orders?"\
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
163
|
+
'filter=%7B%22$or%22:%5B%7B%22public_id%22:%7B%22$regex%22:%22%5E'\
|
164
|
+
'Spacing%20Out%22,%22$options%22:%22i%22%7D%7D,%7B%22assignment.last_name'\
|
165
|
+
'%22:%22Spacing%20Out%22%7D,%7B%22applicant.first_name%22:%22'\
|
166
|
+
'Spacing%20Out%22%7D,%7B%22applicant.last_name%22:%22Spacing%20Out'\
|
167
|
+
'%22%7D,%7B%22requestor.reference_no%22:%7B%22$regex%22:%22%5ESpacing%20Out'\
|
168
|
+
'%22,%22$options%22:%22i%22%7D%7D,%7B%22applicant.first_name%22:%22Spacing'\
|
169
|
+
'%22%7D,%7B%22applicant.last_name%22:%22Spacing%22%7D,%7B%22applicant.first_name'\
|
170
|
+
'%22:%22Out%22%7D,%7B%22applicant.last_name%22:%22Out%22%7D%5D,%22status'\
|
171
|
+
'%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.operator_id%22:%22valid_operator'\
|
172
|
+
'%22,%22consumer_id%22:%22valid_consumer_id%22%7D&page=2&requested=25&sort=status'
|
173
173
|
expect(WebMock).to have_requested(:get, url)
|
174
174
|
end
|
175
175
|
|
@@ -177,7 +177,7 @@ RSpec.describe FinApps::REST::Orders do
|
|
177
177
|
described_class.new(client).list(assignment: '')
|
178
178
|
|
179
179
|
url = "#{versioned_api_path}/orders?"\
|
180
|
-
|
180
|
+
'filter=%7B%22assignment.operator_id%22:null%7D'
|
181
181
|
expect(WebMock).to have_requested(:get, url)
|
182
182
|
end
|
183
183
|
end
|
@@ -56,7 +56,7 @@ RSpec.describe FinApps::REST::PortfoliosAvailableConsumers do
|
|
56
56
|
list
|
57
57
|
url =
|
58
58
|
"#{versioned_api_path}/portfolios/#{id}/consumers/available?page=2&" \
|
59
|
-
|
59
|
+
'requested=25&sort=-created_date'
|
60
60
|
expect(WebMock).to have_requested(:get, url)
|
61
61
|
end
|
62
62
|
end
|
@@ -56,7 +56,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
56
56
|
list
|
57
57
|
url =
|
58
58
|
"#{versioned_api_path}/portfolios/#{portfolio_id}/consumers?page=2&" \
|
59
|
-
|
59
|
+
'requested=25&sort=-created_date'
|
60
60
|
expect(WebMock).to have_requested(:get, url)
|
61
61
|
end
|
62
62
|
end
|
data/spec/support/fake_api.rb
CHANGED
@@ -358,6 +358,39 @@ module Fake
|
|
358
358
|
end
|
359
359
|
end
|
360
360
|
|
361
|
+
# operators login tokens
|
362
|
+
post("/#{version}/login/token") do
|
363
|
+
request.body.rewind
|
364
|
+
request_payload = JSON.parse request.body.read
|
365
|
+
if request_payload['params'] == 'valid'
|
366
|
+
json_response 200, 'operator_login_token.json'
|
367
|
+
else
|
368
|
+
json_response 400, 'invalid_request_body.json'
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
# operators login tokens
|
373
|
+
post("/#{version}/login/operators/token") do
|
374
|
+
request.body.rewind
|
375
|
+
request_payload = JSON.parse request.body.read
|
376
|
+
if request_payload['params'] == 'valid'
|
377
|
+
json_response 200, 'consumer_login_token.json'
|
378
|
+
else
|
379
|
+
json_response 400, 'invalid_request_body.json'
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
# operator change password email
|
384
|
+
post("/#{version}/login/change_password_email") do
|
385
|
+
request.body.rewind
|
386
|
+
request_payload = JSON.parse request.body.read
|
387
|
+
if request_payload['email'] == 'valid email'
|
388
|
+
status 200
|
389
|
+
else
|
390
|
+
json_response 404, 'resource_not_found.json'
|
391
|
+
end
|
392
|
+
end
|
393
|
+
|
361
394
|
# session
|
362
395
|
post("/#{version}/login") do
|
363
396
|
request.body.rewind
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"auth0_id": "string",
|
3
|
+
"date_created": "2021-07-19T13:04:09Z",
|
4
|
+
"date_modified": "2021-07-19T13:04:09Z",
|
5
|
+
"email": "string",
|
6
|
+
"external_id": "string",
|
7
|
+
"first_name": "string",
|
8
|
+
"last_name": "string",
|
9
|
+
"locked": true,
|
10
|
+
"memo": "string",
|
11
|
+
"metadata": {
|
12
|
+
"property1": { },
|
13
|
+
"property2": { }
|
14
|
+
},
|
15
|
+
"phone": "string",
|
16
|
+
"phone_country_code": "string",
|
17
|
+
"postal_code": "string",
|
18
|
+
"public_id": "string",
|
19
|
+
"role": 0,
|
20
|
+
"status": 0,
|
21
|
+
"tenant_id": "string",
|
22
|
+
"token": "string"
|
23
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"auth0_id": "string",
|
3
|
+
"date_created": "2021-07-16T19:14:23Z",
|
4
|
+
"date_modified": "2021-07-16T19:14:23Z",
|
5
|
+
"email": "string",
|
6
|
+
"external_id": "string",
|
7
|
+
"first_name": "string",
|
8
|
+
"last_name": "string",
|
9
|
+
"locked": true,
|
10
|
+
"memo": "string",
|
11
|
+
"phone": "string",
|
12
|
+
"phone_country_code": "string",
|
13
|
+
"public_id": "string",
|
14
|
+
"role": 0,
|
15
|
+
"status": 0,
|
16
|
+
"tenant_id": "string",
|
17
|
+
"token": "string"
|
18
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 6.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '6.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 6.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,26 +90,6 @@ dependencies:
|
|
90
90
|
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: 3.10.0
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
name: rubocop
|
95
|
-
requirement: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - "~>"
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: '1.9'
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 1.9.1
|
103
|
-
type: :development
|
104
|
-
prerelease: false
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '1.9'
|
110
|
-
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: 1.9.1
|
113
93
|
- !ruby/object:Gem::Dependency
|
114
94
|
name: rubocop-performance
|
115
95
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,20 +136,20 @@ dependencies:
|
|
156
136
|
requirements:
|
157
137
|
- - "~>"
|
158
138
|
- !ruby/object:Gem::Version
|
159
|
-
version: '2.
|
139
|
+
version: '2.4'
|
160
140
|
- - ">="
|
161
141
|
- !ruby/object:Gem::Version
|
162
|
-
version: 2.
|
142
|
+
version: 2.4.0
|
163
143
|
type: :development
|
164
144
|
prerelease: false
|
165
145
|
version_requirements: !ruby/object:Gem::Requirement
|
166
146
|
requirements:
|
167
147
|
- - "~>"
|
168
148
|
- !ruby/object:Gem::Version
|
169
|
-
version: '2.
|
149
|
+
version: '2.4'
|
170
150
|
- - ">="
|
171
151
|
- !ruby/object:Gem::Version
|
172
|
-
version: 2.
|
152
|
+
version: 2.4.0
|
173
153
|
- !ruby/object:Gem::Dependency
|
174
154
|
name: simplecov
|
175
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -281,6 +261,7 @@ files:
|
|
281
261
|
- lib/finapps/rest/alert_definitions.rb
|
282
262
|
- lib/finapps/rest/alert_occurrences.rb
|
283
263
|
- lib/finapps/rest/client.rb
|
264
|
+
- lib/finapps/rest/consumer_login_tokens.rb
|
284
265
|
- lib/finapps/rest/consumers.rb
|
285
266
|
- lib/finapps/rest/consumers_portfolios.rb
|
286
267
|
- lib/finapps/rest/documents_orders.rb
|
@@ -288,6 +269,8 @@ files:
|
|
288
269
|
- lib/finapps/rest/documents_upload_types.rb
|
289
270
|
- lib/finapps/rest/documents_uploads.rb
|
290
271
|
- lib/finapps/rest/esign_templates.rb
|
272
|
+
- lib/finapps/rest/operator_change_password_email.rb
|
273
|
+
- lib/finapps/rest/operator_login_tokens.rb
|
291
274
|
- lib/finapps/rest/operators.rb
|
292
275
|
- lib/finapps/rest/operators_password_resets.rb
|
293
276
|
- lib/finapps/rest/order_assignments.rb
|
@@ -326,6 +309,7 @@ files:
|
|
326
309
|
- spec/rest/alert_occurrences_spec.rb
|
327
310
|
- spec/rest/api_request.rb
|
328
311
|
- spec/rest/client_spec.rb
|
312
|
+
- spec/rest/consumer_login_tokens_spec.rb
|
329
313
|
- spec/rest/consumers_portfolios_spec.rb
|
330
314
|
- spec/rest/consumers_spec.rb
|
331
315
|
- spec/rest/documents_orders_notifications_spec.rb
|
@@ -333,6 +317,8 @@ files:
|
|
333
317
|
- spec/rest/documents_upload_types_spec.rb
|
334
318
|
- spec/rest/documents_uploads_spec.rb
|
335
319
|
- spec/rest/esign_templates_spec.rb
|
320
|
+
- spec/rest/operator_change_password_email_spec.rb
|
321
|
+
- spec/rest/operators_login_tokens_spec.rb
|
336
322
|
- spec/rest/operators_password_resets_spec.rb
|
337
323
|
- spec/rest/operators_spec.rb
|
338
324
|
- spec/rest/order_assignments_spec.rb
|
@@ -371,6 +357,7 @@ files:
|
|
371
357
|
- spec/support/fixtures/alert_definition.json
|
372
358
|
- spec/support/fixtures/alert_definitions.json
|
373
359
|
- spec/support/fixtures/alert_occurrences.json
|
360
|
+
- spec/support/fixtures/consumer_login_token.json
|
374
361
|
- spec/support/fixtures/documents/retrieve_order.json
|
375
362
|
- spec/support/fixtures/documents_order.json
|
376
363
|
- spec/support/fixtures/documents_orders.json
|
@@ -388,6 +375,7 @@ files:
|
|
388
375
|
- spec/support/fixtures/operator.json
|
389
376
|
- spec/support/fixtures/operator_forgot_password.json
|
390
377
|
- spec/support/fixtures/operator_list.json
|
378
|
+
- spec/support/fixtures/operator_login_token.json
|
391
379
|
- spec/support/fixtures/order.json
|
392
380
|
- spec/support/fixtures/order_refresh.json
|
393
381
|
- spec/support/fixtures/order_report.json
|
@@ -471,51 +459,54 @@ signing_key:
|
|
471
459
|
specification_version: 4
|
472
460
|
summary: FinApps REST API ruby client.
|
473
461
|
test_files:
|
474
|
-
- spec/
|
475
|
-
- spec/
|
476
|
-
- spec/
|
477
|
-
- spec/
|
478
|
-
- spec/
|
479
|
-
- spec/
|
462
|
+
- spec/rest/order_refreshes_spec.rb
|
463
|
+
- spec/rest/documents_orders_notifications_spec.rb
|
464
|
+
- spec/rest/operators_password_resets_spec.rb
|
465
|
+
- spec/rest/operators_spec.rb
|
466
|
+
- spec/rest/tenant_settings_spec.rb
|
467
|
+
- spec/rest/api_request.rb
|
480
468
|
- spec/rest/password_resets_spec.rb
|
481
|
-
- spec/rest/
|
482
|
-
- spec/rest/
|
483
|
-
- spec/rest/
|
484
|
-
- spec/rest/
|
469
|
+
- spec/rest/products_spec.rb
|
470
|
+
- spec/rest/verix/verix_metadata_spec.rb
|
471
|
+
- spec/rest/verix/verix_records_spec.rb
|
472
|
+
- spec/rest/verix/verix_documents_spec.rb
|
473
|
+
- spec/rest/verix/verix_pdf_documents_spec.rb
|
474
|
+
- spec/rest/documents_uploads_spec.rb
|
475
|
+
- spec/rest/alert_occurrences_spec.rb
|
476
|
+
- spec/rest/consumers_portfolios_spec.rb
|
477
|
+
- spec/rest/esign_templates_spec.rb
|
478
|
+
- spec/rest/orders_spec.rb
|
485
479
|
- spec/rest/plaid/plaid_accounts_spec.rb
|
480
|
+
- spec/rest/plaid/plaid_institution_logos_spec.rb
|
486
481
|
- spec/rest/plaid/plaid_consumer_institutions_spec.rb
|
482
|
+
- spec/rest/plaid/plaid_account_permissions_spec.rb
|
487
483
|
- spec/rest/plaid/plaid_webhooks_spec.rb
|
488
|
-
- spec/rest/
|
489
|
-
- spec/rest/
|
490
|
-
- spec/rest/screenings_spec.rb
|
491
|
-
- spec/rest/documents_orders_notifications_spec.rb
|
492
|
-
- spec/rest/documents_upload_types_spec.rb
|
493
|
-
- spec/rest/consumers_portfolios_spec.rb
|
494
|
-
- spec/rest/consumers_spec.rb
|
495
|
-
- spec/rest/documents_uploads_spec.rb
|
496
|
-
- spec/rest/tenant_app_settings_spec.rb
|
497
|
-
- spec/rest/signed_documents_downloads_spec.rb
|
484
|
+
- spec/rest/portfolios_consumers_spec.rb
|
485
|
+
- spec/rest/order_statuses_spec.rb
|
498
486
|
- spec/rest/order_assignments_spec.rb
|
499
|
-
- spec/rest/
|
500
|
-
- spec/rest/
|
501
|
-
- spec/rest/tenant_settings_spec.rb
|
502
|
-
- spec/rest/operators_password_resets_spec.rb
|
503
|
-
- spec/rest/portfolios_spec.rb
|
487
|
+
- spec/rest/version_spec.rb
|
488
|
+
- spec/rest/portfolio_reports_spec.rb
|
504
489
|
- spec/rest/order_tokens_spec.rb
|
505
490
|
- spec/rest/order_notifications_spec.rb
|
506
491
|
- spec/rest/sessions_spec.rb
|
507
|
-
- spec/rest/verix/verix_documents_spec.rb
|
508
|
-
- spec/rest/verix/verix_metadata_spec.rb
|
509
|
-
- spec/rest/verix/verix_pdf_documents_spec.rb
|
510
|
-
- spec/rest/verix/verix_records_spec.rb
|
511
|
-
- spec/rest/alert_occurrences_spec.rb
|
512
|
-
- spec/rest/version_spec.rb
|
513
|
-
- spec/rest/order_refreshes_spec.rb
|
514
|
-
- spec/rest/alert_definitions_spec.rb
|
515
|
-
- spec/rest/portfolios_available_consumers_spec.rb
|
516
|
-
- spec/rest/products_spec.rb
|
517
492
|
- spec/rest/client_spec.rb
|
493
|
+
- spec/rest/documents_orders_spec.rb
|
494
|
+
- spec/rest/portfolios_available_consumers_spec.rb
|
495
|
+
- spec/rest/consumers_spec.rb
|
496
|
+
- spec/rest/consumer_login_tokens_spec.rb
|
497
|
+
- spec/rest/screenings_spec.rb
|
498
|
+
- spec/rest/tenant_app_settings_spec.rb
|
499
|
+
- spec/rest/order_reports_spec.rb
|
500
|
+
- spec/rest/signed_documents_downloads_spec.rb
|
501
|
+
- spec/rest/operators_login_tokens_spec.rb
|
502
|
+
- spec/rest/operator_change_password_email_spec.rb
|
503
|
+
- spec/rest/documents_upload_types_spec.rb
|
518
504
|
- spec/rest/portfolios_alerts_spec.rb
|
519
|
-
- spec/rest/
|
520
|
-
- spec/rest/
|
521
|
-
- spec/
|
505
|
+
- spec/rest/portfolios_spec.rb
|
506
|
+
- spec/rest/alert_definitions_spec.rb
|
507
|
+
- spec/spec_helpers/client.rb
|
508
|
+
- spec/support/fake_api.rb
|
509
|
+
- spec/support/screenings_routes.rb
|
510
|
+
- spec/support/documents_uploads_routes.rb
|
511
|
+
- spec/spec_helper.rb
|
512
|
+
- spec/utils/query_builder_spec.rb
|