rock_rms 7.0.1 → 7.1.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +22 -0
  3. data/README.md +2 -2
  4. data/lib/rock_rms/client.rb +1 -1
  5. data/lib/rock_rms/error.rb +3 -0
  6. data/lib/rock_rms/response/attribute.rb +0 -1
  7. data/lib/rock_rms/response/attribute_value.rb +0 -1
  8. data/lib/rock_rms/response/base.rb +11 -3
  9. data/lib/rock_rms/response/batch.rb +0 -1
  10. data/lib/rock_rms/response/block.rb +0 -1
  11. data/lib/rock_rms/response/block_type.rb +0 -1
  12. data/lib/rock_rms/response/campus.rb +0 -1
  13. data/lib/rock_rms/response/defined_type.rb +0 -1
  14. data/lib/rock_rms/response/defined_value.rb +0 -1
  15. data/lib/rock_rms/response/fund.rb +0 -1
  16. data/lib/rock_rms/response/gateway.rb +0 -1
  17. data/lib/rock_rms/response/group.rb +0 -1
  18. data/lib/rock_rms/response/group_location.rb +0 -1
  19. data/lib/rock_rms/response/history.rb +0 -1
  20. data/lib/rock_rms/response/location.rb +0 -1
  21. data/lib/rock_rms/response/page.rb +0 -1
  22. data/lib/rock_rms/response/payment_detail.rb +0 -1
  23. data/lib/rock_rms/response/person.rb +0 -1
  24. data/lib/rock_rms/response/phone_number.rb +0 -1
  25. data/lib/rock_rms/response/recurring_donation.rb +0 -1
  26. data/lib/rock_rms/response/recurring_donation_details.rb +0 -1
  27. data/lib/rock_rms/response/registration.rb +0 -1
  28. data/lib/rock_rms/response/registration_instance.rb +0 -1
  29. data/lib/rock_rms/response/saved_payment_method.rb +0 -1
  30. data/lib/rock_rms/response/service_job.rb +0 -1
  31. data/lib/rock_rms/response/transaction.rb +0 -1
  32. data/lib/rock_rms/response/transaction_detail.rb +0 -1
  33. data/lib/rock_rms/response/workflow_activity_type.rb +0 -1
  34. data/lib/rock_rms/response/workflow_type.rb +0 -1
  35. data/lib/rock_rms/version.rb +1 -1
  36. data/spec/rock_rms/client_spec.rb +1 -1
  37. data/spec/rock_rms/response/attribute_value_spec.rb +1 -1
  38. data/spec/rock_rms/response/recurring_donation_spec.rb +3 -1
  39. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8836fd0db94780df295423b7f8c419c54bad9a94e911c8d38fed83fa8d6ce87
4
- data.tar.gz: 1a34de75f97a5ef40bdfdcbbd5c6269635bc8a1fb9f1e80e92ad9a3345fe65b1
3
+ metadata.gz: 17ab634cb0cde62461d00147a5db6782e60f6c76891937fee02cb87e2440f545
4
+ data.tar.gz: 8ee90dd944bc529fb368a33d4c7f72a9bca98ded2efd35408ef2c07842f93308
5
5
  SHA512:
