finapps 6.6.1 → 6.7.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: 2a73b786466432a4103a2aa1a613b7294363e3a2a2ee36796e46107cc624cee6
4
- data.tar.gz: 044fd7f2ab6662059afdfe520c73f351a2f6c14571fc2e37c6f14c9f27ede559
3
+ metadata.gz: 735176ac6ed0687571813a8c336c16b69af0c5667c6596700ff9e2a9f68f360a
4
+ data.tar.gz: c6d8d16e7eefd52b3394211874bb3e525c012b63729465d0fdbad4ff06d23b53
5
5
  SHA512:
6
- metadata.gz: 5a3da497f21c62ba5e22347beab814818d9ee9d29a83d8c9a02b9a7db8503ad8b1df848d11606d37e0a51a9c96b34c18ecb92044c08e6cac014a1c4b30882083
7
- data.tar.gz: 16fffb9b02cf31f970a757401c6c60f4c6f98435f7eafb2a145c13f5e43b798b6e2dac6b1a981c2e336a96c8ca09537558a5d1789bb2bcf6f2f8498ebc5b353a
6
+ metadata.gz: 4839196dbed34dce8f802b4e4b95b45b0ce0a8d1e43993290a3783711c6a43394e1ad1680084590ec0ecc3baaa5ae3f4c3c5f52e69b06d72449ef2fd35698e70
7
+ data.tar.gz: 60afeee0003d524c52a7e966e49e8f6972e5308c7d92c34451149ef25a3041078551eb391a72e38b6723bbcad6e2a8ae284f2b659a5814d6a22fbdb13bc491d8
@@ -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:
@@ -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 => 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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '6.6.1'
4
+ VERSION = '6.7.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'
@@ -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
@@ -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
+ }
@@ -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.1
4
+ version: 6.7.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-09 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:
471
+ - spec/support/routes/actors.rb
472
+ - spec/support/routes/screening_metadatas.rb
466
473
  - spec/support/screenings_routes.rb
467
474
  - spec/support/documents_uploads_routes.rb
468
475
  - spec/support/fake_api.rb
469
- - spec/support/routes/actors.rb
470
- - spec/utils/query_builder_spec.rb
471
- - spec/spec_helpers/client.rb
472
- - spec/spec_helpers/api_request.rb
473
- - spec/spec_helper.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
474
480
  - spec/rest/tenant_app_settings_spec.rb
475
- - spec/rest/consumers_portfolios_spec.rb
476
- - spec/rest/portfolios_consumers_spec.rb
481
+ - spec/rest/version_spec.rb
482
+ - spec/rest/screenings_spec.rb
483
+ - spec/rest/documents_orders_spec.rb
484
+ - spec/rest/documents_uploads_spec.rb
485
+ - spec/rest/alert_definitions_spec.rb
486
+ - spec/rest/password_resets_spec.rb
477
487
  - spec/rest/order_reports_spec.rb
478
- - spec/rest/portfolio_reports_spec.rb
479
- - spec/rest/portfolios_spec.rb
480
- - spec/rest/order_tokens_spec.rb
481
- - spec/rest/sessions_spec.rb
482
- - spec/rest/orders_spec.rb
483
- - spec/rest/products_spec.rb
484
- - spec/rest/operators_password_resets_spec.rb
485
488
  - spec/rest/alert_occurrences_spec.rb
486
- - spec/rest/plaid/plaid_consumer_institutions_spec.rb
487
- - spec/rest/plaid/plaid_accounts_spec.rb
488
- - spec/rest/plaid/plaid_webhooks_spec.rb
489
- - spec/rest/plaid/plaid_institution_logos_spec.rb
490
- - spec/rest/plaid/plaid_account_permissions_spec.rb
489
+ - spec/rest/portfolios_available_consumers_spec.rb
491
490
  - spec/rest/consumer_login_tokens_spec.rb
492
- - spec/rest/documents_orders_notifications_spec.rb
493
- - spec/rest/signed_documents_downloads_spec.rb
494
- - spec/rest/operator_change_password_email_spec.rb
495
- - spec/rest/version_spec.rb
491
+ - spec/rest/tenant_settings_spec.rb
492
+ - spec/rest/order_statuses_spec.rb
493
+ - spec/rest/products_spec.rb
496
494
  - spec/rest/operators_spec.rb
495
+ - spec/rest/sessions_spec.rb
497
496
  - spec/rest/order_notifications_spec.rb
498
- - spec/rest/portfolios_alerts_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
499
502
  - spec/rest/verix/verix_pdf_documents_spec.rb
500
503
  - spec/rest/verix/verix_metadata_spec.rb
501
- - spec/rest/verix/verix_documents_spec.rb
502
504
  - spec/rest/verix/verix_records_spec.rb
503
- - spec/rest/screenings_spec.rb
504
- - spec/rest/order_assignments_spec.rb
505
- - spec/rest/alert_definitions_spec.rb
506
- - spec/rest/portfolios_available_consumers_spec.rb
507
- - spec/rest/order_statuses_spec.rb
508
- - spec/rest/actors_spec.rb
509
- - spec/rest/client_spec.rb
510
- - spec/rest/documents_orders_spec.rb
511
- - spec/rest/documents_uploads_spec.rb
512
- - spec/rest/operators_login_tokens_spec.rb
513
- - spec/rest/password_resets_spec.rb
514
- - spec/rest/esign_templates_spec.rb
515
505
  - spec/rest/order_refreshes_spec.rb
506
+ - spec/rest/plaid/plaid_account_permissions_spec.rb
507
+ - spec/rest/plaid/plaid_consumer_institutions_spec.rb
508
+ - spec/rest/plaid/plaid_institution_logos_spec.rb
509
+ - spec/rest/plaid/plaid_webhooks_spec.rb
510
+ - spec/rest/plaid/plaid_accounts_spec.rb
511
+ - spec/rest/client_spec.rb
512
+ - spec/rest/portfolios_alerts_spec.rb
516
513
  - spec/rest/consumers_spec.rb
517
- - spec/rest/tenant_settings_spec.rb
518
- - spec/rest/documents_upload_types_spec.rb
514
+ - spec/rest/order_assignments_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
522
+ - spec/spec_helpers/api_request.rb
523
+ - spec/spec_helpers/client.rb
524
+ - spec/utils/query_builder_spec.rb
525
+ - spec/spec_helper.rb