finapps 6.6.0 → 6.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db026df91582571b3b108a3fd4996f8030941df83b4a606857d3471fb3c4575e
4
- data.tar.gz: 8debd1ce6537786a5fc593a56daa5385593f698fb24f096f92e6e5e3c01169f2
3
+ metadata.gz: d9f972096761ac681f6f984445a44fe9fe28dca7e2ee8b45839e0f1ef5b60a24
4
+ data.tar.gz: a973e1c1790dd21f505b673e95660882c19a781e605cfea6e2707efef6e8b62d
5
5
  SHA512:
6
- metadata.gz: '08ef11ebbf9618230a9835e90913bfc70d51f1a11752db4dd393f73981c7d8499860c392b4cde94a4df6930a95643c5b1edd11273d75a2aa1ac690e8d0ed7c3e'
7
- data.tar.gz: 219263a24148d12869c73d032d7fd7b924bf7aedfe13d0e3b8cdc42db6d4afff62bb51acbfa8e29f70beaab72a1dcfec1dbcf78ae24934fb7d9998f64ae30e41
6
+ metadata.gz: d47eecdc4513c9676b9fdb9f8b589a98acecfc593bdb828099079584832289f5b50275fdc3b7b280e774fb9e6aef4490c739b336e3dd9a8439c81e465a02c725
7
+ data.tar.gz: 5fdedc48c9f1887f146e4c33ed55fed6b5ab604bec091670991972ff063f9174f93d56853af506595286af0fcccf15be75c465c8a72f56bf69f4e1a3c721bf3d
@@ -20,7 +20,7 @@ jobs:
20
20
  runs-on: ${{ matrix.os }}
21
21
  steps:
22
22
  - name: Checkout source code
23
- uses: actions/checkout@v2.3.5
23
+ uses: actions/checkout@v2.4.0
24
24
 
25
25
  - name: Install required ruby version
26
26
  uses: ruby/setup-ruby@v1
@@ -11,7 +11,7 @@ jobs:
11
11
 
12
12
  steps:
13
13
  - name: Checkout source code
14
- uses: actions/checkout@v2.3.5
14
+ uses: actions/checkout@v2.4.0
15
15
  with:
16
16
  persist-credentials: false
17
17
  fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
@@ -7,7 +7,7 @@ jobs:
7
7
  label:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: mheap/github-action-required-labels@v1.1.2
10
+ - uses: mheap/github-action-required-labels@v1.2
11
11
  with:
12
12
  mode: minimum
13
13
  count: 1
data/.rubocop.yml CHANGED
@@ -12,6 +12,9 @@ AllCops:
12
12
  CacheRootDirectory: tmp
13
13
  NewCops: enable
14
14
 
15
+ Gemspec/RequireMFA:
16
+ Enabled: false
17
+
15
18
  Layout/SpaceAroundMethodCallOperator:
16
19
  Enabled: true
17
20
  Layout/EmptyLinesAroundAttributeAccessor:
@@ -3,7 +3,7 @@
3
3
  module FinApps
4
4
  module REST
5
5
  class Actors < FinAppsCore::REST::Resources
6
- END_POINT = 'actors/details'
6
+ END_POINT = 'actor/details'
7
7
 
8
8
  def show
9
9
  super nil, END_POINT
@@ -42,6 +42,7 @@ module FinApps
42
42
  portfolio_reports
43
43
  products
44
44
  screenings
45
+ screening_metadatas
45
46
  sessions
46
47
  signed_documents_downloads
47
48
  tenant_settings
@@ -75,7 +76,7 @@ module FinApps
75
76
  end
76
77
 
77
78
  def set_variable(class_name, variable)
78
- klass = Object.const_get('FinApps').const_get('REST').const_get class_name
79
+ klass = Object.const_get(:FinApps).const_get(:REST).const_get class_name
79
80
  instance_variable_set(variable, klass.new(self))
80
81
  end
