finapps 2.3.1 → 2.3.2

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
  SHA1:
3
- metadata.gz: 15436d1eee8925afbabceb89345245c7a7e6762d
4
- data.tar.gz: 309ab7eef3b89e53354db76f77871beed2287a5b
3
+ metadata.gz: 1a0a84b68f05e8ad0d5d21c0ccc3543265cee215
4
+ data.tar.gz: e024e65fba9dcbec6e9b3527d8d010d27b69dbe3
5
5
  SHA512:
6
- metadata.gz: 4c6a8b82f82769e552f9d4de7431044714a8c36c871007b95c80e86e1e7084cc10bdbac6a1118d4580cafb5071ccb5a472afd6c9fc574ade5c802501456d8ac3
7
- data.tar.gz: 4dba97dc7fcb6c4f5dcde3ce1ef4b6c894fd01885b3e07b8366a4946df01ec2e70547bd827943cbcaeb4a446314ad6872f786132e137becb217387c0fc395836
6
+ metadata.gz: '080546f143baf20e47038846ffda7873bf3a74b502c558f9b2f294867da628e7016607ecf70d4e396c80248b6977e47f8b6bf5af6709a93c54a4e7460a4efab3'
7
+ data.tar.gz: f856e092fd9732f10e174d08519b2c99f1c06de4706183e95379f67b98c9980c6d212082ae4d69f2832c4c7a6c78a82d4e25fe2442e30fa917079efe15983694
@@ -12,6 +12,7 @@ module FinApps
12
12
  orders
13
13
  order_assignments
14
14
  order_notifications
15
+ order_refreshes
15
16
  order_reports
16
17
  order_statuses
17
18
  order_tokens
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class OrderRefreshes < FinAppsCore::REST::Resources
6
+ def create(id)
7
+ not_blank(id, :id)
8
+ path = "orders/#{id}/refresh"
9
+ update nil, path
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '2.3.1'
4
+ VERSION = '2.3.2'
5
5
  end
data/lib/finapps.rb CHANGED
@@ -27,6 +27,7 @@ require 'finapps/rest/operators_password_resets'
27
27
  require 'finapps/rest/products'
28
28
  require 'finapps/rest/order_assignments'
29
29
  require 'finapps/rest/client'
30
+ require 'finapps/rest/order_refreshes'
30
31
 
31
32
  require 'finapps/utils/query_builder'
32
33
  require 'finapps/version' unless defined?(FinApps::VERSION)
@@ -46,6 +46,10 @@ RSpec.describe FinApps::REST::Client do
46
46
  it { expect(subject.order_statuses).to be_an_instance_of(FinApps::REST::OrderStatuses) }
47
47
  end
48
48
 
49
+ describe '#order_refreshes' do
50
+ it { expect(subject.order_refreshes).to be_an_instance_of(FinApps::REST::OrderRefreshes) }
51
+ end
52
+
49
53
  describe '#order_reports' do
50
54
  it { expect(subject.order_reports).to be_an_instance_of(FinApps::REST::OrderReports) }
51
55
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+
5
+ RSpec.describe FinApps::REST::OrderRefreshes do
6
+ include SpecHelpers::Client
7
+ subject { FinApps::REST::OrderRefreshes.new(client) }
8
+
9
+ describe '#create' do
10
+ context 'when missing id' do
11
+ let(:create) { subject.create(nil) }
12
+ it { expect { create }.to raise_error(FinAppsCore::MissingArgumentsError) }
13
+ end
14
+
15
+ context 'when valid id is provided' do
16
+ let(:create) { subject.create(:valid_id) }
17
+ it { expect { create }.not_to raise_error }
18
+ it('returns an array') { expect(create).to be_a(Array) }
19
+ it('performs a post and returns new refreshed order response') do
20
+ expect(create[RESULTS]).to respond_to(:public_id)
21
+ expect(create[RESULTS]).to respond_to(:original_order_id)
22
+ end
23
+ it('returns no error messages') { expect(create[ERROR_MESSAGES]).to be_empty }
24
+ end
25
+
26
+ context 'when invalid id is provided' do
27
+ let(:create) { subject.create(:invalid_id) }
28
+ it { expect { create }.not_to raise_error }
29
+ it('returns an array') { expect(create).to be_a(Array) }
30
+ it('results is nil') { expect(create[RESULTS]).to be_nil }
31
+ it('error messages array is populated') do
32
+ expect(create[ERROR_MESSAGES].first.downcase).to eq('resource not found')
33
+ end
34
+ end
35
+ end
36
+ end
@@ -27,6 +27,8 @@ class FakeApi < Sinatra::Base
27
27
  put('/v2/orders/invalid_id/cancel') { json_response 404, 'resource_not_found.json' }
