finapps 5.0.35 → 5.0.36

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: 4756aafb56941b9eaf0609a1aa07d9eae9b3485e70a10bf1ab7590cc973654d1
4
- data.tar.gz: 0e55b4ed791fc263027a21b6193ca025778e983fb0742006111b9fc1c5d88e4d
3
+ metadata.gz: d502756b01180a324db1ab9e232bd71810d1e9f950bcaf9f47df667c3bd2d7ed
4
+ data.tar.gz: b1a9723d9944b250ff1d57917e66c903647929b3161ecb718dde62b9804f7d36
5
5
  SHA512:
6
- metadata.gz: 90031e4f43d5a3fda8f4f3f2df53e7ecb8a5e27ab53830f79aaf80ab981b293b8890ad3e2bf8a31ebc210dcaf37f29fbcc1442fb139ee463b465243223381393
7
- data.tar.gz: 56d79d89f1a40e4ee1fff5b58ad8e49f762375c7ea6a4911a3e149004272eba89fe3e6348653a49f75a2bf1cd6a1f41ef4e8c20af6857c0e75af76c818b88467
6
+ metadata.gz: 643b7f796405c8d6d06f2f414098b23f4295627702c03d119599827f8977866c8ffc8f62ab7b60330ae679ef35be0247440d16f938686c75f1426be3fec3a068
7
+ data.tar.gz: cb58c991c8b188221f9900d057e03d2394eaa7baaf712edf4f1f029a722436afe2e424e4562176778e00d294d9ebaac609ab7d578d57110162889e5b56a9ed2a
@@ -10,6 +10,7 @@ AllCops:
10
10
  - "vendor/**/*"
11
11
  - "bin/**/*"
12
12
  CacheRootDirectory: tmp
13
+ NewCops: enable
13
14
 
14
15
  Layout/SpaceAroundMethodCallOperator:
15
16
  Enabled: true
@@ -69,6 +70,8 @@ Naming/PredicateName:
69
70
 
70
71
  RSpec/FilePath:
71
72
  Enabled: false
73
+ Gemspec/RequiredRubyVersion:
74
+ Enabled: false
72
75
 
73
76
  Style/RedundantRegexpCharacterClass:
74
77
  Enabled: true
@@ -150,6 +153,10 @@ Style/RedundantFetchBlock:
150
153
  Enabled: true
151
154
  Style/SlicingWithRange:
152
155
  Enabled: true
156
+ Style/OptionalBooleanParameter:
157
+ Enabled: false
158
+ Style/StringConcatenation:
159
+ Enabled: false
153
160
 
154
161
  RSpec/NestedGroups:
155
162
  Max: 5
@@ -17,7 +17,7 @@ Metrics/BlockLength:
17
17
  # Configuration parameters: CountComments.
18
18
  # fake_api.rb - leaving as is intentionally
19
19
  Metrics/ClassLength:
20
- Max: 431
20
+ Max: 442
21
21
 
22
22
  # Offense count: 5
23
23
  # Configuration parameters: Max.