81
82
 
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class ScreeningMetadatas < FinAppsCore::REST::Resources # :nodoc:
6
+ def show(id, key)
7
+ not_blank(id, :session_id)
8
+ not_blank(key, :key)
9
+
10
+ path = "screenings/#{ERB::Util.url_encode(id)}/meta/#{ERB::Util.url_encode(key)}"
11
+ super(nil, path)
12
+ end
13
+
14
+ def create(id, key, value)
15
+ not_blank(id, :session_id)
16
+ not_blank(key, :key)
17
+ not_blank(value, :value)
18
+
19
+ path = "screenings/#{ERB::Util.url_encode(id)}/meta"
20
+ super({key: key, value: value}, path)
21
+ end
22
+
23
+ def destroy(id, key)
24
+ not_blank(id, :session_id)
25
+ not_blank(key, :key)
26
+
27
+ path = "screenings/#{ERB::Util.url_encode(id)}/meta/#{ERB::Util.url_encode(key)}"
28
+ super(nil, path)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -57,6 +57,7 @@ module FinApps
57
57
 
58
58
  def build_filter(params)
59
59
  term_filter(params[:searchTerm])
60
+ .merge(operator_filter(params[:operatorID]))
60
61
  .merge(date_range_filter(params[:fromDate], params[:toDate]))
61
62
  .merge(progress_filter(params[:progress]))
62
63
  end
@@ -73,7 +74,9 @@ module FinApps
73
74
  {'consumer.email': term},
74
75
  {'consumer.first_name': term},
75
76
  {'consumer.last_name': term},
76
- {'consumer.external_id': term}
77
+ {'consumer.external_id': term},
78
+ {'operator.first_name': term},
79
+ {'operator.last_name': term}
77
80
  ]
78
81
  end
79
82
 
@@ -84,11 +87,19 @@ module FinApps
84
87
  term.split.each do |t|
85
88
  arr.append('consumer.first_name': t)
86
89
  arr.append('consumer.last_name': t)
90
+ arr.append('operator.first_name': t)
91
+ arr.append('operator.last_name': t)
87
92
  end
88
93
 
89
94
  arr
90
95
  end
91
96
 
97
+ def operator_filter(operator_id)
98
+ return {} unless operator_id
99
+
100
+ {operator_id: operator_id}
101
+ end
102
+
92
103
  def date_range_filter(from_date, to_date)
93
104
  return {} unless from_date || to_date
94
105
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '6.6.0'
4
+ VERSION = '6.8.0'
5
5
  end
data/lib/finapps.rb CHANGED
@@ -40,6 +40,7 @@ require 'finapps/rest/documents_upload_types'
40
40
  require 'finapps/rest/signed_documents_downloads'
41
41
  require 'finapps/rest/documents_orders_notifications'
42
42
  require 'finapps/rest/screenings'
43
+ require 'finapps/rest/screening_metadatas'
43
44
 
44
45
  require 'finapps/rest/plaid/plaid_resources'
45
46
  require 'finapps/rest/plaid/plaid_webhooks'
@@ -27,7 +27,7 @@ RSpec.describe FinApps::REST::Actors do
27
27
  end
28
28
 
29
29
  def stub_unauthorized_request
