finapps 5.0.27 → 5.0.28

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: 4b8b7de9d5fc2e4ae26d24d98d1a08c6b55bf195814f86b98b9f570fde651053
4
- data.tar.gz: 1ae33a3b696c405a8a6f1f1ee03f7cbdd1f96d5b3979ab8d51b01226da722f23
3
+ metadata.gz: 41554740a84b37ce897625f30b710b515eac8cc50f8979b5ff7adc626db5c67c
4
+ data.tar.gz: be701ec37e56af740acdd2a22d4234b1c6108637393527d8dec406d733b46742
5
5
  SHA512:
6
- metadata.gz: dcd6e21e5d4341304a6b1ab6482d18dbaf6cd66f2a3d4a642885a0f0aafb0549a59139fcf6bbbaf751b1e74cd19b290bd7c9b63ff0a44f51710c5e2ed731370f
7
- data.tar.gz: 8d2f9526699c782b00238335043df2eb599125f1a5858aca887df2ae34980d5150025ec61a574d3b41d88e030ab424cbd883665206c894d88eaa60a799918c5b
6
+ metadata.gz: 18d3595335d174560dac98c8c559d954a66e745a84ce8d921b727d7381b6bbe92091e162733f851110e78524069469f5a82420fc6636aaef951b4192c8f17127
7
+ data.tar.gz: 55a19cd9dda94b7e250506833843932542e7f79bbd229161f8b5adc37d07e9403ba30d7f7e229da0da5f0605c065aa3525ad2f0d0e5e660951f5b57bae52c0a1
data/RELEASES.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [5.0.28] - 2020-02-19
2
+
3
+ ### Added
4
+ * Verix document endpoints ([#217][i217])
5
+
6
+ [i217]: https://github.com/finapps/ruby-client/issues/217
7
+
1
8
  ## [5.0.27] - 2020-02-11
2
9
 
3
10
  ### Changed
data/lib/finapps.rb CHANGED
@@ -19,7 +19,6 @@ require 'finapps/rest/products'
19
19
  require 'finapps/rest/order_assignments'
20
20
  require 'finapps/rest/client'
21
21
  require 'finapps/rest/order_refreshes'
22
- require 'finapps/rest/statements'
23
22
  require 'finapps/rest/tenant_settings'
24
23
  require 'finapps/rest/tenant_app_settings'
25
24
  require 'finapps/rest/portfolios'
@@ -40,6 +39,8 @@ require 'finapps/rest/plaid/plaid_institution_logos'
40
39
 
41
40
  require 'finapps/rest/verix/verix_metadata'
42
41
  require 'finapps/rest/verix/verix_records'
42
+ require 'finapps/rest/verix/verix_pdf_documents'
43
+ require 'finapps/rest/verix/verix_documents'
43
44
 
44
45
  require 'finapps/utils/query_builder'
45
46
  require 'finapps/version' unless defined?(FinApps::VERSION)
@@ -38,6 +38,8 @@ module FinApps
38
38
  plaid_institution_logos
39
39
  verix_metadata
40
40
  verix_records
41
+ verix_pdf_documents
42
+ verix_documents
41
43
  ].freeze
42
44
 
43
45
  # @param [String] tenant_token
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class VerixDocuments < FinAppsCore::REST::Resources
6
+ def list(record_id)
7
+ not_blank(record_id, :record_id)
8
+ path = "v/record/#{ERB::Util.url_encode(record_id)}/document"
9
+ super path
10
+ end
11
+
12
+ def show(record_id, document_id)
13
+ not_blank(record_id, :record_id)
14
+ not_blank(document_id, :document_id)
15
+ path =
16
+ "v/record/#{ERB::Util.url_encode(record_id)}/document/#{ERB::Util.url_encode(document_id)}"
17
+ super(nil, path)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class VerixPdfDocuments < FinAppsCore::REST::Resources # :nodoc:
6
+ def show(record_id, provider_id)
7
+ not_blank(record_id, :record_id)
8
+ not_blank(provider_id, :provider_id)
9
+ path =
10
+ "v/record/#{ERB::Util.url_encode(record_id)}/file/#{ERB::Util.url_encode(provider_id)}"
11
+ super(nil, path)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '5.0.27'
4
+ VERSION = '5.0.28'
5
5
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+ require 'rest/api_request'
5
+
6
+ RSpec.describe FinApps::REST::VerixDocuments do
7
+ include SpecHelpers::Client
8
+
9
+ let(:api_client) { client }
10
+ let(:document) { FinApps::REST::VerixDocuments.new(api_client) }
11
+
12
+ describe '#list' do
13
+ context 'when missing parameters' do
14
+ subject { document.list(nil) }
15
+ it 'raises an error when missing record id' do
16
+ expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
17
+ end
18
+ end
19
+
20
+ subject(:list) do
21
+ document.list(
22
+ :record_id
23
+ )
24
+ end
25
+ it_behaves_like 'an API request'
26
+ it_behaves_like 'a successful request'
27
+ end
28
+
29
+ describe '#show' do
30
+ context 'when missing parameters' do
31
+ subject { document.show(nil, :document_id) }
32
+ it 'raises an error when missing record id' do
33
+ expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
34
+ end
35
+
36
+ subject { document.show(:record_id, nil) }
37
+ it 'raises an error when missing document id' do
38
+ expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
39
+ end
40
+ end
41
+
42
+ subject(:show) do
43
+ document.show(
44
+ :record_id,
45
+ :document_id
46
+ )
47
+ end
48
+
49
+ it_behaves_like 'an API request'
50
+ it_behaves_like 'a successful request'
51
+ end
52
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+ require 'rest/api_request'
5
+
6
+ RSpec.describe FinApps::REST::VerixPdfDocuments do
7
+ include SpecHelpers::Client
8
+
9
+ let(:api_client) { client }
10
+ let(:document) { FinApps::REST::VerixPdfDocuments.new(api_client) }
11
+
12
+ describe '#show' do
13
+ context 'when missing parameters' do
14
+ subject { document.show(nil, :provider_id) }
15
+ it 'raises an error when missing record id' do
16
+ expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
17
+ end
18
+
19
+ subject { document.show(:record_id, nil) }
20
+ it 'raises an error when missing provider id' do
21
+ expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError)
22
+ end
23
+ end
24
+
25
+ subject(:show) do
26
+ document.show(
27
+ :record_id,
28
+ :provider_id
29
+ )
30
+ end
31
+
32
+ it_behaves_like 'an API request'
33
+ it_behaves_like 'a successful request'
34
+ end
35
+ end
@@ -12,10 +12,7 @@ RSpec.describe FinApps::REST::VerixRecords do
12
12
  describe '#create' do
