finapps 5.0.3 → 5.0.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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop.yml +1 -7
  4. data/.tmuxinator.yml +19 -0
  5. data/Guardfile +42 -0
  6. data/finapps.gemspec +3 -1
  7. data/lib/finapps.rb +1 -7
  8. data/lib/finapps/rest/client.rb +5 -10
  9. data/lib/finapps/rest/consumers.rb +2 -1
  10. data/lib/finapps/rest/operators.rb +8 -2
  11. data/lib/finapps/rest/order_reports.rb +2 -1
  12. data/lib/finapps/rest/orders.rb +11 -9
  13. data/lib/finapps/rest/plaid/plaid_consumer_institutions.rb +15 -0
  14. data/lib/finapps/rest/portfolios_alerts.rb +2 -1
  15. data/lib/finapps/rest/portfolios_available_consumers.rb +2 -1
  16. data/lib/finapps/rest/portfolios_consumers.rb +6 -1
  17. data/lib/finapps/rest/products.rb +1 -2
  18. data/lib/finapps/rest/sessions.rb +8 -2
  19. data/lib/finapps/rest/statements.rb +2 -1
  20. data/lib/finapps/version.rb +1 -1
  21. data/spec/rest/alert_definitions_spec.rb +12 -7
  22. data/spec/rest/alert_occurrences_spec.rb +17 -5
  23. data/spec/rest/client_spec.rb +115 -57
  24. data/spec/rest/consumers_portfolios_spec.rb +9 -4
  25. data/spec/rest/consumers_spec.rb +76 -20
  26. data/spec/rest/operators_password_resets_spec.rb +19 -10
  27. data/spec/rest/operators_spec.rb +60 -22
  28. data/spec/rest/order_assignments_spec.rb +11 -5
  29. data/spec/rest/order_notifications_spec.rb +6 -2
  30. data/spec/rest/order_refreshes_spec.rb +11 -5
  31. data/spec/rest/order_reports_spec.rb +15 -5
  32. data/spec/rest/order_statuses_spec.rb +12 -4
  33. data/spec/rest/order_tokens_spec.rb +17 -5
  34. data/spec/rest/orders_spec.rb +80 -34
  35. data/spec/rest/password_resets_spec.rb +51 -14
  36. data/spec/rest/plaid/plaid_webhooks_spec.rb +7 -3
  37. data/spec/rest/portfolio_reports_spec.rb +9 -4
  38. data/spec/rest/portfolios_alerts_spec.rb +18 -10
  39. data/spec/rest/portfolios_available_consumers_spec.rb +9 -4
  40. data/spec/rest/portfolios_consumers_spec.rb +29 -11
  41. data/spec/rest/portfolios_spec.rb +51 -22
  42. data/spec/rest/products_spec.rb +5 -2
  43. data/spec/rest/sessions_spec.rb +36 -14
  44. data/spec/rest/statements_spec.rb +6 -2
  45. data/spec/rest/tenant_app_settings_spec.rb +13 -5
  46. data/spec/rest/tenant_settings_spec.rb +13 -5
  47. data/spec/rest/version_spec.rb +3 -1
  48. data/spec/spec_helper.rb +6 -4
  49. data/spec/spec_helpers/client.rb +2 -1
  50. data/spec/support/fake_api.rb +253 -119
  51. data/spec/utils/query_builder_spec.rb +8 -3
  52. data/tags +6 -0
  53. metadata +48 -25
  54. data/lib/finapps/rest/consumer_institution_refresh.rb +0 -14
  55. data/lib/finapps/rest/consumer_institution_refreshes.rb +0 -12
  56. data/lib/finapps/rest/institutions.rb +0 -34
  57. data/lib/finapps/rest/institutions_forms.rb +0 -14
  58. data/lib/finapps/rest/user_institutions.rb +0 -54
  59. data/lib/finapps/rest/user_institutions_forms.rb +0 -14
  60. data/lib/finapps/rest/user_institutions_statuses.rb +0 -19
  61. data/spec/rest/consumer_institution_refresh_spec.rb +0 -44
  62. data/spec/rest/consumer_institution_refreshes_spec.rb +0 -20
  63. data/spec/rest/institutions_forms_spec.rb +0 -29
  64. data/spec/rest/institutions_spec.rb +0 -55
  65. data/spec/rest/user_institutions_forms_spec.rb +0 -30
  66. data/spec/rest/user_institutions_spec.rb +0 -144
  67. data/spec/rest/user_institutions_statuses_spec.rb +0 -43
@@ -13,12 +13,17 @@ RSpec.describe FinApps::Utils::QueryBuilder do
13
13
  let(:end_point) { 'orders' }
14
14
 