30
- stub_request(:get, %r{/actors/details}).to_return(
30
+ stub_request(:get, %r{/actor/details}).to_return(
31
31
  status: 401,
32
32
  body: {
33
33
  error_messages: ['Unauthorized'],
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+ require 'spec_helpers/api_request'
5
+
6
+ RSpec.describe FinApps::REST::ScreeningMetadatas do
7
+ include SpecHelpers::Client
8
+
9
+ let(:results) { subject[RESULTS] }
10
+ let(:error_messages) { subject[ERROR_MESSAGES] }
11
+
12
+ describe '#show' do
13
+ subject(:show_metadata) { described_class.new(client).show(id, key) }
14
+
15
+ context 'with valid params' do
16
+ let(:id) { :session_id }
17
+ let(:key) { :key }
18
+
19
+ before { show_metadata }
20
+
21
+ it 'sends proper request' do
22
+ url = "#{versioned_api_path}/screenings/session_id/meta/key"
23
+
24
+ expect(WebMock).to have_requested(:get, url)
25
+ end
26
+
27
+ it_behaves_like 'an API request'
28
+ it_behaves_like 'a successful request'
29
+ end
30
+
31
+ context 'with invalid params' do
32
+ let(:id) { :something_else }
33
+ let(:key) { :key }
34
+
35
+ it_behaves_like 'an API request'
36
+ it('results is nil') { expect(results).to be_nil }
37
+
38
+ it('error messages array is populated') do
39
+ expect(error_messages.first.downcase).to eq('the screening id was not found')
40
+ end
41
+ end
42
+
43
+ context 'with missing params' do
44
+ let(:id) { nil }
45
+ let(:key) { nil }
46
+
47
+ it_behaves_like 'a request that raises an error'
48
+ end
49
+ end
50
+
51
+ describe '#create' do
52
+ subject(:create_metadata) { described_class.new(client).create(id, key, value) }
53
+
54
+ context 'with valid params' do
55
+ let(:id) { :session_id }
56
+ let(:key) { :key }
57
+ let(:value) { :value }
58
+
59
+ before { create_metadata }
60
+
61
+ it 'sends proper request' do
62
+ url = "#{versioned_api_path}/screenings/session_id/meta"
63
+
64
+ expect(WebMock).to have_requested(:post, url)
65
+ end
66
+
67
+ it_behaves_like 'an API request'
68
+ it_behaves_like 'a successful request'
69
+ end
70
+
71
+ context 'with invalid params' do
72
+ let(:id) { :something_else }
73
+ let(:key) { :key }
74
+ let(:value) { :value }
75
+
76
+ it_behaves_like 'an API request'
77
+ it('results is nil') { expect(results).to be_nil }
78
+
79
+ it('error messages array is populated') do
80
+ expect(error_messages.first.downcase).to eq('the screening id was not found')
81
+ end
82
+ end
83
+
84
+ context 'with missing params' do
85
+ let(:id) { nil }
86
+ let(:key) { nil }
87
+ let(:value) { nil }
88
+
89
+ it_behaves_like 'a request that raises an error'
90
+ end
91
+ end
92
+
93
+ describe '#destroy' do
94
+ subject(:destroy_metadata) { described_class.new(client).destroy(id, key) }
95
+
96
+ context 'with valid params' do
97
+ let(:id) { :session_id }
98
+ let(:key) { :key }
99
+
100
+ before { destroy_metadata }
101
+
102
+ it 'sends proper request' do
103
+ url = "#{versioned_api_path}/screenings/session_id/meta/key"
104
+
105
+ expect(WebMock).to have_requested(:delete, url)
106
+ end
107
+
108
+ it_behaves_like 'an API request'
109
+ it_behaves_like 'a successful request'
110
+ end
111
+
112
+ context 'with invalid params' do
113
+ let(:id) { :something_else }
114
+ let(:key) { :key }
115
+
116
+ it_behaves_like 'an API request'
117
+ it('results is nil') { expect(results).to be_nil }
118
+
119
+ it('error messages array is populated') do
120
+ expect(error_messages.first.downcase).to eq('the screening id was not found')
121
+ end
122
+ end
123
+
124
+ context 'with missing params' do
125
+ let(:id) { nil }
126
+ let(:key) { nil }
127
+
128
+ it_behaves_like 'a request that raises an error'
129
+ end
130
+ end
131
+ end
@@ -84,10 +84,24 @@ RSpec.describe FinApps::REST::Screenings do
84
84
  {'consumer.first_name': 'le term'},
85
85
  {'consumer.last_name': 'le term'},
86
86
  {'consumer.external_id': 'le term'},
87
+ {'operator.first_name': 'le term'},
88
+ {'operator.last_name': 'le term'},
87
89
  {'consumer.first_name': 'le'},
88
90
  {'consumer.last_name': 'le'},
91
+ {'operator.first_name': 'le'},
92
+ {'operator.last_name': 'le'},
89
93
  {'consumer.first_name': 'term'},
90
- {'consumer.last_name': 'term'}]
94
+ {'consumer.last_name': 'term'},
95
+ {'operator.first_name': 'term'},
96
+ {'operator.last_name': 'term'}]
97
+ }
98
+ end
99
+
100
+ context 'with operator' do
101
+ let(:params) { {operatorID: '123abc'} }
102
+
103
+ it_behaves_like 'a correct query builder', {
104
+ operator_id: '123abc'
91
105
  }