13
13
  subject(:create) do
14
14
  FinApps::REST::VerixRecords.new(api_client).create(
15
- code: 'authcode',
16
- download: [
17
- 'form_1040'
18
- ]
15
+ code: 'authcode'
19
16
  )
20
17
  end
21
18
 
@@ -26,11 +23,7 @@ RSpec.describe FinApps::REST::VerixRecords do
26
23
  it('returns a status') { expect(create[RESULTS]).to have_key(:status) }
27
24
  it('returns an error node') { expect(create[RESULTS]).to have_key(:error) }
28
25
  it('returns a list of documents') { expect(create[RESULTS]).to have_key(:documents) }
29
- it('returns a document count') { expect(create[RESULTS][:documents].first).to have_key(:count) }
30
- it('returns a document date sycned node') { expect(create[RESULTS][:documents].first).to have_key(:date_synced) }
31
- it('returns a document id') { expect(create[RESULTS][:documents].first).to have_key(:document_id) }
32
- it('returns a document downloaded bool') { expect(create[RESULTS][:documents].first).to have_key(:downloaded) }
33
- it('returns a document type') { expect(create[RESULTS][:documents].first).to have_key(:type) }
26
+ it('returns a list of downloaded documents') { expect(create[RESULTS]).to have_key(:downloaded_documents) }
34
27
  end
