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 +4 -4
- data/lib/rock_rms/client.rb +2 -0
- data/lib/rock_rms/resources/defined_type.rb +21 -0
- data/lib/rock_rms/resources/defined_value.rb +32 -0
- data/lib/rock_rms/resources/person.rb +3 -2
- data/lib/rock_rms/resources/refund_reason.rb +9 -22
- data/lib/rock_rms/response/defined_type.rb +20 -0
- data/lib/rock_rms/version.rb +1 -1
- data/spec/rock_rms/resources/refund_reason_spec.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: 59c6c7ce7e89ee75f54b5fd9fe1e25445ccb6796
|
4
|
+
data.tar.gz: aeed9726276e0bee39fae6c8402b813809b45151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fedf8c74d5c7d9c8f47a391e39609c85983679a8ba9f7748113bd9031597db6aa0ad78651fa9a1c4a2780a19e1bad5fadc5966b8d2c510768ccc212bed94cadf
|
7
|
+
data.tar.gz: 5393bd71c33f08bf6ff87da0e5270a4a3e271a5cb5406359f921cf4d7ff9e7929aed5b97b4291f5e77948dda33027dd9f5e1c31ac08a007e245b380dc7b3e3f5
|
data/lib/rock_rms/client.rb
CHANGED
@@ -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:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
data/lib/rock_rms/version.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: 4.
|
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
|
+
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
|