rock_rms 8.4.0 → 8.5.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/resources/group_member.rb +16 -0
- data/lib/rock_rms/response/group_member.rb +22 -0
- data/lib/rock_rms/response/person.rb +1 -0
- data/lib/rock_rms/version.rb +1 -1
- data/spec/rock_rms/resources/group_member_spec.rb +51 -0
- data/spec/support/fixtures/create_known_relationship.json +1 -0
- data/spec/support/fixtures/group_members.json +186 -0
- data/spec/support/rock_mock.rb +2 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19e99238273531c1c5f3be2e95cb7d10d3b5c025043a11157e10ae7f01b984a5
|
4
|
+
data.tar.gz: 4d5e4758dac63b7174305d2ed3d576b60e298c30d4f5b07f7a90b5bb2d76841a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60ae0f673bad03a9a86eab352448a176b7ad8b48fd63c7d48a4571f7fdd14fda6b402ca06e0de9bd8c97960877b9bafab570f2bcd02b081e6205c81ec84d0b15
|
7
|
+
data.tar.gz: 3cec7a048167ec96a7fa20033a28c768056eca3ec940ec8ef5e491fd1852cba804abbf93004a39bef26ad418e7f18d7321c7befe72bbfe6028b8c16a699dae16
|
@@ -15,10 +15,26 @@ module RockRMS
|
|
15
15
|
)
|
16
16
|
end
|
17
17
|
|
18
|
+
def list_group_members(options = {})
|
19
|
+
Response::GroupMember.format(
|
20
|
+
get(group_member_path, options)
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
18
24
|
def delete_group_member(id)
|
19
25
|
delete(group_member_path(id))
|
20
26
|
end
|
21
27
|
|
28
|
+
def create_known_relationship(person_id:, related_person_id:, relationship_role_id:)
|
29
|
+
url_params = {
|
30
|
+
personId: person_id,
|
31
|
+
relatedPersonId: related_person_id,
|
32
|
+
relationshipRoleId: relationship_role_id
|
33
|
+
}
|
34
|
+
|
35
|
+
post("GroupMembers/KnownRelationship?#{URI.encode_www_form(url_params)}")
|
36
|
+
end
|
37
|
+
|
22
38
|
private
|
23
39
|
|
24
40
|
def group_member_path(id = nil)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module RockRMS
|
2
|
+
module Response
|
3
|
+
class GroupMember < Base
|
4
|
+
MAP = {
|
5
|
+
person: 'Person',
|
6
|
+
group_id: 'GroupId',
|
7
|
+
}.freeze
|
8
|
+
|
9
|
+
def format_single(data)
|
10
|
+
response = to_h(MAP, data)
|
11
|
+
response[:person] = format_person(response[:person])
|
12
|
+
response
|
13
|
+
end
|
14
|
+
|
15
|
+
def format_person(res)
|
16
|
+
return res if res.nil?
|
17
|
+
Person.format(res)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/rock_rms/version.rb
CHANGED
@@ -3,6 +3,18 @@ require 'spec_helper'
|
|
3
3
|
RSpec.describe RockRMS::Client::GroupMember, type: :model do
|
4
4
|
include_context 'resource specs'
|
5
5
|
|
6
|
+
describe '#list_group_members' do
|
7
|
+
it 'returns a array' do
|
8
|
+
resource = client.list_group_members
|
9
|
+
|
10
|
+
expect(resource).to be_a(Array)
|
11
|
+
expect(resource.first).to be_a(Hash)
|
12
|
+
expect(resource.first).to include(:group_id)
|
13
|
+
expect(resource.first[:person]).to include(:id)
|
14
|
+
expect(resource.first[:person]).to include(:email)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
6
18
|
describe '#create_group_member' do
|
7
19
|
context 'arguments' do
|
8
20
|
it 'require `group_id`' do
|
@@ -63,4 +75,43 @@ RSpec.describe RockRMS::Client::GroupMember, type: :model do
|
|
63
75
|
client.delete_group_member(123)
|
64
76
|
end
|
65
77
|
end
|
78
|
+
|
79
|
+
describe '#create_known_relationship' do
|
80
|
+
context 'arguments' do
|
81
|
+
it 'require `person_id`' do
|
82
|
+
expect { client.create_known_relationship }
|
83
|
+
.to raise_error(ArgumentError, /person_id/)
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'require `related_person_id`' do
|
87
|
+
expect { client.create_known_relationship }
|
88
|
+
.to raise_error(ArgumentError, /related_person_id/)
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'require `relationship_role_id`' do
|
92
|
+
expect { client.create_known_relationship }
|
93
|
+
.to raise_error(ArgumentError, /relationship_role_id/)
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
subject(:resource) do
|
99
|
+
client.create_known_relationship(
|
100
|
+
person_id: 123,
|
101
|
+
relationship_role_id: 1,
|
102
|
+
related_person_id: 456,
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'returns integer' do
|
107
|
+
expect(resource).to be_a(Integer)
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'passes options' do
|
111
|
+
expect(client).to receive(:post)
|
112
|
+
.with('GroupMembers/KnownRelationship?personId=123&relatedPersonId=456&relationshipRoleId=1').and_call_original
|
113
|
+
resource
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
66
117
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
12345
|
@@ -0,0 +1,186 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"Person": {
|
4
|
+
"IsSystem": true,
|
5
|
+
"RecordTypeValueId": 1,
|
6
|
+
"RecordStatusValueId": 3,
|
7
|
+
"RecordStatusLastModifiedDateTime": null,
|
8
|
+
"RecordStatusReasonValueId": null,
|
9
|
+
"ConnectionStatusValueId": 66,
|
10
|
+
"ReviewReasonValueId": null,
|
11
|
+
"IsDeceased": false,
|
12
|
+
"TitleValueId": null,
|
13
|
+
"FirstName": "Alisha",
|
14
|
+
"NickName": "Alisha",
|
15
|
+
"MiddleName": "",
|
16
|
+
"LastName": "Admin",
|
17
|
+
"SuffixValueId": null,
|
18
|
+
"PhotoId": 417,
|
19
|
+
"BirthDay": 11,
|
20
|
+
"BirthMonth": 4,
|
21
|
+
"BirthYear": 2006,
|
22
|
+
"Gender": 0,
|
23
|
+
"MaritalStatusValueId": null,
|
24
|
+
"AnniversaryDate": null,
|
25
|
+
"GraduationYear": null,
|
26
|
+
"GivingId": "P1",
|
27
|
+
"GivingLeaderId": 1,
|
28
|
+
"Email": "admin@organization.com",
|
29
|
+
"IsEmailActive": false,
|
30
|
+
"EmailNote": null,
|
31
|
+
"EmailPreference": 0,
|
32
|
+
"CommunicationPreference": 1,
|
33
|
+
"ReviewReasonNote": null,
|
34
|
+
"InactiveReasonNote": "",
|
35
|
+
"SystemNote": null,
|
36
|
+
"ViewedCount": null,
|
37
|
+
"TopSignalColor": null,
|
38
|
+
"TopSignalIconCssClass": null,
|
39
|
+
"TopSignalId": null,
|
40
|
+
"AgeClassification": 1,
|
41
|
+
"PrimaryFamilyId": 23,
|
42
|
+
"PrimaryCampusId": 1,
|
43
|
+
"IsLockedAsChild": false,
|
44
|
+
"DeceasedDate": null,
|
45
|
+
"ContributionFinancialAccountId": null,
|
46
|
+
"AccountProtectionProfile": 3,
|
47
|
+
"PreferredLanguageValueId": null,
|
48
|
+
"ReminderCount": null,
|
49
|
+
"RaceValueId": null,
|
50
|
+
"EthnicityValueId": null,
|
51
|
+
"DaysUntilBirthday": 0,
|
52
|
+
"GivingGroupId": null,
|
53
|
+
"BirthDate": "2006-04-11T00:00:00",
|
54
|
+
"DaysUntilAnniversary": null,
|
55
|
+
"CreatedDateTime": null,
|
56
|
+
"ModifiedDateTime": "2023-04-11T14:08:24.297",
|
57
|
+
"CreatedByPersonAliasId": null,
|
58
|
+
"ModifiedByPersonAliasId": 10,
|
59
|
+
"Id": 1,
|
60
|
+
"Guid": "ad28da19-4af1-408f-9090-2672f8376f27",
|
61
|
+
"ForeignId": null,
|
62
|
+
"ForeignGuid": null,
|
63
|
+
"ForeignKey": null
|
64
|
+
},
|
65
|
+
"IsSystem": false,
|
66
|
+
"GroupId": 2,
|
67
|
+
"GroupTypeId": 1,
|
68
|
+
"PersonId": 1,
|
69
|
+
"GroupRoleId": 1,
|
70
|
+
"Note": null,
|
71
|
+
"GroupMemberStatus": 1,
|
72
|
+
"GuestCount": null,
|
73
|
+
"DateTimeAdded": null,
|
74
|
+
"IsNotified": false,
|
75
|
+
"GroupOrder": null,
|
76
|
+
"InactiveDateTime": null,
|
77
|
+
"IsArchived": false,
|
78
|
+
"ArchivedDateTime": null,
|
79
|
+
"ArchivedByPersonAliasId": null,
|
80
|
+
"ScheduleTemplateId": null,
|
81
|
+
"ScheduleStartDate": null,
|
82
|
+
"ScheduleReminderEmailOffsetDays": null,
|
83
|
+
"CommunicationPreference": 0,
|
84
|
+
"CreatedDateTime": null,
|
85
|
+
"ModifiedDateTime": null,
|
86
|
+
"CreatedByPersonAliasId": null,
|
87
|
+
"ModifiedByPersonAliasId": null,
|
88
|
+
"Id": 3,
|
89
|
+
"Guid": "6f23caca-6749-4454-85df-5a55251b644c",
|
90
|
+
"ForeignId": null,
|
91
|
+
"ForeignGuid": null,
|
92
|
+
"ForeignKey": null
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"Person": {
|
96
|
+
"IsSystem": true,
|
97
|
+
"RecordTypeValueId": 1,
|
98
|
+
"RecordStatusValueId": 3,
|
99
|
+
"RecordStatusLastModifiedDateTime": null,
|
100
|
+
"RecordStatusReasonValueId": null,
|
101
|
+
"ConnectionStatusValueId": 66,
|
102
|
+
"ReviewReasonValueId": null,
|
103
|
+
"IsDeceased": false,
|
104
|
+
"TitleValueId": null,
|
105
|
+
"FirstName": "Alisha",
|
106
|
+
"NickName": "Alisha",
|
107
|
+
"MiddleName": "",
|
108
|
+
"LastName": "Admin",
|
109
|
+
"SuffixValueId": null,
|
110
|
+
"PhotoId": 417,
|
111
|
+
"BirthDay": 11,
|
112
|
+
"BirthMonth": 4,
|
113
|
+
"BirthYear": 2006,
|
114
|
+
"Gender": 0,
|
115
|
+
"MaritalStatusValueId": null,
|
116
|
+
"AnniversaryDate": null,
|
117
|
+
"GraduationYear": null,
|
118
|
+
"GivingId": "P1",
|
119
|
+
"GivingLeaderId": 1,
|
120
|
+
"Email": "admin@organization.com",
|
121
|
+
"IsEmailActive": false,
|
122
|
+
"EmailNote": null,
|
123
|
+
"EmailPreference": 0,
|
124
|
+
"CommunicationPreference": 1,
|
125
|
+
"ReviewReasonNote": null,
|
126
|
+
"InactiveReasonNote": "",
|
127
|
+
"SystemNote": null,
|
128
|
+
"ViewedCount": null,
|
129
|
+
"TopSignalColor": null,
|
130
|
+
"TopSignalIconCssClass": null,
|
131
|
+
"TopSignalId": null,
|
132
|
+
"AgeClassification": 1,
|
133
|
+
"PrimaryFamilyId": 23,
|
134
|
+
"PrimaryCampusId": 1,
|
135
|
+
"IsLockedAsChild": false,
|
136
|
+
"DeceasedDate": null,
|
137
|
+
"ContributionFinancialAccountId": null,
|
138
|
+
"AccountProtectionProfile": 3,
|
139
|
+
"PreferredLanguageValueId": null,
|
140
|
+
"ReminderCount": null,
|
141
|
+
"RaceValueId": null,
|
142
|
+
"EthnicityValueId": null,
|
143
|
+
"DaysUntilBirthday": 0,
|
144
|
+
"GivingGroupId": null,
|
145
|
+
"BirthDate": "2006-04-11T00:00:00",
|
146
|
+
"DaysUntilAnniversary": null,
|
147
|
+
"CreatedDateTime": null,
|
148
|
+
"ModifiedDateTime": "2023-04-11T14:08:24.297",
|
149
|
+
"CreatedByPersonAliasId": null,
|
150
|
+
"ModifiedByPersonAliasId": 10,
|
151
|
+
"Id": 1,
|
152
|
+
"Guid": "ad28da19-4af1-408f-9090-2672f8376f27",
|
153
|
+
"ForeignId": null,
|
154
|
+
"ForeignGuid": null,
|
155
|
+
"ForeignKey": null
|
156
|
+
},
|
157
|
+
"IsSystem": false,
|
158
|
+
"GroupId": 21,
|
159
|
+
"GroupTypeId": 11,
|
160
|
+
"PersonId": 1,
|
161
|
+
"GroupRoleId": 5,
|
162
|
+
"Note": null,
|
163
|
+
"GroupMemberStatus": 1,
|
164
|
+
"GuestCount": null,
|
165
|
+
"DateTimeAdded": null,
|
166
|
+
"IsNotified": false,
|
167
|
+
"GroupOrder": null,
|
168
|
+
"InactiveDateTime": null,
|
169
|
+
"IsArchived": false,
|
170
|
+
"ArchivedDateTime": null,
|
171
|
+
"ArchivedByPersonAliasId": null,
|
172
|
+
"ScheduleTemplateId": null,
|
173
|
+
"ScheduleStartDate": null,
|
174
|
+
"ScheduleReminderEmailOffsetDays": null,
|
175
|
+
"CommunicationPreference": 0,
|
176
|
+
"CreatedDateTime": null,
|
177
|
+
"ModifiedDateTime": null,
|
178
|
+
"CreatedByPersonAliasId": null,
|
179
|
+
"ModifiedByPersonAliasId": null,
|
180
|
+
"Id": 4,
|
181
|
+
"Guid": "cf41a302-d249-44d5-85b2-aeee05c96c8a",
|
182
|
+
"ForeignId": null,
|
183
|
+
"ForeignGuid": null,
|
184
|
+
"ForeignKey": null
|
185
|
+
}
|
186
|
+
]
|
data/spec/support/rock_mock.rb
CHANGED
@@ -31,6 +31,7 @@ class RockMock < Sinatra::Base
|
|
31
31
|
families: 'Groups/GetFamilies/:id',
|
32
32
|
gateways: 'FinancialGateways',
|
33
33
|
group: 'Groups/:id',
|
34
|
+
group_members: 'GroupMembers',
|
34
35
|
groups: 'Groups',
|
35
36
|
payment_details: 'FinancialPaymentDetails',
|
36
37
|
people_search: 'People/Search',
|
@@ -58,6 +59,7 @@ class RockMock < Sinatra::Base
|
|
58
59
|
create_attribute: 'Attributes',
|
59
60
|
create_attribute_value: 'AttributeValues',
|
60
61
|
create_group_member: 'GroupMembers',
|
62
|
+
create_known_relationship: 'GroupMembers/KnownRelationship',
|
61
63
|
create_transaction: 'FinancialTransactions',
|
62
64
|
create_payment_detail: 'FinancialPaymentDetails',
|
63
65
|
create_phone_number: 'PhoneNumbers',
|
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: 8.
|
4
|
+
version: 8.5.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: 2023-04-
|
11
|
+
date: 2023-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -249,6 +249,7 @@ files:
|
|
249
249
|
- lib/rock_rms/response/gateway.rb
|
250
250
|
- lib/rock_rms/response/group.rb
|
251
251
|
- lib/rock_rms/response/group_location.rb
|
252
|
+
- lib/rock_rms/response/group_member.rb
|
252
253
|
- lib/rock_rms/response/history.rb
|
253
254
|
- lib/rock_rms/response/location.rb
|
254
255
|
- lib/rock_rms/response/page.rb
|
@@ -323,6 +324,7 @@ files:
|
|
323
324
|
- spec/support/fixtures/create_attribute_value.json
|
324
325
|
- spec/support/fixtures/create_batch.json
|
325
326
|
- spec/support/fixtures/create_group_member.json
|
327
|
+
- spec/support/fixtures/create_known_relationship.json
|
326
328
|
- spec/support/fixtures/create_payment_detail.json
|
327
329
|
- spec/support/fixtures/create_phone_number.json
|
328
330
|
- spec/support/fixtures/create_recurring_donation.json
|
@@ -337,6 +339,7 @@ files:
|
|
337
339
|
- spec/support/fixtures/gateways.json
|
338
340
|
- spec/support/fixtures/group.json
|
339
341
|
- spec/support/fixtures/group_locations.json
|
342
|
+
- spec/support/fixtures/group_members.json
|
340
343
|
- spec/support/fixtures/groups.json
|
341
344
|
- spec/support/fixtures/groups_with_campus.json
|
342
345
|
- spec/support/fixtures/groups_with_locations.json
|