finapps 6.10.1 → 6.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b42aeaed6c32c359360c5f40a432723036e7118029003cd6b0d0e2fccad644fd
4
- data.tar.gz: 720c838e5da2710309dc6be29e640ba6238c101244145a4eb20b06d765c4387b
3
+ metadata.gz: 6ce7c7f8fc34e608321adfbbd46536d067f7d50ad907ae0990623b840431f4c7
4
+ data.tar.gz: 73b85fc49cee872b9c1f0f5e3d9f39493a23bd0f46aeea8f6ef1e0c19979c5e8
5
5
  SHA512:
6
- metadata.gz: 6b6a365b8057aebefb8431f93e660b133deda0ae94829aa2fdc98d4f59001c9b1cd803af75b44de83bb5c574d940dacb25e13b1e40ff93b2f76893a7bf3001e6
7
- data.tar.gz: 7f09473a81677c621c2ebc86e15e346a4d3c5418e3e845c2ac16cf8237c247ccb5aa2b70e46744b1bad3d6f4bb5784be1e9bcca7ecb806dc3fe663e6f050e60d
6
+ metadata.gz: a48f06dc8cba7910743355dcd41e93d0835cb5c270b04e94ac11177994ab9397f023504b910b5ae08d00f492db8f7a07b1d586ba0990103fd78493b8aaee5b8c
7
+ data.tar.gz: f42a6c18258a88072d36a46d91c2071c648aba643f9a433b762589133d089a7d71839a9feb2a62796f31a019890e64cefca5071056671a1b44f8be6cf4a5e9be
data/finapps.gemspec CHANGED
@@ -17,7 +17,6 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0")
19
19
  spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
20
- spec.test_files = Dir['spec/**/*.rb']
21
20
  spec.require_paths = ['lib']
22
21
 
23
22
  spec.add_runtime_dependency 'finapps_core', '~> 6.0', '>= 6.0.2'
@@ -17,6 +17,7 @@ module FinApps
17
17
  documents_orders_notifications
18
18
  documents_upload_types
19
19
  documents_uploads
20
+ edm_transmissions
20
21
  esign_templates
21
22
  orders
22
23
  locations
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class EdmTransmissions < FinAppsCore::REST::Resources # :nodoc:
6
+ def create(order_id, params)
7
+ not_blank(order_id, :order_id)
8
+
9
+ path = "documents/edm/#{ERB::Util.url_encode(order_id)}/transmit"
10
+ super(params, path)
11
+ end
12
+
13
+ def show(transmission_id)
14
+ not_blank(transmission_id, :transmission_id)
15
+
16
+ path = "documents/edm/#{ERB::Util.url_encode(transmission_id)}"
17
+ super transmission_id, path
18
+ end
19
+ end
20
+ end
21
+ end
@@ -67,10 +67,11 @@ module FinApps
67
67
  end
68
68
 
69
69
  def term_array(term)
70
- [
71
- {email: term},
72
- {last_name: term}
73
- ]
70
+ if term.include?('@')
71
+ [{email: term}]
72
+ else
73
+ [{last_name: term}]
74
+ end
74
75
  end
75
76
 
76
77
  def role_filter(role)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '6.10.1'
4
+ VERSION = '6.12.0'
5
5
  end
data/lib/finapps.rb CHANGED
@@ -5,6 +5,7 @@ require 'faraday_middleware'
5
5
 
6
6
  require 'finapps_core'
7
7
  require 'finapps/rest/actors'
8
+ require 'finapps/rest/edm_transmissions'
8
9
  require 'finapps/rest/version'
9
10
  require 'finapps/rest/locations'