15
15
  context 'with full params' do
16
- let(:params) { { page: '1', requested: '20', sort: '-date', random: 'random' } }
16
+ let(:params) do
17
+ { page: '1', requested: '20', sort: '-date', random: 'random' }
18
+ end
17
19
  it 'calls #build_filter and returns correct string' do
18
20
  allow(subject).to receive(:build_filter) { { role: 2 } }
19
21
  expect(subject).to receive(:build_filter).with(params)
20
- correct_string = 'orders?page=1&requested=20&sort=-date&filter=%7B%22role%22%3A2%7D'
21
- expect(subject.build_query_path(end_point, params)).to eq(correct_string)
22
+ correct_string =
23
+ 'orders?page=1&requested=20&sort=-date&filter=%7B%22role%22%3A2%7D'
24
+ expect(subject.build_query_path(end_point, params)).to eq(
25
+ correct_string
26
+ )
22
27
  end
23
28
  end
24
29
 
data/tags ADDED
@@ -0,0 +1,6 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
+ !_TAG_PROGRAM_NAME Exuberant Ctags //
5
+ !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
+ !_TAG_PROGRAM_VERSION 5.8 //
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: 5.0.3
4
+ version: 5.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-19 00:00:00.000000000 Z
11
+ date: 2019-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 5.0.0
22
+ version: 5.0.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.0.0
32
+ version: 5.0.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +90,46 @@ dependencies:
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: 2.0.3
93
+ - !ruby/object:Gem::Dependency
94
+ name: guard
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '2.15'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 2.15.0
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '2.15'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 2.15.0
113
+ - !ruby/object:Gem::Dependency
114
+ name: guard-rspec
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '4.7'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 4.7.3
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '4.7'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 4.7.3
93
133
  - !ruby/object:Gem::Dependency
94
134
  name: rake
95
135
  requirement: !ruby/object:Gem::Requirement
@@ -248,8 +288,10 @@ files:
248
288
  - ".rubocop.yml"
249
289
  - ".ruby-gemset"
250
290
  - ".ruby-version"
291
+ - ".tmuxinator.yml"
251
292
  - ".travis.yml"
252
293
  - Gemfile
294
+ - Guardfile
253
295
  - LICENSE.txt
254
296
  - README.md
255
297
  - Rakefile
@@ -258,12 +300,8 @@ files:
258
300
  - lib/finapps/rest/alert_definitions.rb
259
301
  - lib/finapps/rest/alert_occurrences.rb
260
302
  - lib/finapps/rest/client.rb
261
- - lib/finapps/rest/consumer_institution_refresh.rb
262
- - lib/finapps/rest/consumer_institution_refreshes.rb
263
303
  - lib/finapps/rest/consumers.rb
264
304
  - lib/finapps/rest/consumers_portfolios.rb
265
- - lib/finapps/rest/institutions.rb
266
- - lib/finapps/rest/institutions_forms.rb
267
305
  - lib/finapps/rest/operators.rb
268
306
  - lib/finapps/rest/operators_password_resets.rb
269
307
  - lib/finapps/rest/order_assignments.rb
@@ -274,6 +312,7 @@ files:
274
312
  - lib/finapps/rest/order_tokens.rb
275
313
  - lib/finapps/rest/orders.rb
276
314
  - lib/finapps/rest/password_resets.rb
315
+ - lib/finapps/rest/plaid/plaid_consumer_institutions.rb
277
316
  - lib/finapps/rest/plaid/plaid_webhooks.rb
278
317
  - lib/finapps/rest/portfolio_reports.rb
279
318
  - lib/finapps/rest/portfolios.rb
@@ -285,9 +324,6 @@ files:
285
324
  - lib/finapps/rest/statements.rb
286
325
  - lib/finapps/rest/tenant_app_settings.rb
287
326
  - lib/finapps/rest/tenant_settings.rb
288
- - lib/finapps/rest/user_institutions.rb
289
- - lib/finapps/rest/user_institutions_forms.rb
290
- - lib/finapps/rest/user_institutions_statuses.rb
291
327
  - lib/finapps/rest/version.rb
292
328
  - lib/finapps/utils/query_builder.rb
293
329
  - lib/finapps/version.rb
@@ -295,12 +331,8 @@ files:
295
331
  - spec/rest/alert_definitions_spec.rb
296
332
  - spec/rest/alert_occurrences_spec.rb
297
333
  - spec/rest/client_spec.rb
298
- - spec/rest/consumer_institution_refresh_spec.rb
299
- - spec/rest/consumer_institution_refreshes_spec.rb
300
334
  - spec/rest/consumers_portfolios_spec.rb
301
335
  - spec/rest/consumers_spec.rb
302
- - spec/rest/institutions_forms_spec.rb
303
- - spec/rest/institutions_spec.rb
304
336
  - spec/rest/operators_password_resets_spec.rb
305
337
  - spec/rest/operators_spec.rb
306
338
  - spec/rest/order_assignments_spec.rb
@@ -322,9 +354,6 @@ files:
322
354
  - spec/rest/statements_spec.rb
323
355
  - spec/rest/tenant_app_settings_spec.rb
324
356
  - spec/rest/tenant_settings_spec.rb
325
- - spec/rest/user_institutions_forms_spec.rb
326
- - spec/rest/user_institutions_spec.rb
327
- - spec/rest/user_institutions_statuses_spec.rb
328
357
  - spec/rest/version_spec.rb
329
358
  - spec/spec_helper.rb
330
359
  - spec/spec_helpers/client.rb
@@ -380,6 +409,7 @@ files:
380
409
  - spec/support/fixtures/user_institutions_list.json
381
410
  - spec/support/fixtures/user_institutions_show.json
382
411
  - spec/utils/query_builder_spec.rb
412
+ - tags
383
413
  homepage: https://github.com/finapps/ruby-client
384
414
  licenses:
385
415
  - MIT
@@ -419,29 +449,22 @@ test_files:
419
449
  - spec/rest/statements_spec.rb
420
450
  - spec/rest/alert_definitions_spec.rb
421
451
  - spec/rest/version_spec.rb
422
- - spec/rest/user_institutions_forms_spec.rb
423
452
  - spec/rest/consumers_spec.rb
424
453
  - spec/rest/orders_spec.rb
425
454
  - spec/rest/order_tokens_spec.rb
426
- - spec/rest/institutions_forms_spec.rb
427
455
  - spec/rest/tenant_app_settings_spec.rb
428
456
  - spec/rest/operators_spec.rb
429
- - spec/rest/user_institutions_statuses_spec.rb
430
457
  - spec/rest/client_spec.rb
431
458
  - spec/rest/tenant_settings_spec.rb
432
- - spec/rest/user_institutions_spec.rb
433
459
  - spec/rest/alert_occurrences_spec.rb
434
- - spec/rest/consumer_institution_refreshes_spec.rb
435
460
  - spec/rest/password_resets_spec.rb
436
461
  - spec/rest/order_reports_spec.rb
437
462
  - spec/rest/portfolios_spec.rb
438
- - spec/rest/institutions_spec.rb
439
463
  - spec/rest/order_statuses_spec.rb
440
464
  - spec/rest/plaid/plaid_webhooks_spec.rb
441
465
  - spec/rest/order_refreshes_spec.rb
442
466
  - spec/rest/order_notifications_spec.rb
443
467
  - spec/rest/portfolios_alerts_spec.rb
444
- - spec/rest/consumer_institution_refresh_spec.rb
445
468
  - spec/rest/order_assignments_spec.rb
446
469
  - spec/rest/sessions_spec.rb