35
28
 
36
29
  describe '#list' do
@@ -44,10 +37,6 @@ RSpec.describe FinApps::REST::VerixRecords do
44
37
  it('returns a consumer id') { expect(list[RESULTS].first).to have_key(:consumer_id) }
45
38
  it('returns an error node') { expect(list[RESULTS].first).to have_key(:error) }
46
39
  it('returns a list of documents') { expect(list[RESULTS].first).to have_key(:documents) }
47
- it('returns a document type') { expect(list[RESULTS].first[:documents].first).to have_key(:type) }
48
- it('returns a document id') { expect(list[RESULTS].first[:documents].first).to have_key(:document_id) }
49
- it('returns a document count') { expect(list[RESULTS].first[:documents].first).to have_key(:count) }
50
- it('returns a document downloaded bool') { expect(list[RESULTS].first[:documents].first).to have_key(:downloaded) }
51
- it('returns a document date_synced') { expect(list[RESULTS].first[:documents].first).to have_key(:date_synced) }
40
+ it('returns a list of downloaded documents') { expect(list[RESULTS].first).to have_key(:downloaded_documents) }
52
41
  end
53
42
  end
@@ -28,6 +28,19 @@ class FakeApi < Sinatra::Base
28
28
  json_response 200, 'verix/record/create.json'
29
29
  end
30
30
 
31
+ # verix_pdf_documents
32
+ get("/#{version}/v/record/:record_id/file/:provider_id") do
33
+ pdf_response 'verix/document/document.pdf'
34
+ end
35
+
36
+ # verix_documents
37
+ get("/#{version}/v/record/:record_id/document") do
38
+ json_response 200, 'verix/document/show.json'
39
+ end
40
+ get("/#{version}/v/record/:record_id/document/:document_id") do
41
+ json_response 200, 'verix/document/list.json'
42
+ end
43
+
31
44
  # plaid_webhook/metadata
32
45
  get("/#{version}/p/metadata") do
33
46
  tenant_token = request.env['HTTP_X_TENANT_TOKEN']
@@ -224,14 +237,6 @@ class FakeApi < Sinatra::Base
224
237
  end
225
238
  post("/#{version}/logout") { status 204 }
226
239
 
227
- # accounts
228
- get("/#{version}/accounts/valid_id/statement/valid_id") do
229
- json_response 200, 'fake_pdf_statement.json'
230
- end
231
- get("/#{version}/accounts/invalid_id/statement/valid_id") do
232
- json_response 404, 'resource_not_found.json'
233
- end
234
-
235
240
  # operators
236
241
  get("/#{version}/operators") { json_response 200, 'operator_list.json' }
237
242
  get("/#{version}/operators/invalid_id") do
@@ -427,6 +432,10 @@ class FakeApi < Sinatra::Base
427
432
  http_response :png, 200, file_name
428
433
  end
429
434
 
435
+ def pdf_response(file_name)
436
+ http_response 'application/pdf', 200, file_name
437
+ end
438
+
430
439
  def http_response(content_type, response_code, file_name)
431
440
  content_type content_type
432
441
  status response_code