10
11
  require 'finapps/rest/consumers'
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe FinApps::REST::EdmTransmissions do
4
+ include SpecHelpers::Client
5
+
6
+ RSpec.shared_examples 'an EdmTransmission response' do
7
+ it_behaves_like 'an API request'
8
+ it_behaves_like 'a successful request'
9
+
10
+ it('returns a hash with the correct keys') do
11
+ expect(subject[RESULTS].keys)
12
+ .to(match_array(%i[transmission_id date_created date_modified status
13
+ document_order_id documents]))
14
+ end
15
+ end
16
+
17
+ describe '#create' do
18
+ subject(:list) { described_class.new(client).create(:order_id, params) }
19
+
20
+ let(:params) { {external_id: '12345'} }
21
+
22
+ it_behaves_like 'an EdmTransmission response'
23
+ end
24
+
25
+ describe '#show' do
26
+ subject(:show) { described_class.new(client).show(:transmission_id) }
27
+
28
+ it_behaves_like 'an EdmTransmission response'
29
+ end
30
+ end
@@ -7,6 +7,26 @@ RSpec.describe FinApps::REST::Locations do
7
7
 
8
8
  let(:id) { :id }
9
9
 
10
+ params = {name: 'Quick Mart Non-Urgent Care', state: {code: 'MD'}}
11
+
12
+ RSpec::Matchers.define :have_keys do |*keys|
13
+ match {|actual| keys.all? {|key| actual.key? key } }
14
+ end
15
+
16
+ RSpec.shared_examples 'a request to a not found resource' do
17
+ it_behaves_like 'a failed request'
18
+ it('returns a 404 error') do
19
+ expect(subject[ERROR_MESSAGES].first)
20
+ .to(eq('the server responded with status 404'))
21
+ end
22
+ end
23
+
24
+ RSpec.shared_examples 'a successful API request returning an empty body' do
25
+ it_behaves_like 'an API request'
26
+ it_behaves_like 'a successful request'
27
+ it { expect(subject[RESULTS]).to be_nil }
28
+ end
29
+
10
30
  describe '#list' do
11
31
  subject(:list) { described_class.new(client).list filter }
12
32
 
@@ -14,9 +34,7 @@ RSpec.describe FinApps::REST::Locations do
14
34
 
15
35
  it_behaves_like 'an API request'
16
36
  it_behaves_like 'a successful request'
17
- it { expect(list[RESULTS]).to all(have_key(:id)) }
18
- it { expect(list[RESULTS]).to all(have_key(:name)) }
19
- it { expect(list[RESULTS]).to all(have_key(:state)) }
37
+ it { expect(list[RESULTS]).to all(have_keys(:id, :name, :state)) }
20
38
 
21
39
  context 'when the JMESPath filter is invalid' do
22
40
  let(:filter) { 'invalid' }
@@ -25,32 +43,14 @@ RSpec.describe FinApps::REST::Locations do
25
43
  end
26
44
  end
27
45
 
28
- describe '#create' do
29
- subject(:create) { described_class.new(client).create(params) }
30
-
31
- let(:params) { {name: 'Quick Mart Urgent Care', state: {code: 'MD'}} }
32
-
33
- it_behaves_like 'an API request'
34
- it_behaves_like 'a successful request'
35
- it { expect(create[RESULTS]).to be_nil }
36
- end
37
-
38
- RSpec.shared_examples 'a request to a not found resource' do
39
- it_behaves_like 'a failed request'
40
- it('returns a 404 error') do
41
- expect(subject[ERROR_MESSAGES].first)
42
- .to(eq('the server responded with status 404'))
43
- end
44
- end
45
-
46
46
  describe '#show' do
47
47
  subject(:show) { described_class.new(client).show(id) }
48
48
 
49
- it_behaves_like 'an API request'
50
- it_behaves_like 'a successful request'
51
- it { expect(show[RESULTS]).to have_key(:id) }
52
- it { expect(show[RESULTS]).to have_key(:name) }
53
- it { expect(show[RESULTS]).to have_key(:state) }
49
+ context 'when the location exists' do
50
+ it_behaves_like 'an API request'
51
+ it_behaves_like 'a successful request'
52
+ it { expect(show[RESULTS]).to have_keys(:id, :name, :state) }
53
+ end
54
54
 
55
55
  context 'when id does not match any location' do
