rock_rms 3.2.0 → 3.4.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 +4 -4
- data/lib/rock_rms/client.rb +1 -0
- data/lib/rock_rms/resources/batch.rb +2 -1
- data/lib/rock_rms/resources/campus.rb +16 -0
- data/lib/rock_rms/response/batch.rb +8 -1
- data/lib/rock_rms/version.rb +1 -1
- data/spec/rock_rms/resources/batch_spec.rb +2 -0
- data/spec/rock_rms/resources/campus_spec.rb +27 -0
- data/spec/support/fixtures/batch.json +1 -1
- data/spec/support/fixtures/batches.json +1 -1
- data/spec/support/fixtures/campus.json +21 -0
- data/spec/support/rock_mock.rb +1 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cea1c7188cb9f0611e98f27122b16c6ff12f6760
|
|
4
|
+
data.tar.gz: b56617dd53c3067e44f381425b013b0846eca94e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af3f37cbcca2633b648555e811751399814587e160593cdb5d2af903c42ff8608491871f7e100f45e9557a1a54ec286bbf2d4a212de6278b7d2d238358c11f2d
|
|
7
|
+
data.tar.gz: '08cf5c1f2c891b06c870c1a8c7baecaa1c2ebe795e51a0b4ebc488c93c94634025cb53c47d61e7da384777e990fd3e24708c2762ee2e1d7a174595e5ecab3d60'
|
data/lib/rock_rms/client.rb
CHANGED
|
@@ -11,10 +11,11 @@ module RockRMS
|
|
|
11
11
|
Response::Batch.format(res)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def create_batch(name:, start_time:, end_time:, foreign_key: nil)
|
|
14
|
+
def create_batch(name:, start_time:, end_time:, foreign_key: nil, campus_id: nil)
|
|
15
15
|
options = {
|
|
16
16
|
'Name' => name,
|
|
17
17
|
'BatchStartDateTime' => start_time,
|
|
18
|
+
'CampusId' => campus_id,
|
|
18
19
|
'BatchEndDateTime' => end_time,
|
|
19
20
|
'ForeignKey' => foreign_key
|
|
20
21
|
}
|
|
@@ -5,13 +5,20 @@ module RockRMS
|
|
|
5
5
|
id: 'Id',
|
|
6
6
|
name: 'Name',
|
|
7
7
|
control_amount: 'ControlAmount',
|
|
8
|
-
transactions: 'Transactions'
|
|
8
|
+
transactions: 'Transactions',
|
|
9
|
+
start_date: 'BatchStartDateTime',
|
|
10
|
+
end_date: 'BatchEndDateTime',
|
|
11
|
+
campus_id: 'CampusId',
|
|
12
|
+
is_campus: 'Campus',
|
|
13
|
+
status: 'Status',
|
|
9
14
|
}.freeze
|
|
10
15
|
|
|
11
16
|
def format_single(data)
|
|
12
17
|
response = to_h(MAP, data)
|
|
13
18
|
response[:transactions] = Transaction.format(response[:transactions])
|
|
14
19
|
response[:amount] = calculate_total(response[:transactions])
|
|
20
|
+
response[:start_date] = DateTime.parse(response[:start_date])
|
|
21
|
+
response[:end_date] = DateTime.parse(response[:end_date])
|
|
15
22
|
response
|
|
16
23
|
end
|
|
17
24
|
|
data/lib/rock_rms/version.rb
CHANGED
|
@@ -56,6 +56,7 @@ RSpec.describe RockRMS::Client::Batch, type: :model do
|
|
|
56
56
|
name: '1',
|
|
57
57
|
start_time: '1',
|
|
58
58
|
end_time: '1',
|
|
59
|
+
campus_id: 1,
|
|
59
60
|
foreign_key: 1
|
|
60
61
|
)
|
|
61
62
|
end
|
|
@@ -69,6 +70,7 @@ RSpec.describe RockRMS::Client::Batch, type: :model do
|
|
|
69
70
|
.with(
|
|
70
71
|
'FinancialBatches',
|
|
71
72
|
'Name' => '1',
|
|
73
|
+
'CampusId' => 1,
|
|
72
74
|
'BatchStartDateTime' => '1',
|
|
73
75
|
'BatchEndDateTime' => '1',
|
|
74
76
|
'ForeignKey' => 1
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe RockRMS::Client::Campus, type: :model do
|
|
4
|
+
include_context 'resource specs'
|
|
5
|
+
|
|
6
|
+
describe '#find_campus(id)' do
|
|
7
|
+
it 'returns a hash' do
|
|
8
|
+
expect(client.find_campus(1)).to be_a(Hash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'queries campuses' do
|
|
12
|
+
expect(client).to receive(:get).with('Campuses/1').and_call_original
|
|
13
|
+
|
|
14
|
+
resource = client.find_campus(1)
|
|
15
|
+
|
|
16
|
+
expect(resource[:id]).to eq(1)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it 'formats with Campus' do
|
|
20
|
+
response = double
|
|
21
|
+
expect(RockRMS::Response::Campus).to receive(:format).with(response)
|
|
22
|
+
allow(client).to receive(:get).and_return(response)
|
|
23
|
+
client.find_campus(1)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"IsSystem": false,
|
|
3
|
+
"Name": "Campus Name",
|
|
4
|
+
"Description": "A campus description here.",
|
|
5
|
+
"IsActive": true,
|
|
6
|
+
"ShortCode": "CampusName",
|
|
7
|
+
"Url": "http://some-url.com",
|
|
8
|
+
"LocationId": 12,
|
|
9
|
+
"PhoneNumber": "1234567890",
|
|
10
|
+
"LeaderPersonAliasId": null,
|
|
11
|
+
"ServiceTimes": "Service Times Here",
|
|
12
|
+
"CreatedDateTime": null,
|
|
13
|
+
"ModifiedDateTime": "2017-07-26T14:41:58.103",
|
|
14
|
+
"CreatedByPersonAliasId": null,
|
|
15
|
+
"ModifiedByPersonAliasId": 12,
|
|
16
|
+
"Id": 1,
|
|
17
|
+
"Guid": "76882ae3",
|
|
18
|
+
"ForeignId": 1,
|
|
19
|
+
"ForeignGuid": null,
|
|
20
|
+
"ForeignKey": null
|
|
21
|
+
}
|
data/spec/support/rock_mock.rb
CHANGED
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: 3.
|
|
4
|
+
version: 3.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Taylor Brooks
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-02-
|
|
11
|
+
date: 2018-02-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -185,6 +185,7 @@ files:
|
|
|
185
185
|
- lib/rock_rms/client.rb
|
|
186
186
|
- lib/rock_rms/error.rb
|
|
187
187
|
- lib/rock_rms/resources/batch.rb
|
|
188
|
+
- lib/rock_rms/resources/campus.rb
|
|
188
189
|
- lib/rock_rms/resources/fund.rb
|
|
189
190
|
- lib/rock_rms/resources/group.rb
|
|
190
191
|
- lib/rock_rms/resources/group_member.rb
|
|
@@ -214,6 +215,7 @@ files:
|
|
|
214
215
|
- spec/rock_rms/client_spec.rb
|
|
215
216
|
- spec/rock_rms/error_spec.rb
|
|
216
217
|
- spec/rock_rms/resources/batch_spec.rb
|
|
218
|
+
- spec/rock_rms/resources/campus_spec.rb
|
|
217
219
|
- spec/rock_rms/resources/group_member_spec.rb
|
|
218
220
|
- spec/rock_rms/resources/group_spec.rb
|
|
219
221
|
- spec/rock_rms/resources/payment_method_spec.rb
|
|
@@ -239,6 +241,7 @@ files:
|
|
|
239
241
|
- spec/support/client_factory.rb
|
|
240
242
|
- spec/support/fixtures/batch.json
|
|
241
243
|
- spec/support/fixtures/batches.json
|
|
244
|
+
- spec/support/fixtures/campus.json
|
|
242
245
|
- spec/support/fixtures/campuses.json
|
|
243
246
|
- spec/support/fixtures/create_batch.json
|
|
244
247
|
- spec/support/fixtures/create_group_member.json
|