rock_rms 8.3.0 → 8.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 906157b662079a651df09467cae0cfe9fed59e0b492fe195caf4d9feb1165e75
4
- data.tar.gz: fc17a2347bf9f1b5010ffc5e168acce06f4f050c7ba564e63c3f473e2dd5a97e
3
+ metadata.gz: 19e99238273531c1c5f3be2e95cb7d10d3b5c025043a11157e10ae7f01b984a5
4
+ data.tar.gz: 4d5e4758dac63b7174305d2ed3d576b60e298c30d4f5b07f7a90b5bb2d76841a
5
5
  SHA512:
6
- metadata.gz: 1d61c2e1cd08d374a0dd0acdf59a15474a32e166d48d9a0efc6609b7fa22b7114a7db2c7786cf0fad321627cc2a8d9cf4a4642bc255f35479a9d1783239e9f00
7
- data.tar.gz: ea2852af00545801a8aa88d7c4d8c4f44fa970c81c026f5bd0b87da4158f11b9caf0ddc33b5ccf6fd742cd6bdd2ed574102b800631955ee7f592b960cd00f46b
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)
@@ -31,6 +31,27 @@ module RockRMS
31
31
  patch(transaction_detail_path(id), options)
32
32
  end
33
33
 
34
+ def create_transaction_detail(
35
+ transaction_id:,
36
+ fund_id:,
37
+ amount:,
38
+ fee_amount: nil,
39
+ fee_coverage_amount: nil,
40
+ entity_type_id: nil,
41
+ entity_id: nil
42
+ )
43
+ options = {}
44
+ options['TransactionId'] = transaction_id
45
+ options['AccountId'] = fund_id
46
+ options['Amount'] = amount
47
+ options['FeeAmount'] = fee_amount if fee_amount
48
+ options['EntityTypeId'] = entity_type_id if entity_type_id
49
+ options['EntityId'] = entity_id if entity_id
50
+ options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount
51
+
52
+ post(transaction_detail_path, options)
53
+ end
54
+
34
55
  private
35
56
 
36
57
  def transaction_detail_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
@@ -2,6 +2,7 @@ module RockRMS
2
2
  module Response
3
3
  class Person < Base
4
4
  MAP = {
5
+ id: 'Id',
5
6
  name: 'FullName',
6
7
  email: 'Email',
7
8
  first_name: 'FirstName',
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '8.3.0'.freeze
2
+ VERSION = '8.5.0'.freeze
3
3
  end
@@ -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
@@ -82,5 +82,34 @@ RSpec.describe RockRMS::Client::TransactionDetail, type: :model do
82
82
  end
83
83
  end
84
84
 
85
+ describe '#create_transaction_detail' do
86
+ context 'simple' do
87
+ subject(:resource) do
88
+ client.create_transaction_detail(
89
+ transaction_id: 123,
90
+ fund_id: 2,
91
+ amount: 5.00
92
+ )
93
+ end
94
+
95
+ it 'returns nothing' do
96
+ expect(subject).to eq(12345)
97
+ end
98
+
99
+ it 'passes options' do
100
+ expect(client).to receive(:post)
101
+ .with(
102
+ 'FinancialTransactionDetails',
103
+ {
104
+ 'AccountId' => 2,
105
+ 'Amount' => 5.00,
106
+ 'TransactionId' => 123
107
+ }
108
+ ).and_call_original
109
+ resource
110
+ end
111
+ end
112
+ end
113
+
85
114
  end
86
115
  end
@@ -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
+ ]
@@ -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',
@@ -66,6 +68,7 @@ class RockMock < Sinatra::Base
66
68
  create_refund: 'FinancialTransactionRefunds',
67
69
  create_refund_reason: 'DefinedValues',
68
70
  create_saved_payment_method: 'FinancialPersonSavedAccounts',
71
+ create_transaction_detail: 'FinancialTransactionDetails',
69
72
  create_recurring_donation_detail: 'FinancialScheduledTransactionDetails',
70
73
  }.each do |json, end_point|
71
74
  post "/api/#{end_point}" do
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.3.0
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-03-15 00:00:00.000000000 Z
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
@@ -331,11 +333,13 @@ files:
331
333
  - spec/support/fixtures/create_refund_reason.json
332
334
  - spec/support/fixtures/create_saved_payment_method.json
333
335
  - spec/support/fixtures/create_transaction.json
336
+ - spec/support/fixtures/create_transaction_detail.json
334
337
  - spec/support/fixtures/defined_values.json
335
338
  - spec/support/fixtures/families.json
336
339
  - spec/support/fixtures/gateways.json
337
340
  - spec/support/fixtures/group.json
338
341
  - spec/support/fixtures/group_locations.json
342
+ - spec/support/fixtures/group_members.json
339
343
  - spec/support/fixtures/groups.json
340
344
  - spec/support/fixtures/groups_with_campus.json
341
345
  - spec/support/fixtures/groups_with_locations.json