@@ -1,3 +1,12 @@
1
+ ## [5.0.36] - 2020-08-05
2
+
3
+ ### Changed
4
+ * Add upload endpoints to support dashboard ([#309][i309])
5
+
6
+ [i309]: https://github.com/finapps/tenant-dashboard-react/issues/309
7
+
8
+ [5.0.36]: https://github.com/finapps/ruby-client/compare/5.0.35...5.0.36
9
+
1
10
  ## [5.0.35] - 2020-07-09
2
11
 
3
12
  ### Changed
@@ -30,7 +30,9 @@ require 'finapps/rest/portfolios_consumers'
30
30
  require 'finapps/rest/consumers_portfolios'
31
31
  require 'finapps/rest/portfolio_reports'
32
32
  require 'finapps/rest/documents_orders'
33
+ require 'finapps/rest/documents_uploads'
33
34
  require 'finapps/rest/esign_templates'
35
+ require 'finapps/rest/documents_upload_types'
34
36
  require 'finapps/rest/signed_documents_downloads'
35
37
  require 'finapps/rest/documents_orders_notifications'
36
38
 
@@ -13,6 +13,8 @@ module FinApps
13
13
  consumers_portfolios
14
14
  documents_orders
15
15
  documents_orders_notifications
16
+ documents_upload_types
17
+ documents_uploads
16
18
  esign_templates
17
19
  orders
18
20
  order_assignments
@@ -33,7 +33,7 @@ module FinApps
33
33
 
34
34
  def destroy(id)
35
35
  not_blank(id, :order_id)
36
- super(id, "documents/orders/#{id}")
36
+ super(nil, "documents/orders/#{id}")
37
37
  end
38
38
 
39
39
  def show_signing_url(order_id, signature_id)
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class DocumentsUploadTypes < FinAppsCore::REST::Resources
6
+ def list
7
+ super('documents/upload_types')
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class DocumentsUploads < FinAppsCore::REST::Resources
6
+ def show(consumer_id, doc_id, thumbnail = false)
7
+ not_blank(consumer_id, :consumer_id)
8
+ not_blank(doc_id, :doc_id)
9
+
10
+ path =
11
+ "consumers/#{ERB::Util.url_encode(consumer_id)}/"\
12
+ "documents/#{ERB::Util.url_encode(doc_id)}?thumbnail=#{thumbnail}"
13
+ super(nil, path)
14
+ end
15
+
16
+ def destroy(order_id, doc_id)
17
+ not_blank(order_id, :order_id)
18
+ not_blank(doc_id, :doc_id)
19
+ super(nil, "documents/orders/#{order_id}/#{doc_id}")
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '5.0.35'
4
+ VERSION = '5.0.36'
5
5
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+ require 'rest/api_request'
5
+
6
+ RSpec.describe FinApps::REST::DocumentsUploadTypes do
7
+ include SpecHelpers::Client
8
+ subject(:upload_types) { described_class.new(client).list }
9
+
10
+ let(:results) { upload_types[0] }
11
+
12
+ describe '#list' do
13
+ context 'when called' do
14
+ it_behaves_like 'an API request'
15
+ it_behaves_like 'a successful request'
16
+ it('performs a get and returns the response') do
17
+ expect(results[0]).to have_key(:type)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,104 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+ require 'rest/api_request'
5
+
6
+ RSpec.describe FinApps::REST::DocumentsUploads do
7
+ include SpecHelpers::Client
8
+
9
+ describe '#show' do
10
+ let(:upload) { described_class.new(client) }
11
+
12
+ context 'when missing doc id' do
13
+ subject(:show) { upload.show(:consumer_id, nil) }
14
+
15
+ it 'raises an error' do
16
+ expect { show }.to raise_error(FinAppsCore::MissingArgumentsError)
17
+ end
18
+ end
19
+
20
+ context 'when missing consumer id' do
21
+ subject(:show) { upload.show(nil, :doc_id) }
22
+
23
+ it 'raises an error' do
24
+ expect { show }.to raise_error(FinAppsCore::MissingArgumentsError)
25
+ end
26
+ end
27
+
28
+ context 'when thumbnail is not included' do
29
+ subject(:show) do
30
+ upload.show(
31
+ :consumer_id,
32
+ :doc_id
33
+ )
34
+ end
35
+
36
+ it_behaves_like 'an API request'
37
+ it_behaves_like 'a successful request'
38
+ end
39
+
40
+ context 'when thumbnail is included' do
41
+ subject(:show) do
42
+ upload.show(
43
+ :consumer_id,
44
+ :doc_id,
45
+ true
46
+ )
47
+ end
48
+
49
+ it_behaves_like 'an API request'
50
+ it_behaves_like 'a successful request'
51
+ end
52
+ end
53
+
54
+ describe '#destroy' do
55
+ subject(:destroy) { described_class.new(client).destroy(order_id, doc_id) }
56
+
57
+ let(:results) { destroy[0] }
58
+ let(:error_messages) { destroy[1] }
59
+
60
+ context 'with valid id' do
61
+ let(:order_id) { :valid_order_id }
62
+ let(:doc_id) { :valid_doc_id }
63
+
64
+ it_behaves_like 'an API request'
65
+ it_behaves_like 'a successful request'
66
+ it('results is nil') { expect(results).to be_nil }
67
+ end
68
+
69
+ context 'with invalid order id' do
70
+ let(:order_id) { :invalid_order_id }
71
+ let(:doc_id) { :valid_doc_id }
72
+
73
+ it_behaves_like 'an API request'
74
+ it('results is nil') { expect(results).to be_nil }
75
+
76
+ it('error messages array is populated') do
77
+ expect(error_messages.first.downcase).to eq('resource not found')
78
+ end
79
+ end
80
+
81
+ context 'with invalid doc id' do
82
+ let(:order_id) { :valid_order_id }
83
+ let(:doc_id) { :invalid_doc_id }
84
+
85
+ it_behaves_like 'an API request'
86
+ it('results is nil') { expect(results).to be_nil }
87
+
88
+ it('error messages array is populated') do
89
+ expect(error_messages.first.downcase).to eq('resource not found')
90
+ end
91
+ end
92
+
93
+ context 'with missing id' do
94
+ let(:order_id) { nil }
95
+ let(:doc_id) { nil }
96
+
97
+ it do
98
+ expect { destroy }.to raise_error(
99
+ FinAppsCore::MissingArgumentsError
100
+ )
101
+ end
102
+ end
103
+ end
104
+ end
@@ -251,6 +251,18 @@ class FakeApi < Sinatra::Base
251
251
  json_response 404, 'invalid_signature_id.json'
252
252
  end
253
253
 
254
+ # documents_uploads
255
+ get("/#{version}/consumers/:consumer_id/documents/:doc_id?thumbnail=false") do
256
+ pdf_response 'signed_document.pdf'
257
+ end
258
+ delete("/#{version}/documents/orders/valid_order_id/valid_doc_id") { status 204 }
259
+ delete("/#{version}/documents/orders/valid_order_id/invalid_doc_id") do
260
+ json_response 404, 'resource_not_found.json'
261
+ end
262
+ delete("/#{version}/documents/orders/invalid_order_id/valid_doc_id") do
263
+ json_response 404, 'resource_not_found.json'
264
+ end
265
+
254
266
  # documents orders notifications
255
267
  post("/#{version}/documents/orders/valid_id/notify") { status 204 }
256
268
  post("/#{version}/documents/orders/invalid_id/notify") do
@@ -265,6 +277,9 @@ class FakeApi < Sinatra::Base
265
277
  # esign_templates
266
278
  get("/#{version}/esign_templates") { json_response 200, 'esign_templates.json' }
267
279
 
280
+ # document_upload_types
281
+ get("/#{version}/documents/upload_types") { json_response 200, 'upload_types.json' }
282
+
268
283
  # consumers
269
284
  get("/#{version}/consumers") do
270
285
  json_response 200, 'users.json'
@@ -0,0 +1,9 @@
1
+ [
2
+ {
3
+ "acceptable_forms": "string",
4
+ "id": "string",
5
+ "name": "string",
6
+ "special_instructions": "string",
7
+ "type": 1
8
+ }
9
+ ]
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.35
4
+ version: 5.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2020-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -306,6 +306,8 @@ files:
306
306
  - lib/finapps/rest/consumers_portfolios.rb
307
307
  - lib/finapps/rest/documents_orders.rb
308
308
  - lib/finapps/rest/documents_orders_notifications.rb
309
+ - lib/finapps/rest/documents_upload_types.rb
310
+ - lib/finapps/rest/documents_uploads.rb
309
311
  - lib/finapps/rest/esign_templates.rb
310
312
  - lib/finapps/rest/operators.rb
311
313
  - lib/finapps/rest/operators_password_resets.rb
@@ -349,6 +351,8 @@ files:
349
351
  - spec/rest/consumers_spec.rb
350
352
  - spec/rest/documents_orders_notifications_spec.rb
351
353
  - spec/rest/documents_orders_spec.rb
354
+ - spec/rest/documents_upload_types_spec.rb
355
+ - spec/rest/documents_uploads_spec.rb
352
356
  - spec/rest/esign_templates_spec.rb
353
357
  - spec/rest/operators_password_resets_spec.rb
354
358
  - spec/rest/operators_spec.rb
@@ -436,6 +440,7 @@ files:
436
440
  - spec/support/fixtures/tenant_app_settings.json
437
441
  - spec/support/fixtures/tenant_settings.json
438
442
  - spec/support/fixtures/unauthorized.json
443
+ - spec/support/fixtures/upload_types.json
439
444
  - spec/support/fixtures/user.json
440
445
  - spec/support/fixtures/users.json
441
446
  - spec/support/fixtures/verix/document/document.pdf
@@ -506,6 +511,7 @@ test_files:
506
511
  - spec/rest/verix/verix_records_spec.rb
507
512
  - spec/rest/verix/verix_documents_spec.rb
508
513
  - spec/rest/verix/verix_pdf_documents_spec.rb
514
+ - spec/rest/documents_uploads_spec.rb
509
515
  - spec/rest/signed_documents_downloads_spec.rb
510
516
  - spec/rest/password_resets_spec.rb
511
517
  - spec/rest/portfolio_reports_spec.rb
@@ -516,6 +522,7 @@ test_files:
516
522
  - spec/rest/plaid/plaid_account_permissions_spec.rb
517
523
  - spec/rest/consumers_portfolios_spec.rb
518
524
  - spec/rest/documents_orders_spec.rb
525
+ - spec/rest/documents_upload_types_spec.rb
519
526
  - spec/rest/alert_occurrences_spec.rb
520
527
  - spec/rest/tenant_settings_spec.rb
521
528
  - spec/rest/orders_spec.rb