28
28
  put('/v2/orders/valid_id/notify') { status 204 }
29
29
  put('/v2/orders/invalid_id/notify') { json_response 404, 'resource_not_found.json' }
30
+ put('/v2/orders/valid_id/refresh') { json_response 200, 'order_refresh.json' }
31
+ put('/v2/orders/invalid_id/refresh') { json_response 404, 'resource_not_found.json' }
30
32
  put('/v2/orders/invalid_id') { json_response 404, 'resource_not_found.json' }
31
33
  put('/v2/orders/valid_id') do
32
34
  request.body.rewind
@@ -0,0 +1,42 @@
1
+ {
2
+ "public_id": "486bafd8-dc8f-4212-70d5-dfe1d3a211fc",
3
+ "consumer_id": "f6c14d28-182a-4580-40b6-3447b10db3d2",
4
+ "applicant": {
5
+ "first_name": "Erich",
6
+ "last_name": "Quintero",
7
+ "ssn": "",
8
+ "email": "erich@financialapps.com"
9
+ },
10
+ "institutions": [
11
+ {
12
+ "name": "",
13
+ "public_id": "",
14
+ "routing_no": "",
15
+ "site_id": 0,
16
+ "accounts": [
17
+ {
18
+ "public_id": "",
19
+ "account_id": "59ea568cd47de6000b5dce71",
20
+ "name_on_account": ""
21
+ },
22
+ {
23
+ "public_id": "",
24
+ "account_id": "59ea568cd47de6000b5dce70",
25
+ "name_on_account": ""
26
+ }
27
+ ]
28
+ }
29
+ ],
30
+ "product": {
31
+ "code": "mav-o-en",
32
+ "description": "Mortgage Asset Verification",
33
+ "flow_type": 1,
34
+ "template_public_id": "e38d2f23-2f93-4e83-a64b-8d60f25e3a7a"
35
+ },
36
+ "requestor": {},
37
+ "status": 1,
38
+ "tpr_id": "5369c728ec",
39
+ "type": 1,
40
+ "original_order_id": "819f55d7-f433-40fc-7e56-27685f4f3402",
41
+ "date": "2017-10-23T15:21:41.349116765Z"
42
+ }
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: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-18 00:00:00.000000000 Z
11
+ date: 2017-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -216,6 +216,7 @@ files:
216
216
  - lib/finapps/rest/operators_password_resets.rb
217
217
  - lib/finapps/rest/order_assignments.rb
218
218
  - lib/finapps/rest/order_notifications.rb
219
+ - lib/finapps/rest/order_refreshes.rb
219
220
  - lib/finapps/rest/order_reports.rb
220
221
  - lib/finapps/rest/order_statuses.rb
221
222
  - lib/finapps/rest/order_tokens.rb
@@ -239,6 +240,7 @@ files:
239
240
  - spec/rest/operators_spec.rb
240
241
  - spec/rest/order_assignments_spec.rb
241
242
  - spec/rest/order_notifications_spec.rb
243
+ - spec/rest/order_refreshes_spec.rb
242
244
  - spec/rest/order_reports_spec.rb
243
245
  - spec/rest/order_statuses_spec.rb
244
246
  - spec/rest/order_tokens_spec.rb
@@ -266,6 +268,7 @@ files:
266
268
  - spec/support/fixtures/operator_forgot_password.json
267
269
  - spec/support/fixtures/operator_list.json
268
270
  - spec/support/fixtures/order.json
271
+ - spec/support/fixtures/order_refresh.json
269
272
  - spec/support/fixtures/order_report.json
270
273
  - spec/support/fixtures/order_status.json
271
274
  - spec/support/fixtures/order_token.json
@@ -331,6 +334,7 @@ test_files:
331
334
  - spec/rest/order_reports_spec.rb
332
335
  - spec/rest/institutions_spec.rb
333
336
  - spec/rest/order_statuses_spec.rb
337
+ - spec/rest/order_refreshes_spec.rb
334
338
  - spec/rest/order_notifications_spec.rb
335
339
  - spec/rest/order_assignments_spec.rb
336
340
  - spec/rest/sessions_spec.rb