92
106
  end
93
107
  end
@@ -4,6 +4,7 @@ require 'sinatra/base'
4
4
  require_relative 'documents_uploads_routes'
5
5
  require_relative 'screenings_routes'
6
6
  require_relative 'routes/actors'
7
+ require_relative 'routes/screening_metadatas'
7
8
 
8
9
  module Fake
9
10
  # the FakeApi class is used to mock API requests while testing.
@@ -22,6 +23,7 @@ module Fake
22
23
  include ActorsRoutes
23
24
  include DocumentsUploadsRoutes
24
25
  include ScreeningsRoutes
26
+ include ScreeningMetadatasRoutes
25
27
 
26
28
  # verix_metadata
27
29
  get("/#{version}/v/metadata") do
@@ -553,7 +555,7 @@ module Fake
553
555
  def http_response(content_type, response_code, file_name)
554
556
  content_type content_type
555
557
  status response_code
556
- File.open("#{File.dirname(__FILE__)}/fixtures/#{file_name}").read
558
+ File.read("#{File.dirname(__FILE__)}/fixtures/#{file_name}")
557
559
  end
558
560
  end
559
561
  end
@@ -0,0 +1,3 @@
1
+ {
2
+ "messages": [ "The screening ID was not found" ]
3
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "key": "le-key",
3
+ "value": "le-value"
4
+ }
@@ -4,7 +4,7 @@ module Fake
4
4
  module ActorsRoutes
5
5
  class << self
6
6
  def included(base)
7
- base.get("/#{base.version}/actors/details") do
7
+ base.get("/#{base.version}/actor/details") do
8
8
  json_response 200, 'actors/details.json'
9
9
  end
10
10
  super
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fake
4
+ module ScreeningMetadatasRoutes
5
+ class << self
6
+ def included(base)
7
+ get_routes base
8
+ post_routes base
9
+ destroy_routes base
10
+
11
+ super
12
+ end
13
+
14
+ def post_routes(base)
15
+ base.post("/#{base.version}/screenings/:session_id/meta") do
16
+ if params[:session_id] == 'session_id'
17
+ status 204
18
+ else
19
+ json_response 404, 'screening_metadatas/not_found.json'
20
+ end
21
+ end
22
+ end
23
+
24
+ def destroy_routes(base)
25
+ base.delete("/#{base.version}/screenings/:session_id/meta/:key") do
26
+ if params[:session_id] == 'session_id'
27
+ status 204
28
+ else
29
+ json_response 404, 'screening_metadatas/not_found.json'
30
+ end
31
+ end
32
+ end
33
+
34
+ def get_routes(base)
35
+ base.get("/#{base.version}/screenings/:session_id/meta/:key") do
36
+ if params[:session_id] == 'session_id'
37
+ json_response 200, 'screening_metadatas/show.json'
38
+ else
39
+ json_response 404, 'screening_metadatas/not_found.json'
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
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: 6.6.0
4
+ version: 6.8.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-10-27 00:00:00.000000000 Z
11
+ date: 2022-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -294,6 +294,7 @@ files:
294
294
  - lib/finapps/rest/portfolios_available_consumers.rb