56
56
  let(:id) { 'not_found' }
@@ -59,14 +59,18 @@ RSpec.describe FinApps::REST::Locations do
59
59
  end
60
60
  end
61
61
 
62
+ describe '#create' do
63
+ subject(:create) { described_class.new(client).create(params) }
64
+
65
+ it_behaves_like 'a successful API request returning an empty body'
66
+ end
67
+
62
68
  describe '#update' do
63
69
  subject(:update) { described_class.new(client).update(id, params) }
64
70
 
65
- let(:params) { {name: 'Quick Mart Non-Urgent Care', state: {code: 'MD'}} }
66
-
67
- it_behaves_like 'an API request'
68
- it_behaves_like 'a successful request'
69
- it { expect(update[RESULTS]).to be_nil }
71
+ context 'when the location exists' do
72
+ it_behaves_like 'a successful API request returning an empty body'
73
+ end
70
74
 
71
75
  context 'when id does not match any location' do
72
76
  let(:id) { 'not_found' }
@@ -78,9 +82,9 @@ RSpec.describe FinApps::REST::Locations do
78
82
  describe '#destroy' do
79
83
  subject(:destroy) { described_class.new(client).destroy(id) }
80
84
 
81
- it_behaves_like 'an API request'
82
- it_behaves_like 'a successful request'
83
- it { expect(destroy[RESULTS]).to be_nil }
85
+ context 'when the location exists' do
86
+ it_behaves_like 'a successful API request returning an empty body'
87
+ end
84
88
 
85
89
  context 'when id does not match any location' do
86
90
  let(:id) { 'not_found' }
@@ -25,12 +25,21 @@ RSpec.describe FinApps::REST::Operators do
25
25
  end
26
26
  end
27
27
 
28
- context 'with searchTerm' do
28
+ context 'with email searchTerm' do
29
+ let(:params) { {searchTerm: 'term@example.com'} }
30
+
31
+ it_behaves_like 'a filtereable GET index request', {
32
+ '$or': [
33
+ {email: 'term@example.com'}
34
+ ]
35
+ }
36
+ end
37
+
38
+ context 'with non email searchTerm' do
29
39
  let(:params) { {searchTerm: 'le term'} }
30
40
 
31
41
  it_behaves_like 'a filtereable GET index request', {
32
42
  '$or': [
33
- {email: 'le term'},
34
43
  {last_name: 'le term'}
35
44
  ]
36
45
  }
@@ -65,7 +74,7 @@ RSpec.describe FinApps::REST::Operators do
65
74
  it 'builds a full filter and query and sends the request' do
66
75
  list
67
76
 
68
- filter = {'$or': [{email: 't'}, {last_name: 't'}], role: {'$in': [2]}}
77
+ filter = {'$or': [{last_name: 't'}], role: {'$in': [2]}}
69
78
  expect(WebMock).to have_requested(:get, "#{versioned_api_path}/operators"\
70
79
  "?filter=#{ERB::Util.url_encode filter.to_json}"\
71
80
  '&page=2&requested=25&sort=date_created')
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if ENV['COVERAGE'] == 'true'
3
+ if ENV.fetch('COVERAGE', nil) == 'true'
4
4
  require 'simplecov'
5
5
  require 'simplecov-console'
6
6
 
@@ -5,6 +5,7 @@ require 'sinatra/base'
5
5
  require_relative 'documents_uploads_routes'
6
6
  require_relative 'screenings_routes'
7
7
  require_relative 'routes/actors'
8
+ require_relative 'routes/edm_transmissions'
8
9
  require_relative 'routes/locations'
9
10
  require_relative 'routes/screening_metadatas'
10
11
  require_relative 'routes/query_screenings'
@@ -25,6 +26,7 @@ module Fake
25
26
  delete("/#{version}/resources/:id") { status 202 }
26
27
 
27
28
  include ActorsRoutes
29
+ include EdmTransmissionsRoutes
28
30
  include DocumentsUploadsRoutes