447
470
  - spec/rest/portfolio_reports_spec.rb
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class ConsumerInstitutionRefresh < FinAppsCore::REST::Resources
6
- def update(id, params = {})
7
- not_blank(id, :id)
8
-
9
- path = "institutions/consumer/#{ERB::Util.url_encode(id)}/refresh"
10
- super params, path
11
- end
12
- end
13
- end
14
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class ConsumerInstitutionRefreshes < FinAppsCore::REST::Resources
6
- def create
7
- path = 'institutions/refresh'
8
- update nil, path
9
- end
10
- end
11
- end
12
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class Institutions < FinAppsCore::REST::Resources
6
- ROUTING_NUMBER_LENGTH = 9
7
-
8
- def list(search_term)
9
- not_blank(search_term, :search_term) # API errors when search_term is blank, maybe it shouldn't
10
-
11
- path = "#{end_point}/search/#{ERB::Util.url_encode(search_term)}"
12
- super path
13
- end
14
-
15
- def show(id)
16
- digits = remove_non_digits id
17
- not_blank(digits, :id)
18
-
19
- path = "#{end_point}/#{search_type digits}/#{digits}"
20
- super digits, path
21
- end
22
-
23
- private
24
-
25
- def search_type(digits)
26
- digits.length >= ROUTING_NUMBER_LENGTH ? :routing : :site
27
- end
28
-
29
- def remove_non_digits(value)
30
- value.to_s.gsub(/\D/, '')
31
- end
32
- end
33
- end
34
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class InstitutionsForms < FinAppsCore::REST::Resources
6
- def show(site_id)
7
- not_blank(site_id, :site_id)
8
-
9
- path = "institutions/site/#{ERB::Util.url_encode(site_id)}/form"
10
- super site_id, path
11
- end
12
- end
13
- end
14
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class UserInstitutions < FinAppsCore::REST::Resources # :nodoc:
6
- def list
7
- super END_POINT
8
- end
9
-
10
- def create(site_id, params)
11
- not_blank(site_id, :site_id)
12
- not_blank(params, :params)
13
-
14
- path = "institutions/site/#{ERB::Util.url_encode(site_id)}/add"
15
-
16
- super params, path
17
- end
18
-
19
- def show(id)
20
- not_blank(id, :id)
21
- super(id, user_institutions_path(id))
22
- end
23
-
24
- def credentials_update(id, params)
25
- update id, params, 'credentials'
26
- end
27
-
28
- def mfa_update(id, params)
29
- update id, params, 'mfa'
30
- end
31
-
32
- def destroy(id)
33
- not_blank(id, :id)
34
- super(id, user_institutions_path(id))
35
- end
36
-
37
- private
38
-
39
- END_POINT = 'institutions/consumer'
40
-
41
- def update(id, params, method)
42
- not_blank(id, :id)
43
- not_blank(params, :params)
44
-
45
- path = "#{user_institutions_path(id)}/#{method}"
46
- super params, path
47
- end
48
-
49
- def user_institutions_path(id)
50
- "#{END_POINT}/#{ERB::Util.url_encode(id)}"
51
- end
52
- end
53
- end
54
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class UserInstitutionsForms < FinAppsCore::REST::Resources
6
- def show(id)
7
- not_blank(id, :id)
8
-
9
- path = "institutions/consumer/#{ERB::Util.url_encode(id)}/form"
10
- super id, path
11
- end
12
- end
13
- end
14
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class UserInstitutionsStatuses < FinAppsCore::REST::Resources # :nodoc:
6
- def show(id)
7
- not_blank(id, :id)
8
-
9
- path = "institutions/consumer/#{ERB::Util.url_encode(id)}/status"
10
- super id, path
11
- end
12
-
13
- def update
14
- path = 'institutions/refresh'
15
- super nil, path
16
- end
17
- end
18
- end
19
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helpers/client'
4
-
5
- RSpec.describe FinApps::REST::ConsumerInstitutionRefresh, 'initialized with valid FinApps::Client object' do
6
- include SpecHelpers::Client
7
- let(:refresh) { FinApps::REST::ConsumerInstitutionRefresh.new client }
8
-
9
- describe '#update' do
10
- let(:valid_params) { { token: 'valid_token' } }
11
- let(:invalid_params) { { token: 'invalid_token' } }
12
-
13
- context 'when missing id' do
14
- it { expect { refresh.update(nil) }.to raise_error(FinAppsCore::MissingArgumentsError) }
15
- end
16
-
17
- context 'when invalid id is provided' do
18
- subject { refresh.update(:invalid_consumer_institution_id) }
19
-
20
- it { expect { subject }.not_to raise_error }
21
- it('results is nil') { expect(subject[0]).to be_nil }
22
- it('error messages array is populated') { expect(subject[1]).not_to be_nil }
23
- end
24
-
25
- context 'when invalid params are provided' do
26
- subject { refresh.update(:valid_consumer_institution_id, invalid_params) }
27
-
28
- it { expect { subject }.not_to raise_error }
29
- it('results is nil') { expect(subject[0]).to be_nil }
30
- it('error messages array is populated') { expect(subject[1]).not_to be_nil }
31
- end
32
-
33
- context 'when valid id is provided' do
34
- subject { refresh.update(:valid_consumer_institution_id) }
35
-
36
- it { expect { subject }.not_to raise_error }
37
- it('returns an array') { expect(subject).to be_a(Array) }
38
- it('performs a PUT and returns the response') do
39
- expect(subject[0]).to respond_to(:consumer_institution)
40
- end
41
- it('returns no error messages') { expect(subject[1]).to be_empty }
42
- end
43
- end
44
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helpers/client'
4
-
5
- RSpec.describe FinApps::REST::ConsumerInstitutionRefreshes, 'initialized with valid FinApps::Client object' do
6
- include SpecHelpers::Client
7
- subject(:consumer_institution_refresh) { FinApps::REST::ConsumerInstitutionRefreshes.new client }
8
-
9
- describe '#create' do
10
- context 'when called' do
11
- let(:create) { subject.create }
12
- let(:results) { create[0] }
13
- let(:error_messages) { create[1] }
14
-
15
- it { expect { create }.not_to raise_error }
16
- it('returns an array of records') { expect(results).to be_a Array }
17
- it('returns no error messages') { expect(error_messages).to be_empty }
18
- end
19
- end
20
- end