295
295
  - lib/finapps/rest/portfolios_consumers.rb
296
296
  - lib/finapps/rest/products.rb
297
+ - lib/finapps/rest/screening_metadatas.rb
297
298
  - lib/finapps/rest/screenings.rb
298
299
  - lib/finapps/rest/sessions.rb
299
300
  - lib/finapps/rest/signed_documents_downloads.rb
@@ -341,6 +342,7 @@ files:
341
342
  - spec/rest/portfolios_consumers_spec.rb
342
343
  - spec/rest/portfolios_spec.rb
343
344
  - spec/rest/products_spec.rb
345
+ - spec/rest/screening_metadatas_spec.rb
344
346
  - spec/rest/screenings_spec.rb
345
347
  - spec/rest/sessions_spec.rb
346
348
  - spec/rest/signed_documents_downloads_spec.rb
@@ -410,6 +412,8 @@ files:
410
412
  - spec/support/fixtures/screening.json
411
413
  - spec/support/fixtures/screening_invalid_update.json
412
414
  - spec/support/fixtures/screening_list.json
415
+ - spec/support/fixtures/screening_metadatas/not_found.json
416
+ - spec/support/fixtures/screening_metadatas/show.json
413
417
  - spec/support/fixtures/screenings/last_session.json
414
418
  - spec/support/fixtures/screenings/session_not_found_with_id.json
415
419
  - spec/support/fixtures/screenings/tenant_schemas.json
@@ -430,6 +434,7 @@ files:
430
434
  - spec/support/fixtures/verix/record/create.json
431
435
  - spec/support/fixtures/verix/record/list.json
432
436
  - spec/support/routes/actors.rb
437
+ - spec/support/routes/screening_metadatas.rb
433
438
  - spec/support/screenings_routes.rb
434
439
  - spec/utils/query_builder_spec.rb
435
440
  - tags
@@ -463,56 +468,58 @@ signing_key:
463
468
  specification_version: 4
464
469
  summary: FinApps REST API ruby client.
465
470
  test_files:
466
- - spec/rest/portfolio_reports_spec.rb
471
+ - spec/support/routes/actors.rb
472
+ - spec/support/routes/screening_metadatas.rb
473
+ - spec/support/screenings_routes.rb
474
+ - spec/support/documents_uploads_routes.rb
475
+ - spec/support/fake_api.rb
476
+ - spec/rest/operators_login_tokens_spec.rb
477
+ - spec/rest/screening_metadatas_spec.rb
478
+ - spec/rest/documents_upload_types_spec.rb
479
+ - spec/rest/orders_spec.rb
480
+ - spec/rest/tenant_app_settings_spec.rb
481
+ - spec/rest/version_spec.rb
467
482
  - spec/rest/screenings_spec.rb
468
- - spec/rest/sessions_spec.rb
469
- - spec/rest/consumers_portfolios_spec.rb
483
+ - spec/rest/documents_orders_spec.rb
470
484
  - spec/rest/documents_uploads_spec.rb
471
- - spec/rest/portfolios_consumers_spec.rb
472
- - spec/rest/actors_spec.rb
473
- - spec/rest/documents_orders_notifications_spec.rb
474
485
  - spec/rest/alert_definitions_spec.rb
475
- - spec/rest/client_spec.rb
476
- - spec/rest/operators_spec.rb
477
- - spec/rest/esign_templates_spec.rb
478
- - spec/rest/consumers_spec.rb
479
- - spec/rest/order_refreshes_spec.rb
486
+ - spec/rest/password_resets_spec.rb
480
487
  - spec/rest/order_reports_spec.rb
488
+ - spec/rest/alert_occurrences_spec.rb
489
+ - spec/rest/portfolios_available_consumers_spec.rb
490
+ - spec/rest/consumer_login_tokens_spec.rb
491
+ - spec/rest/tenant_settings_spec.rb
481
492
  - spec/rest/order_statuses_spec.rb
