rock_rms 4.9.0 → 4.10.0

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
  SHA1:
3
- metadata.gz: 684700567faff9b33cb3076f9f3651cc0ba7bab2
4
- data.tar.gz: 7b34856cd6b778983175450ab7d2f397244a969e
3
+ metadata.gz: 59c6c7ce7e89ee75f54b5fd9fe1e25445ccb6796
4
+ data.tar.gz: aeed9726276e0bee39fae6c8402b813809b45151
5
5
  SHA512:
6
- metadata.gz: 3ea2ecc0410841d7c4be3e164b7c6f1b59c2c4b8c352b521147e3566d1a36d5c1a0aa19168626475f0673927a2bc2495346162c1001327dfa55b87d0d9b6d62f
7
- data.tar.gz: b48d4998c1b6b6b1407ce98fc673997c0241c66f3f793384e0717080b9ec951fbe008ff4597ac9e5d49c1389d5ece10f89193ddd320837ca367307bdcc459043
6
+ metadata.gz: fedf8c74d5c7d9c8f47a391e39609c85983679a8ba9f7748113bd9031597db6aa0ad78651fa9a1c4a2780a19e1bad5fadc5966b8d2c510768ccc212bed94cadf
7
+ data.tar.gz: 5393bd71c33f08bf6ff87da0e5270a4a3e271a5cb5406359f921cf4d7ff9e7929aed5b97b4291f5e77948dda33027dd9f5e1c31ac08a007e245b380dc7b3e3f5
@@ -15,6 +15,8 @@ module RockRMS
15
15
  include RockRMS::Client::Batch
16
16
  include RockRMS::Client::Fund
17
17
  include RockRMS::Client::Campus
18
+ include RockRMS::Client::DefinedType
19
+ include RockRMS::Client::DefinedValue
18
20
  include RockRMS::Client::Gateway
19
21
  include RockRMS::Client::Group
20
22
  include RockRMS::Client::GroupMember
@@ -0,0 +1,21 @@
1
+ module RockRMS
2
+ class Client
3
+ module DefinedType
4
+ def list_defined_types(options = {})
5
+ Response::DefinedType.format(
6
+ get(defined_types_path, options)
7
+ )
8
+ end
9
+
10
+ def find_defined_type(id)
11
+ Response::DefinedType.format(get(defined_types_path(id)))
12
+ end
13
+
14
+ private
15
+
16
+ def defined_types_path
17
+ 'DefinedTypes'.freeze
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,32 @@
1
+ module RockRMS
2
+ class Client
3
+ module DefinedValue
4
+ def list_defined_values(options = {})
5
+ Response::DefinedValue.format(
6
+ get(defined_values_path, options)
7
+ )
8
+ end
9
+
10
+ def create_defined_value(defined_type_id:, value:, description:, order: nil, active: false)
11
+ order ||= Random.rand(100..1000)
12
+
13
+ options = {
14
+ 'Value' => value,
15
+ 'Description' => description,
16
+ 'Order' => order,
17
+ 'IsSystem' => false,
18
+ 'DefinedTypeId' => defined_type_id,
19
+ 'IsActive' => active
20
+ }
21
+
22
+ post(defined_values_path, options)
23
+ end
24
+
25
+ private
26
+
27
+ def defined_values_path
28
+ 'DefinedValues'.freeze
29
+ end
30
+ end
31
+ end
32
+ end
@@ -35,13 +35,14 @@ module RockRMS
35
35
  )
36
36
  end
37
37
 
38
- def create_person(first_name:, last_name:, email:)
38
+ def create_person(first_name:, last_name:, email:, connection_status_value_id: nil)
39
39
  options = {
40
40
  'IsSystem' => false,
41
41
  'FirstName' => first_name,
42
42
  'LastName' => last_name,
43
43
  'Email' => email,
44
- 'Gender' => 1
44
+ 'Gender' => 1,
45
+ 'ConnectionStatusValueId' => connection_status_value_id
45
46
  }
46
47
  post(people_path, options)
47
48
  end
@@ -3,30 +3,17 @@ module RockRMS
3
3
  module RefundReason
4
4
  def list_refund_reasons(options = {})
5
5
  options['$filter'] = 'DefinedTypeId eq 37' unless options.keys.include?('$filter')
6
-
7
- Response::DefinedValue.format(
8
- get(defined_values_path, options)
9
- )
6
+ list_defined_values(options)
10
7
  end
11
8
 
12
- def create_refund_reason(value:, description:, order: nil, active: nil)
13
- order ||= Random.rand(100..1000)
14
-
15
- options = {
16
- 'Value' => value,
17
- 'Description' => description,
18
- 'Order' => order,
19
- 'IsSystem' => false,
20
- 'DefinedTypeId' => 37
21
- }
22
- options['IsActive'] = active if active
23
- post(defined_values_path, options)
24
- end
25
-
26
- private
27
-
28
- def defined_values_path
29
- 'DefinedValues'
9
+ def create_refund_reason(value:, description:, order: nil, active: false)
10
+ create_defined_value(
11
+ value: value,
12
+ description: description,
13
+ order: order,
14
+ active: active,
15
+ defined_type_id: 37
16
+ )
30
17
  end
31
18
  end
32
19
  end
@@ -0,0 +1,20 @@
1
+ module RockRMS
2
+ module Response
3
+ class DefinedType < Base
4
+ MAP = {
5
+ id: 'Id',
6
+ name: 'Name',
7
+ description: 'Description',
8
+ defined_values: 'DefinedValues',
9
+ order: 'Order',
10
+ value: 'Value',
11
+ }.freeze
12
+
13
+ def format_single(data)
14
+ response = to_h(MAP, data)
15
+ response[:defined_values] = DefinedValue.format(response[:defined_values])
16
+ response
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '4.9.0'.freeze
2
+ VERSION = '4.10.0'.freeze
3
3
  end
@@ -47,6 +47,7 @@ RSpec.describe RockRMS::Client::RefundReason, type: :model do
47
47
  'Order' => 500,
48
48
  'Description' => "Very Very not Happy",
49
49
  'Value' => "Angry Donor",
50
+ 'IsActive' => false
50
51
  )
51
52
  .and_call_original
52
53
  resource
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: 4.9.0
4
+ version: 4.10.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-11-07 00:00:00.000000000 Z
11
+ date: 2018-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -189,6 +189,8 @@ files:
189
189
  - lib/rock_rms/resources/attribute_value.rb
190
190
  - lib/rock_rms/resources/batch.rb
191
191
  - lib/rock_rms/resources/campus.rb
192
+ - lib/rock_rms/resources/defined_type.rb
193
+ - lib/rock_rms/resources/defined_value.rb
192
194
  - lib/rock_rms/resources/fund.rb
193
195
  - lib/rock_rms/resources/gateway.rb
194
196
  - lib/rock_rms/resources/group.rb
@@ -211,6 +213,7 @@ files:
211
213
  - lib/rock_rms/response/base.rb
212
214
  - lib/rock_rms/response/batch.rb
213
215
  - lib/rock_rms/response/campus.rb
216
+ - lib/rock_rms/response/defined_type.rb
214
217
  - lib/rock_rms/response/defined_value.rb
215
218
  - lib/rock_rms/response/fund.rb
216
219
  - lib/rock_rms/response/gateway.rb