6
- metadata.gz: a20b892ec0aa7301c3866d2138f93e006908db31761ac1c55119bd3bd059abceaca8bbd96fa428263ad2906bbb1d2d8c9f5a2e765199ecdb4b643549175e2b9b
7
- data.tar.gz: b2152ad46a08d4d30f43297a7f2b0aefdf7e649d594117033daac8135f00eb9def041406d3a35529fd1426803fba2de8b02759019c79162f66d6ecf20f1b9d43
6
+ metadata.gz: f7d04c986b0a027238618f14aa5764c1504a7923f92568cc10a48e77d6c0c14e325d2220bba99f253a38f0b07bfc484812540caf450f907bd6eceb51b0d78a60
7
+ data.tar.gz: e3274919e94773fc0aa21b4acf407ffe5a1ebce6d7ec069ec6cdd7ab2e0bb36e0bd6c65b0c22b984c962fef190817e411242ad07ab60d95135813ebeda20b7dc
@@ -0,0 +1,22 @@
1
+ name: Run specs
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ bundler-cache: true
19
+ - name: Install dependencies
20
+ run: bundle install
21
+ - name: Run tests
22
+ run: bundle exec rspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![](https://www.rockrms.com/Themes/RockExternal/Assets/Images/rock-logo.svg)
2
2
 
3
- # Rock RMS Ruby Client [![Build Status](https://travis-ci.org/taylorbrooks/rock_rms.svg?branch=master)](https://travis-ci.org/taylorbrooks/rock_rms)
3
+ # Rock RMS Ruby Client ![example workflow](https://github.com/taylorbrooks/rock_rms/actions/workflows/test.yml/badge.svg)
4
4
 
5
5
  A Ruby wrapper for the Rock RMS API
6
6
 
@@ -14,7 +14,7 @@ I'm a big fan of Rock so if you have problems using the gem or would like to see
14
14
  Add this line to your application's Gemfile:
15
15
  ````ruby
16
16
  # in your Gemfile
17
- gem 'rock_rms', '~> 4.2'
17
+ gem 'rock_rms', '~> 7.0.3'
18
18
 
19
19
  # then...
20
20
  bundle install
@@ -78,7 +78,7 @@ module RockRMS
78
78
  def auth
79
79
  begin
80
80
  auth_request('Auth/Login')
81
- rescue Faraday::Error::ParsingError => e
81
+ rescue Faraday::ParsingError => e
82
82
  if e.message.include?('Document Moved')
83
83
  auth_request('auth/login')
84
84
  else
@@ -2,6 +2,7 @@ module RockRMS
2
2
  class Error < StandardError; end
3
3
  class BadGateway < Error; end
4
4
  class BadRequest < Error; end
5
+ class CloudflareError < Error; end
5
6
  class Forbidden < Error; end
6
7
  class GatewayTimeout < Error; end
7
8
  class InternalServerError < Error; end
@@ -33,6 +34,8 @@ module FaradayMiddleware
33
34
  raise RockRMS::ServiceUnavailable, error_message(env)
34
35
  when 504
35
36
  raise RockRMS::GatewayTimeout, error_message(env)
37
+ when 520
38
+ raise RockRMS::CloudflareError, error_message(env)
36
39
  when ERROR_STATUSES
37
40
  raise RockRMS::Error, error_message(env)
38
41
  end
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Attribute < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  key: 'Key',
8
7
  description: 'Description'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class AttributeValue < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  value: 'Value',
7
6
  value_as_number: 'ValueAsNumeric',
8
7
  entity_id: 'EntityId'
@@ -3,6 +3,12 @@ module RockRMS
3
3
  class Base
4
4
  attr_reader :data
5
5
 
6
+ BASE_MAPPING = {
7
+ id: 'Id',
8
+ created_date_time: 'CreatedDateTime',
9
+ modified_date_time: 'ModifiedDateTime'
10
+ }.freeze
11
+
6
12
  def self.format(data)
7
13
  new(data).format
8
14
  end
@@ -22,9 +28,11 @@ module RockRMS
22
28
  def to_h(dict, data)
23
29
  return {} if data.nil?
24
30
 
25
- dict.each_with_object({}) do |(l, r), object|
26
- object[l] = data[r]
27
- end
31
+ dict
32
+ .merge(BASE_MAPPING)
33
+ .each_with_object({}) do |(l, r), object|
34
+ object[l] = data[r]
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Batch < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  control_amount: 'ControlAmount',
8
7
  transactions: 'Transactions',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Block < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  block_type: 'BlockType',
8
7
  page_id: 'PageId'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class BlockType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  description: 'Description',
8
7
  category: 'Category',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Campus < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  is_active: 'IsActive',
8
7
  description: 'Description',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class DefinedType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  description: 'Description',
8
7
  defined_values: 'DefinedValues',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class DefinedValue < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  defined_type_id: 'DefinedTypeId',
7
6
  description: 'Description',
8
7
  order: 'Order',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Fund < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  campus_id: 'CampusId',
7
6
  name: 'Name',
8
7
  gl_code: 'GlCode'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Gateway < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  active: 'IsActive'
8
7
  }.freeze
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Group < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  group_type_id: 'GroupTypeId',
8
7
  parent_group_id: 'ParentGroupId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class GroupLocation < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  group_id: 'GroupId',