@@ -0,0 +1,36 @@
1
+ [
2
+ {
3
+ "_id": "5e4c44a5b778c00001a81277",
4
+ "consumer_id": "1f50bddc-4cbf-4e16-6782-a2295d695d4e",
5
+ "date_synced": "2020-02-18T20:10:13.469Z",
6
+ "document": {
7
+ "form_type": "schedule_d",
8
+ "id": 34790,
9
+ "net_long_term_gain_loss": 1275,
10
+ "net_short_term_gain_loss": 2,
11
+ "tax_period_ends_at": "2017-12-31"
12
+ },
13
+ "document_id": "5e4c44a5b778c00001a81277",
14
+ "record_id": "5e4c44a46c20ec0001e3a505",
15
+ "tax_period_ends_at": "2017-12-31",
16
+ "tenant_id": "4dd607b1-565f-4da4-722c-2e84c5c87f43",
17
+ "type": "schedule_d"
18
+ },
19
+ {
20
+ "_id": "5e4c44a5b778c00001a81278",
21
+ "consumer_id": "1f50bddc-4cbf-4e16-6782-a2295d695d4e",
22
+ "date_synced": "2020-02-18T20:10:13.469Z",
23
+ "document": {
24
+ "form_type": "schedule_d",
25
+ "id": 34793,
26
+ "net_long_term_gain_loss": 5816,
27
+ "net_short_term_gain_loss": 0,
28
+ "tax_period_ends_at": "2018-12-31"
29
+ },
30
+ "document_id": "5e4c44a5b778c00001a81278",
31
+ "record_id": "5e4c44a46c20ec0001e3a505",
32
+ "tax_period_ends_at": "2018-12-31",
33
+ "tenant_id": "4dd607b1-565f-4da4-722c-2e84c5c87f43",
34
+ "type": "schedule_d"
35
+ }
36
+ ]
@@ -0,0 +1,35 @@
1
+ {
2
+ "_id": "5e4c44a5b778c00001a81275",
3
+ "consumer_id": "1f50bddc-4cbf-4e16-6782-a2295d695d4e",
4
+ "date_synced": "2020-02-18T20:10:13.245Z",
5
+ "document": {
6
+ "adjusted_gross_income": "",
7
+ "adjusted_gross_income_per_computer": "",
8
+ "business_income_or_loss_schedule_c": 0,
9
+ "farm_income_or_loss_schedule_f": 0,
10
+ "filer": {
11
+ "name": "BEN SMIT",
12
+ "ssn": "XXX-XX-5890"
13
+ },
14
+ "filing_status": "Married Filing Jointly",
15
+ "form_type": "1040",
16
+ "id": 34789,
17
+ "ordinary_dividend_income": 934,
18
+ "other_income": 0,
19
+ "qualified_dividends": 671,
20
+ "refunds_of_state_local_taxes": 287,
21
+ "rent_royalty_partnership_estate_schedule_e": 63561,
22
+ "tax_period_ends_at": "2017-12-31",
23
+ "taxable_social_security_benefits": 0,
24
+ "total_income": 297045,
25
+ "total_income_per_computer": 297045,
26
+ "total_social_security_benefits": 0,
27
+ "unemployment_compensation": 0,
28
+ "wages_salaries_tips_etc": 230681
29
+ },
30
+ "document_id": "5e4c44a5b778c00001a81275",
31
+ "record_id": "5e4c44a46c20ec0001e3a505",
32
+ "tax_period_ends_at": "2017-12-31",
33
+ "tenant_id": "4dd607b1-565f-4da4-722c-2e84c5c87f43",
34
+ "type": "form_1040"
35
+ }
@@ -1,17 +1,25 @@
1
- {
2
- "_id": "string",
3
- "consumer_id": "string",
4
- "date_exchanged": "2019-12-17T14:50:00Z",
5
- "date_modified": "2019-12-17T14:50:00Z",
6
- "documents": [
7
- {
8
- "count": 0,
9
- "date_synced": "2019-12-17T14:50:00Z",
10
- "document_id": "string",
11
- "downloaded": true,
12
- "type": "string"
13
- }
14
- ],
15
- "error": "string",
16
- "status": 0
17
- }
1
+
2
+ {
3
+ "_id": "string",
4
+ "consumer_id": "string",
5
+ "date_exchanged": "2020-02-19T14:13:34Z",
6
+ "date_modified": "2020-02-19T14:13:34Z",
7
+ "documents": [
8
+ {
9
+ "date_synced": "2020-02-19T14:13:34Z",
10
+ "document_id": "string",
11
+ "tax_period_ends_at": "string",
12
+ "type": "string"
13
+ }
14
+ ],
15
+ "downloaded_documents": [
16
+ {
17
+ "provider_id": 0,
18
+ "successful": true,
19
+ "tax_period_ends_at": "string",
20
+ "type": "string"
21
+ }
22
+ ],
23
+ "error": "string",
24
+ "status": 0
25
+ }
@@ -1,81 +1,157 @@
1
1
  [
2
2
  {
3
- "_id": "5df7eadbfe13f5000148ca0e",
4
- "consumer_id": "594625b4-e8fe-40b7-422f-f758bb877ae7",
3
+ "_id": "5e4c44a46c20ec0001e3a505",
4
+ "consumer_id": "1f50bddc-4cbf-4e16-6782-a2295d695d4e",
5
5
  "status": 2,
6
6
  "error": "",
7
- "date_exchanged": "2019-12-16T20:36:43.342Z",
8
- "date_modified": "2019-12-16T20:36:45.59Z",
7
+ "date_exchanged": "2020-02-18T20:10:12.887Z",
8
+ "date_modified": "2020-02-18T20:10:16.321Z",
9
9
  "documents": [
10
10
  {
11
11
  "type": "form_1040",
12
- "document_id": "5df7eadbc496df0001e9daa0",
13
- "count": 2,
14
- "downloaded": false,
15
- "date_synced": "2019-12-16T20:36:43.537Z"
12
+ "document_id": "5e4c44a5b778c00001a81275",
13
+ "tax_period_ends_at": "2017-12-31",
14
+ "date_synced": "2020-02-18T20:10:13.245Z"
16
15
  },
17
16
  {
18
- "type": "schedule_c",
19
- "document_id": "5df7eadbc496df0001e9daa1",
20
- "count": 0,
21
- "downloaded": false,
22
- "date_synced": "2019-12-16T20:36:43.613Z"
17
+ "type": "form_1040",
18
+ "document_id": "5e4c44a5b778c00001a81276",
19
+ "tax_period_ends_at": "2018-12-31",
20
+ "date_synced": "2020-02-18T20:10:13.245Z"
23
21
  },
24
22
  {
25
23
  "type": "schedule_d",
26
- "document_id": "5df7eadbc496df0001e9daa2",
27
- "count": 2,
28
- "downloaded": false,
29
- "date_synced": "2019-12-16T20:36:43.676Z"
24
+ "document_id": "5e4c44a5b778c00001a81277",
25
+ "tax_period_ends_at": "2017-12-31",
26
+ "date_synced": "2020-02-18T20:10:13.469Z"
27
+ },
28
+ {
29
+ "type": "schedule_d",
30
+ "document_id": "5e4c44a5b778c00001a81278",
31
+ "tax_period_ends_at": "2018-12-31",
32
+ "date_synced": "2020-02-18T20:10:13.469Z"
33
+ },
34
+ {
35
+ "type": "schedule_e",
36
+ "document_id": "5e4c44a5b778c00001a81279",
37
+ "tax_period_ends_at": "2017-12-31",
38
+ "date_synced": "2020-02-18T20:10:13.7Z"
30
39
  },
31
40
  {
32
41
  "type": "schedule_e",
33
- "document_id": "5df7eadbc496df0001e9daa3",
34
- "count": 2,
35
- "downloaded": false,
36
- "date_synced": "2019-12-16T20:36:43.737Z"
42
+ "document_id": "5e4c44a5b778c00001a8127a",
43
+ "tax_period_ends_at": "2018-12-31",
44
+ "date_synced": "2020-02-18T20:10:13.7Z"
37
45
  },
38
46
  {
39
47
  "type": "schedule_k1_form_1065",
40
- "document_id": "5df7eadbc496df0001e9daa4",
41
- "count": 1,
42
- "downloaded": false,
43
- "date_synced": "2019-12-16T20:36:43.807Z"
48
+ "document_id": "5e4c44a5b778c00001a8127b",
49
+ "tax_period_ends_at": "2017-12-31",
50
+ "date_synced": "2020-02-18T20:10:13.78Z"
51
+ },
52
+ {
53
+ "type": "schedule_k1_form_1120s",
54
+ "document_id": "5e4c44a5b778c00001a8127c",
55
+ "tax_period_ends_at": "2017-12-31",
56
+ "date_synced": "2020-02-18T20:10:13.881Z"
44
57
  },
45
58
  {
46
59
  "type": "schedule_k1_form_1120s",
47
- "document_id": "5df7eadbc496df0001e9daa5",
48
- "count": 2,
49
- "downloaded": false,
50
- "date_synced": "2019-12-16T20:36:43.912Z"
60
+ "document_id": "5e4c44a5b778c00001a8127d",
61
+ "tax_period_ends_at": "2018-12-31",
62
+ "date_synced": "2020-02-18T20:10:13.881Z"
51
63
  },
52
64
  {
53
65
  "type": "form_w2",
54
- "document_id": "5df7eadcc496df0001e9daa6",
55
- "count": 1,
56
- "downloaded": false,
57
- "date_synced": "2019-12-16T20:36:44.015Z"
66
+ "document_id": "5e4c44a5b778c00001a8127e",
67
+ "tax_period_ends_at": "2017-12-31",
68
+ "date_synced": "2020-02-18T20:10:13.972Z"
58
69
  },
59
70
  {
60
71
  "type": "form_1099_div",
61
- "document_id": "5df7eaddc496df0001e9daa9",
62
- "count": 4,
63
- "downloaded": false,
64
- "date_synced": "2019-12-16T20:36:45.441Z"
72
+ "document_id": "5e4c44a6b778c00001a8127f",
73
+ "tax_period_ends_at": "2017-12-31",
74
+ "date_synced": "2020-02-18T20:10:14.082Z"
75
+ },
76
+ {
77
+ "type": "form_1099_div",
78
+ "document_id": "5e4c44a6b778c00001a81280",
79
+ "tax_period_ends_at": "2017-12-31",
80
+ "date_synced": "2020-02-18T20:10:14.082Z"
81
+ },
82
+ {
83
+ "type": "form_1099_div",
84
+ "document_id": "5e4c44a6b778c00001a81281",
85
+ "tax_period_ends_at": "2018-12-31",
86
+ "date_synced": "2020-02-18T20:10:14.082Z"
87
+ },
88
+ {
89
+ "type": "form_1099_div",
90
+ "document_id": "5e4c44a6b778c00001a81282",
91
+ "tax_period_ends_at": "2018-12-31",
92
+ "date_synced": "2020-02-18T20:10:14.082Z"
65
93
  },
66
94
  {
67
95
  "type": "form_1099_int",
68
- "document_id": "5df7eaddc496df0001e9daaa",
69
- "count": 2,
70
- "downloaded": false,
71
- "date_synced": "2019-12-16T20:36:45.501Z"
96
+ "document_id": "5e4c44a6b778c00001a81283",
97
+ "tax_period_ends_at": "2017-12-31",
98
+ "date_synced": "2020-02-18T20:10:14.223Z"
99
+ },
100
+ {
101
+ "type": "form_1099_int",
102
+ "document_id": "5e4c44a6b778c00001a81284",
103
+ "tax_period_ends_at": "2018-12-31",
104
+ "date_synced": "2020-02-18T20:10:14.223Z"
105
+ },
106
+ {
107
+ "type": "form_5498",
108
+ "document_id": "5e4c44a6b778c00001a81285",
109
+ "tax_period_ends_at": "2017-12-31",
110
+ "date_synced": "2020-02-18T20:10:14.34Z"
72
111
  },
73
112
  {
74
113
  "type": "form_5498",
75
- "document_id": "5df7eaddc496df0001e9daab",
76
- "count": 4,
77
- "downloaded": false,
78
- "date_synced": "2019-12-16T20:36:45.587Z"
114
+ "document_id": "5e4c44a6b778c00001a81286",
115
+ "tax_period_ends_at": "2017-12-31",
116
+ "date_synced": "2020-02-18T20:10:14.34Z"
117
+ },
118
+ {
119
+ "type": "form_5498",
120
+ "document_id": "5e4c44a6b778c00001a81287",
121
+ "tax_period_ends_at": "2017-12-31",
122
+ "date_synced": "2020-02-18T20:10:14.34Z"
123
+ },
124
+ {
125
+ "type": "form_5498",
126
+ "document_id": "5e4c44a6b778c00001a81288",
127
+ "tax_period_ends_at": "2017-12-31",
128
+ "date_synced": "2020-02-18T20:10:14.34Z"
129
+ }
130
+ ],
131
+ "downloaded_documents": [
132
+ {
133
+ "provider_id": 7661,
134
+ "type": "tax_return",
135
+ "tax_period_ends_at": "2017-12-31",
136
+ "successful": false
137
+ },
138
+ {
139
+ "provider_id": 7662,
140
+ "type": "tax_return",
141
+ "tax_period_ends_at": "2018-12-31",
142
+ "successful": false
143
+ },
144
+ {
145
+ "provider_id": 7663,
146
+ "type": "wage_and_income",
147
+ "tax_period_ends_at": "2017-12-31",
148
+ "successful": false
149
+ },
150
+ {
151
+ "provider_id": 7664,
152
+ "type": "wage_and_income",
153
+ "tax_period_ends_at": "2018-12-31",
154
+ "successful": false
79
155
  }
80
156
  ]
81
157
  }
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.27
4
+ version: 5.0.28
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-02-11 00:00:00.000000000 Z
11
+ date: 2020-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -325,10 +325,11 @@ files:
325
325
  - lib/finapps/rest/portfolios_consumers.rb
326
326
  - lib/finapps/rest/products.rb
327
327
  - lib/finapps/rest/sessions.rb
328
- - lib/finapps/rest/statements.rb
329
328
  - lib/finapps/rest/tenant_app_settings.rb
330
329
  - lib/finapps/rest/tenant_settings.rb
330
+ - lib/finapps/rest/verix/verix_documents.rb
331
331
  - lib/finapps/rest/verix/verix_metadata.rb
332
+ - lib/finapps/rest/verix/verix_pdf_documents.rb
332
333
  - lib/finapps/rest/verix/verix_records.rb
333
334
  - lib/finapps/rest/version.rb
334
335
  - lib/finapps/utils/query_builder.rb
@@ -362,10 +363,11 @@ files:
362
363
  - spec/rest/portfolios_spec.rb
363
364
  - spec/rest/products_spec.rb
364
365
  - spec/rest/sessions_spec.rb
365
- - spec/rest/statements_spec.rb
366
366
  - spec/rest/tenant_app_settings_spec.rb
367
367
  - spec/rest/tenant_settings_spec.rb
368
+ - spec/rest/verix/verix_documents_spec.rb
368
369
  - spec/rest/verix/verix_metadata_spec.rb
370
+ - spec/rest/verix/verix_pdf_documents_spec.rb
369
371
  - spec/rest/verix/verix_records_spec.rb
370
372
  - spec/rest/version_spec.rb
371
373
  - spec/spec_helper.rb
@@ -375,7 +377,6 @@ files:
375
377
  - spec/support/fixtures/alert_definitions.json
376
378
  - spec/support/fixtures/alert_occurrences.json
377
379
  - spec/support/fixtures/error.json
378
- - spec/support/fixtures/fake_pdf_statement.json
379
380
  - spec/support/fixtures/invalid_request_body.json
380
381
  - spec/support/fixtures/invalid_tenant_credentials.json
381
382
  - spec/support/fixtures/invalid_user_id.json
@@ -419,6 +420,9 @@ files:
419
420
  - spec/support/fixtures/unauthorized.json
420
421
  - spec/support/fixtures/user.json
421
422
  - spec/support/fixtures/users.json
423
+ - spec/support/fixtures/verix/document/document.pdf
424
+ - spec/support/fixtures/verix/document/list.json
425
+ - spec/support/fixtures/verix/document/show.json
422
426
  - spec/support/fixtures/verix/metadata.json
423
427
  - spec/support/fixtures/verix/record/create.json
424
428
  - spec/support/fixtures/verix/record/list.json
@@ -459,7 +463,6 @@ test_files:
459
463
  - spec/rest/operators_password_resets_spec.rb
460
464
  - spec/rest/portfolios_available_consumers_spec.rb
461
465
  - spec/rest/products_spec.rb
462
- - spec/rest/statements_spec.rb
463
466
  - spec/rest/alert_definitions_spec.rb
464
467
  - spec/rest/version_spec.rb
465
468
  - spec/rest/consumers_spec.rb
@@ -468,7 +471,9 @@ test_files:
468
471
  - spec/rest/tenant_app_settings_spec.rb
469
472
  - spec/rest/operators_spec.rb
470
473
  - spec/rest/verix/verix_records_spec.rb
474
+ - spec/rest/verix/verix_documents_spec.rb
471
475
  - spec/rest/verix/verix_metadata_spec.rb
476
+ - spec/rest/verix/verix_pdf_documents_spec.rb
472
477
  - spec/rest/client_spec.rb
473
478
  - spec/rest/tenant_settings_spec.rb
474
479
  - spec/rest/api_request.rb
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class Statements < FinAppsCore::REST::Resources
6
- def show(account_id, document_id)
7
- not_blank(account_id, :account_id)
8
- not_blank(document_id, :document_id)
9
-
10
- path =
11
- "accounts/#{ERB::Util.url_encode(account_id)}/statement/#{ERB::Util.url_encode(document_id)}"
12
- super nil, path
13
- end
14
- end
15
- end
16
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helpers/client'
4
-
5
- RSpec.describe FinApps::REST::Statements do
6
- include SpecHelpers::Client
7
- subject { FinApps::REST::Statements.new(client) }
8
-
9
- describe '#show' do
10
- context 'when missing account_id' do
11
- let(:show) { subject.show(nil, 'valid_id') }
12
- it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
13
- end
14
-
15
- context 'when missing document_id' do
16
- let(:show) { subject.show('valid_id', nil) }
17
- it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
18
- end
19
-
20
- context 'when valid ids are provided' do
21
- let(:show) { subject.show('valid_id', 'valid_id') }
22
- it { expect { show }.not_to raise_error }
23
- it('returns an array') { expect(show).to be_a(Array) }
24
- it('performs a get and returns the response') do
25
- expect(show[RESULTS]).to have_key(:data)
26
- end
27
- it('returns no error messages') do
28
- expect(show[ERROR_MESSAGES]).to be_empty
29
- end
30
- end
31
-
32
- context 'when invalid ids are provided' do
33
- let(:show) { subject.show('invalid_id', 'valid_id') }
34
- it { expect { show }.not_to raise_error }
35
- it('returns an array') { expect(show).to be_a(Array) }
36
- it('results is nil') { expect(show[RESULTS]).to be_nil }
37
- it('error messages array is populated') do
38
- expect(show[ERROR_MESSAGES].first.downcase).to eq('resource not found')
39
- end
40
- end
41
- end
42
- end
@@ -1,3 +0,0 @@
1
- {
2
- "data": "pdf data here"
3
- }