29
31
  include LocationsRoutes
30
32
  include QueryScreeningRoutes
@@ -0,0 +1,17 @@
1
+ {
2
+ "transmission_id": "7829e171-4d39-4270-8969-7729038953d2",
3
+ "date_created": "2022-05-18T21:05:48.076809156Z",
4
+ "date_modified": "2022-05-18T21:05:48.07680924Z",
5
+ "status": 0,
6
+ "document_order_id": "0c272b3d-3c8c-43ab-beff-f5964835a591",
7
+ "documents": [
8
+ {
9
+ "template_data": null,
10
+ "path": "",
11
+ "file_id": "",
12
+ "status": 0,
13
+ "edm_filename": "",
14
+ "date_modified": "0001-01-01T00:00:00Z"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "transmission_id": "7829e171-4d39-4270-8969-7729038953d2",
3
+ "date_created": "2022-05-18T21:05:48.076Z",
4
+ "date_modified": "2022-06-08T20:46:05.839936446Z",
5
+ "status": 1,
6
+ "document_order_id": "0c272b3d-3c8c-43ab-beff-f5964835a591",
7
+ "documents": [
8
+ {
9
+ "template_data": {},
10
+ "path": "",
11
+ "file_id": "",
12
+ "status": 0,
13
+ "edm_filename": "",
14
+ "date_modified": "0001-01-01T00:00:00Z"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fake
4
+ module EdmTransmissionsRoutes
5
+ class << self
6
+ def included(base)
7
+ get_routes base
8
+ post_routes base
9
+
10
+ super
11
+ end
12
+
13
+ def get_routes(base)
14
+ base.get("/#{base.version}/documents/edm/:transmission_id") do
15
+ json_response 200, 'edm_transmissions/show.json'
16
+ end
17
+ end
18
+
19
+ def post_routes(base)
20
+ base.post("/#{base.version}/documents/edm/:order_id/transmit") do
21
+ json_response 200, 'edm_transmissions/create.json'
22
+ end
23
+ end
24
+ end
25
+ end
26
+ 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.10.1
4
+ version: 6.12.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: 2022-04-13 00:00:00.000000000 Z
11
+ date: 2022-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -269,6 +269,7 @@ files:
269
269
  - lib/finapps/rest/documents_orders_notifications.rb
270
270
  - lib/finapps/rest/documents_upload_types.rb
271
271
  - lib/finapps/rest/documents_uploads.rb
272
+ - lib/finapps/rest/edm_transmissions.rb
272
273
  - lib/finapps/rest/esign_templates.rb
273
274
  - lib/finapps/rest/locations.rb
274
275
  - lib/finapps/rest/operator_change_password_email.rb
@@ -322,6 +323,7 @@ files:
322
323
  - spec/rest/documents_orders_spec.rb
323
324
  - spec/rest/documents_upload_types_spec.rb
324
325
  - spec/rest/documents_uploads_spec.rb
326
+ - spec/rest/edm_transmissions_spec.rb
325
327
  - spec/rest/esign_templates_spec.rb
326
328
  - spec/rest/locations_spec.rb
327
329
  - spec/rest/operator_change_password_email_spec.rb
@@ -375,6 +377,8 @@ files:
375
377
  - spec/support/fixtures/documents_order.json
376
378
  - spec/support/fixtures/documents_orders.json
377
379
  - spec/support/fixtures/documents_orders_none.json
380
+ - spec/support/fixtures/edm_transmissions/create.json
381
+ - spec/support/fixtures/edm_transmissions/show.json
378
382
  - spec/support/fixtures/error.json
379
383
  - spec/support/fixtures/esign_templates.json
380
384
  - spec/support/fixtures/invalid_order_id.json
@@ -446,6 +450,7 @@ files:
446
450
  - spec/support/fixtures/verix/record/create.json
447
451
  - spec/support/fixtures/verix/record/list.json
448
452
  - spec/support/routes/actors.rb
453
+ - spec/support/routes/edm_transmissions.rb
449
454
  - spec/support/routes/locations.rb
450
455
  - spec/support/routes/query_screenings.rb
451
456
  - spec/support/routes/screening_metadatas.rb
@@ -482,66 +487,4 @@ rubygems_version: 3.1.6
482
487
  signing_key:
483
488
  specification_version: 4
484
489
  summary: FinApps REST API ruby client.
485
- test_files:
486
- - spec/spec_helper.rb
487
- - spec/spec_helpers/api_request.rb
488
- - spec/spec_helpers/client.rb
489
- - spec/rest/query/screenings_spec.rb
490
- - spec/rest/query/base_spec.rb
491
- - spec/rest/portfolios_available_consumers_spec.rb
492
- - spec/rest/documents_orders_notifications_spec.rb
493
- - spec/rest/portfolios_alerts_spec.rb
494
- - spec/rest/version_spec.rb
495
- - spec/rest/alert_occurrences_spec.rb
496
- - spec/rest/products_spec.rb
497
- - spec/rest/operator_change_password_email_spec.rb
498
- - spec/rest/consumers_spec.rb
499
- - spec/rest/screenings_spec.rb
500
- - spec/rest/order_notifications_spec.rb
501
- - spec/rest/tenant_app_settings_spec.rb
502
- - spec/rest/order_reports_spec.rb
503
- - spec/rest/documents_uploads_spec.rb
504
- - spec/rest/operators_spec.rb
505
- - spec/rest/portfolios_spec.rb
506
- - spec/rest/locations_spec.rb
507
- - spec/rest/client_spec.rb
508
- - spec/rest/actors_spec.rb
509
- - spec/rest/documents_orders_spec.rb
510
- - spec/rest/consumer_login_tokens_spec.rb
511
- - spec/rest/documents_upload_types_spec.rb
512
- - spec/rest/tenant_settings_spec.rb
513
- - spec/rest/screening_metadatas_spec.rb
514
- - spec/rest/order_tokens_spec.rb
515
- - spec/rest/order_refreshes_spec.rb
516
- - spec/rest/operators_password_resets_spec.rb
517
- - spec/rest/order_assignments_spec.rb
518
- - spec/rest/alert_definitions_spec.rb
519
- - spec/rest/signed_documents_downloads_spec.rb
520
- - spec/rest/operators_login_tokens_spec.rb
521
- - spec/rest/verix/verix_metadata_spec.rb
522
- - spec/rest/verix/verix_records_spec.rb
523
- - spec/rest/verix/verix_pdf_documents_spec.rb
524
- - spec/rest/verix/verix_documents_spec.rb
525
- - spec/rest/password_resets_spec.rb
526
- - spec/rest/plaid/plaid_webhooks_spec.rb
527
- - spec/rest/plaid/plaid_account_permissions_spec.rb
528
- - spec/rest/plaid/plaid_institution_logos_spec.rb
529
- - spec/rest/plaid/plaid_accounts_spec.rb
530
- - spec/rest/plaid/plaid_consumer_institutions_spec.rb
531
- - spec/rest/states_spec.rb
532
- - spec/rest/esign_templates_spec.rb
533
- - spec/rest/portfolios_consumers_spec.rb
534
- - spec/rest/order_statuses_spec.rb
535
- - spec/rest/portfolio_reports_spec.rb
536
- - spec/rest/sessions_spec.rb
537
- - spec/rest/consumers_portfolios_spec.rb
538
- - spec/rest/orders_spec.rb
539
- - spec/utils/query_builder_spec.rb
540
- - spec/support/screenings_routes.rb
541
- - spec/support/documents_uploads_routes.rb
542
- - spec/support/routes/screening_metadatas.rb
543
- - spec/support/routes/query_screenings.rb
544
- - spec/support/routes/states.rb
545
- - spec/support/routes/actors.rb
546
- - spec/support/routes/locations.rb
547
- - spec/support/fake_api.rb
490
+ test_files: []