7
6
  location_id: 'LocationId',
8
7
  guid: 'Guid'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class History < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  verb: 'Verb',
7
6
  change_type: 'ChangeType',
8
7
  value_name: 'ValueName',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Location < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  is_active: 'IsActive',
8
7
  street1: 'Street1',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Page < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'InternalName',
7
6
  page_title: 'PageTitle',
8
7
  browser_title: 'BrowserTitle',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class PaymentDetail < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  exp_month: 'ExpirationMonth',
7
6
  exp_year: 'ExpirationYear',
8
7
  foreign_key: 'ForeignKey',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Person < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'FullName',
7
6
  email: 'Email',
8
7
  first_name: 'FirstName',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class PhoneNumber < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  person_id: 'PersonId',
7
6
  number: 'Number',
8
7
  number_type_value_id: 'NumberTypeValueId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class RecurringDonation < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  active: 'IsActive',
7
6
  financial_gateway_id: 'FinancialGatewayId',
8
7
  foreign_key: 'ForeignKey',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class RecurringDonationDetails < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  amount: 'Amount',
7
6
  fee_coverage_amount: 'FeeCoverageAmount',
8
7
  fund_id: 'AccountId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Registration < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  first_name: 'FirstName',
7
6
  last_name: 'LastName',
8
7
  confirmation_email: 'ConfirmationEmail',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class RegistrationInstance < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  start_date: 'StartDateTime',
8
7
  end_date: 'EndDateTime',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class SavedPaymentMethod < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  foreign_key: 'ForeignKey',
7
6
  gateway_id: 'FinancialGatewayId',
8
7
  gateway_person_id: 'GatewayPersonIdentifier',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class ServiceJob < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  active: 'IsActive',
8
7
  description: 'Description',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Transaction < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  date: 'TransactionDateTime',
7
6
  person: 'AuthorizedPersonAlias',
8
7
  person_id: 'AuthorizedPersonAliasId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class TransactionDetail < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  fee_amount: 'FeeAmount',
7
6
  fee_coverage_amount: 'FeeCoverageAmount',
8
7
  fund: 'Account',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class WorkflowActivityType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  description: 'Description',
8
7
  order: 'Order',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class WorkflowType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  active: 'IsActive',
7
6
  name: 'Name',
8
7
  description: 'Description',
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '7.0.1'.freeze
2
+ VERSION = '7.1.0'.freeze
3
3
  end
@@ -33,7 +33,7 @@ RSpec.describe RockRMS::Client do
33
33
  it 'expects a valid URI' do
34
34
  expect do
35
35
  described_class.new(url: 'test', username: 'test', password: 'test')
36
- end.to raise_error(URI::InvalidURIError)
36
+ end.to raise_error(URI::BadURIError)
37
37
  end
38
38
  end
39
39
  end
@@ -14,7 +14,7 @@ RSpec.describe RockRMS::Response::AttributeValue, type: :model do
14
14
 
15
15
  it 'has the correct number keys' do
16
16
  keys = result.first.keys
17
- expect(keys.count).to eq(4)
17
+ expect(keys.count).to eq(6)
18
18
  end
19
19
 
20
20
  it 'translates keys' do
@@ -15,7 +15,6 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
15
15
  it 'has the following keys' do
16
16
  response = result.first
17
17
  expected_keys = %i[
18
- id
19
18
  active
20
19
  financial_gateway_id
21
20
  foreign_key
@@ -30,6 +29,9 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
30
29
  transaction_code
31
30
  transaction_type_id
32
31
  summary
32
+ id
33
+ created_date_time
34
+ modified_date_time
33
35
  ]
34
36
 
35
37
  expect(response.keys).to eq(expected_keys)
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: 7.0.1
4
+ version: 7.1.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: 2022-08-05 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -173,6 +173,7 @@ executables:
173
173
  extensions: []
174
174
  extra_rdoc_files: []
175
175
  files:
176
+ - ".github/workflows/test.yml"
176
177
  - ".gitignore"
177
178
  - ".ruby-version"
178
179
  - ".travis.yml"