482
- - spec/rest/signed_documents_downloads_spec.rb
483
493
  - spec/rest/products_spec.rb
484
- - spec/rest/consumer_login_tokens_spec.rb
485
- - spec/rest/password_resets_spec.rb
486
- - spec/rest/operator_change_password_email_spec.rb
487
- - spec/rest/version_spec.rb
488
- - spec/rest/operators_password_resets_spec.rb
489
- - spec/rest/portfolios_alerts_spec.rb
490
- - spec/rest/alert_occurrences_spec.rb
494
+ - spec/rest/operators_spec.rb
495
+ - spec/rest/sessions_spec.rb
496
+ - spec/rest/order_notifications_spec.rb
497
+ - spec/rest/signed_documents_downloads_spec.rb
498
+ - spec/rest/portfolio_reports_spec.rb
499
+ - spec/rest/portfolios_spec.rb
500
+ - spec/rest/consumers_portfolios_spec.rb
501
+ - spec/rest/verix/verix_documents_spec.rb
502
+ - spec/rest/verix/verix_pdf_documents_spec.rb
503
+ - spec/rest/verix/verix_metadata_spec.rb
504
+ - spec/rest/verix/verix_records_spec.rb
505
+ - spec/rest/order_refreshes_spec.rb
506
+ - spec/rest/plaid/plaid_account_permissions_spec.rb
491
507
  - spec/rest/plaid/plaid_consumer_institutions_spec.rb
492
- - spec/rest/plaid/plaid_webhooks_spec.rb
493
508
  - spec/rest/plaid/plaid_institution_logos_spec.rb
509
+ - spec/rest/plaid/plaid_webhooks_spec.rb
494
510
  - spec/rest/plaid/plaid_accounts_spec.rb
495
- - spec/rest/plaid/plaid_account_permissions_spec.rb
496
- - spec/rest/order_tokens_spec.rb
511
+ - spec/rest/client_spec.rb
512
+ - spec/rest/portfolios_alerts_spec.rb
513
+ - spec/rest/consumers_spec.rb
497
514
  - spec/rest/order_assignments_spec.rb
498
- - spec/rest/tenant_app_settings_spec.rb
499
- - spec/rest/documents_upload_types_spec.rb
500
- - spec/rest/verix/verix_documents_spec.rb
501
- - spec/rest/verix/verix_metadata_spec.rb
502
- - spec/rest/verix/verix_records_spec.rb
503
- - spec/rest/verix/verix_pdf_documents_spec.rb
504
- - spec/rest/operators_login_tokens_spec.rb
505
- - spec/rest/portfolios_spec.rb
506
- - spec/rest/documents_orders_spec.rb
507
- - spec/rest/order_notifications_spec.rb
508
- - spec/rest/tenant_settings_spec.rb
509
- - spec/rest/portfolios_available_consumers_spec.rb
510
- - spec/rest/orders_spec.rb
511
- - spec/spec_helper.rb
512
- - spec/support/screenings_routes.rb
513
- - spec/support/fake_api.rb
514
- - spec/support/documents_uploads_routes.rb
515
- - spec/support/routes/actors.rb
516
- - spec/utils/query_builder_spec.rb
515
+ - spec/rest/operator_change_password_email_spec.rb
516
+ - spec/rest/documents_orders_notifications_spec.rb
517
+ - spec/rest/operators_password_resets_spec.rb
518
+ - spec/rest/esign_templates_spec.rb
519
+ - spec/rest/order_tokens_spec.rb
520
+ - spec/rest/portfolios_consumers_spec.rb
521
+ - spec/rest/actors_spec.rb
517
522
  - spec/spec_helpers/api_request.rb
518
523
  - spec/spec_helpers/client.rb
524
+ - spec/utils/query_builder_spec.rb
525
+ - spec/spec_helper.rb