rock_rms 5.17.0 → 6.0.1

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: df26d487a46f16ed4ffee2e08f0c94cb482def5621391da71e4035e0c8970f5b
4
- data.tar.gz: a3009d3a5bb708c3cb7660330178f56689da6a18feb1ecad557a8926c284cd4d
3
+ metadata.gz: d62174e5f930871eb31adf696902a1d2ce038aea33439609d0c1a62fa5db5163
4
+ data.tar.gz: 68b82d19df797b7f65f7b86c4465653f7702bda8ecfba54a5100aec5ca318d17
5
5
  SHA512:
6
- metadata.gz: 84e72ec3e948e5215416692cd9b64371b58b35c0876d81fc338ab0ba5c6128de4feb67096e640b02735e5c7b1b3a5437c2f20831b69f863955306dcf99fefa76
7
- data.tar.gz: 492ca825e2e53cee2c5686e1ad73d86521e833ccb12cf2476842ce8e7f630860965a520af4ebd55dfddb8a445238a42993401d42e7956ba345334524f169c2fb
6
+ metadata.gz: 9776eaeb73263e684ccdb9f58fef16a92f2d17b1ae7f54f4f55df4026c0789346fcbf043e6c6757238130b6b61dc7bcdffbf02c26abc7442045581915e51d79f
7
+ data.tar.gz: 81bcc9e6cb711b4aef9627e0097c9067c080978eb182dd86edb399ba461be700ff8c3bc8901872e89020cd30c8698421b46822497b4e79c9f0e52194c7d5aa63
@@ -1,5 +1,6 @@
1
1
  module RockRMS
2
2
  class Error < StandardError; end
3
+ class BadGateway < Error; end
3
4
  class BadRequest < Error; end
4
5
  class Forbidden < Error; end
5
6
  class GatewayTimeout < Error; end
@@ -26,6 +27,8 @@ module FaradayMiddleware
26
27
  raise RockRMS::NotFound, error_message(env)
27
28
  when 500
28
29
  raise RockRMS::InternalServerError, error_message(env)
30
+ when 502
31
+ raise RockRMS::BadGateway, error_message(env)
29
32
  when 503
30
33
  raise RockRMS::ServiceUnavailable, error_message(env)
31
34
  when 504
@@ -6,6 +6,11 @@ module RockRMS
6
6
  Response::Fund.format(res)
7
7
  end
8
8
 
9
+ def find_fund(id)
10
+ res = get(fund_path(id))
11
+ Response::Fund.format(res)
12
+ end
13
+
9
14
  private
10
15
 
11
16
  def fund_path(id = nil)
@@ -16,15 +16,17 @@ module RockRMS
16
16
  fund_id: nil,
17
17
  amount: nil,
18
18
  fee_amount: nil,
19
+ fee_coverage_amount: nil,
19
20
  entity_type_id: nil,
20
21
  entity_id: nil
21
22
  )
22
23
  options = {}
23
- options['AccountId'] = fund_id if fund_id
24
- options['Amount'] = amount if amount
25
- options['FeeAmount'] = fee_amount if fee_amount
26
- options['EntityTypeId'] = entity_type_id if entity_type_id
27
- options['EntityId'] = entity_id if entity_id
24
+ options['AccountId'] = fund_id if fund_id
25
+ options['Amount'] = amount if amount
26
+ options['FeeAmount'] = fee_amount if fee_amount
27
+ options['FeeCoverageAmount'] = fee_amount if fee_amount
28
+ options['EntityTypeId'] = entity_type_id if entity_type_id
29
+ options['EntityId'] = entity_id if entity_id
28
30
 
29
31
  patch(transaction_detail_path(id), options)
30
32
  end
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '5.17.0'.freeze
2
+ VERSION = '6.0.1'.freeze
3
3
  end
@@ -34,24 +34,49 @@ RSpec.describe RockRMS::Client::TransactionDetail, type: :model do
34
34
  end
35
35
 
36
36
  describe '#update_transaction_detail' do
37
- subject(:resource) do
38
- client.update_transaction_detail(
39
- 123,
40
- fund_id: 2,
41
- )
42
- end
37
+ context 'simple' do
38
+ subject(:resource) do
39
+ client.update_transaction_detail(
40
+ 123,
41
+ fund_id: 2,
42
+ )
43
+ end
44
+
45
+ it 'returns nothing' do
46
+ expect(client.update_transaction_detail(123, fund_id: 5)).to eq(nil)
47
+ end
43
48
 
44
- it 'returns nothing' do
45
- expect(client.update_transaction_detail(123, fund_id: 5)).to eq(nil)
49
+ it 'passes options' do
50
+ expect(client).to receive(:patch)
51
+ .with(
52
+ 'FinancialTransactionDetails/123',
53
+ 'AccountId' => 2
54
+ ).and_call_original
55
+ resource
56
+ end
46
57
  end
47
58
 
48
- it 'passes options' do
49
- expect(client).to receive(:patch)
50
- .with(
51
- 'FinancialTransactionDetails/123',
52
- 'AccountId' => 2
53
- ).and_call_original
54
- resource
59
+ context 'complex' do
60
+ subject(:resource) do
61
+ client.update_transaction_detail(
62
+ 123,
63
+ fund_id: 2,
64
+ fee_amount: 50,
65
+ fee_coverage_amount: 50
66
+ )
67
+ end
68
+
69
+ it 'passes options' do
70
+ expect(client).to receive(:patch)
71
+ .with(
72
+ 'FinancialTransactionDetails/123',
73
+ 'FeeAmount' => 50,
74
+ 'FeeCoverageAmount' => 50,
75
+ 'AccountId' => 2
76
+ ).and_call_original
77
+ resource
78
+ end
55
79
  end
80
+
56
81
  end
57
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.17.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-31 00:00:00.000000000 Z
11
+ date: 2022-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday