stbaldricks 12.10.0 → 12.11.0.alpha.2

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 (175) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stbaldricks/configuration.rb +2 -2
  3. data/lib/stbaldricks/default_logger.rb +2 -2
  4. data/lib/stbaldricks/endpoints/blog_post.rb +8 -8
  5. data/lib/stbaldricks/endpoints/communicate.rb +1 -1
  6. data/lib/stbaldricks/endpoints/config.rb +1 -1
  7. data/lib/stbaldricks/endpoints/deduplicator_match.rb +2 -2
  8. data/lib/stbaldricks/endpoints/kid.rb +1 -1
  9. data/lib/stbaldricks/endpoints/lib/entity.rb +13 -11
  10. data/lib/stbaldricks/endpoints/newsletter_recipient.rb +11 -5
  11. data/lib/stbaldricks/endpoints/participant.rb +3 -3
  12. data/lib/stbaldricks/endpoints/photo.rb +5 -4
  13. data/lib/stbaldricks/endpoints/search.rb +2 -2
  14. data/lib/stbaldricks/endpoints/user.rb +1 -1
  15. data/lib/stbaldricks/entities/batch.rb +3 -5
  16. data/lib/stbaldricks/entities/blog_post.rb +1 -7
  17. data/lib/stbaldricks/entities/campaign.rb +6 -13
  18. data/lib/stbaldricks/entities/challenge.rb +4 -6
  19. data/lib/stbaldricks/entities/challenger.rb +4 -6
  20. data/lib/stbaldricks/entities/concerns/entity_response_concern.rb +1 -1
  21. data/lib/stbaldricks/entities/config.rb +3 -8
  22. data/lib/stbaldricks/entities/contact.rb +4 -7
  23. data/lib/stbaldricks/entities/contact_group.rb +2 -2
  24. data/lib/stbaldricks/entities/deduplicator_history.rb +1 -6
  25. data/lib/stbaldricks/entities/deduplicator_match.rb +4 -7
  26. data/lib/stbaldricks/entities/disease.rb +2 -5
  27. data/lib/stbaldricks/entities/document_library.rb +3 -8
  28. data/lib/stbaldricks/entities/document_library_category.rb +1 -4
  29. data/lib/stbaldricks/entities/donation.rb +12 -18
  30. data/lib/stbaldricks/entities/donor.rb +1 -5
  31. data/lib/stbaldricks/entities/event.rb +32 -43
  32. data/lib/stbaldricks/entities/event_application.rb +6 -10
  33. data/lib/stbaldricks/entities/event_donation_summary.rb +2 -5
  34. data/lib/stbaldricks/entities/event_participant_summary.rb +1 -3
  35. data/lib/stbaldricks/entities/event_supporter.rb +3 -3
  36. data/lib/stbaldricks/entities/fund.rb +6 -23
  37. data/lib/stbaldricks/entities/fundraiser.rb +16 -29
  38. data/lib/stbaldricks/entities/grant.rb +12 -25
  39. data/lib/stbaldricks/entities/institution.rb +3 -4
  40. data/lib/stbaldricks/entities/international_partner.rb +4 -16
  41. data/lib/stbaldricks/entities/kid.rb +13 -30
  42. data/lib/stbaldricks/entities/kid_honor.rb +1 -0
  43. data/lib/stbaldricks/entities/kid_institution.rb +2 -2
  44. data/lib/stbaldricks/entities/lib/address.rb +3 -6
  45. data/lib/stbaldricks/entities/lib/alternate_shipping_address.rb +1 -3
  46. data/lib/stbaldricks/entities/lib/base.rb +47 -39
  47. data/lib/stbaldricks/entities/lib/collection.rb +2 -2
  48. data/lib/stbaldricks/entities/lib/email_address.rb +1 -2
  49. data/lib/stbaldricks/entities/lib/fundraising_page.rb +1 -2
  50. data/lib/stbaldricks/entities/lib/location.rb +1 -0
  51. data/lib/stbaldricks/entities/lib/milestone.rb +1 -3
  52. data/lib/stbaldricks/entities/lib/name.rb +2 -2
  53. data/lib/stbaldricks/entities/lib/not_implemented_object.rb +1 -1
  54. data/lib/stbaldricks/entities/lib/permissions.rb +2 -4
  55. data/lib/stbaldricks/entities/lib/phone.rb +2 -3
  56. data/lib/stbaldricks/entities/lib/third_party_media.rb +1 -5
  57. data/lib/stbaldricks/entities/lib/top_level.rb +1 -1
  58. data/lib/stbaldricks/entities/matching_gift_company.rb +16 -39
  59. data/lib/stbaldricks/entities/memorial.rb +9 -14
  60. data/lib/stbaldricks/entities/message.rb +4 -15
  61. data/lib/stbaldricks/entities/organization.rb +11 -17
  62. data/lib/stbaldricks/entities/page.rb +6 -15
  63. data/lib/stbaldricks/entities/participant.rb +18 -28
  64. data/lib/stbaldricks/entities/participant_donation_summary.rb +2 -4
  65. data/lib/stbaldricks/entities/person.rb +22 -30
  66. data/lib/stbaldricks/entities/person_donation_by_year_summary.rb +1 -2
  67. data/lib/stbaldricks/entities/photo.rb +5 -11
  68. data/lib/stbaldricks/entities/recurring_gift.rb +10 -18
  69. data/lib/stbaldricks/entities/response.rb +1 -0
  70. data/lib/stbaldricks/entities/search.rb +30 -168
  71. data/lib/stbaldricks/entities/section.rb +1 -4
  72. data/lib/stbaldricks/entities/shave_schedule.rb +4 -13
  73. data/lib/stbaldricks/entities/summary.rb +1 -7
  74. data/lib/stbaldricks/entities/team.rb +12 -16
  75. data/lib/stbaldricks/entities/team_donation_summary.rb +2 -4
  76. data/lib/stbaldricks/request.rb +2 -2
  77. data/lib/stbaldricks/version.rb +1 -1
  78. metadata +87 -281
  79. data/lib/stbaldricks_factories.rb +0 -5
  80. data/spec/factories/address.rb +0 -14
  81. data/spec/factories/campaign/totals.rb +0 -9
  82. data/spec/factories/campaign.rb +0 -9
  83. data/spec/factories/challenge.rb +0 -19
  84. data/spec/factories/challenger.rb +0 -33
  85. data/spec/factories/collection.rb +0 -17
  86. data/spec/factories/contact.rb +0 -18
  87. data/spec/factories/contact_group.rb +0 -18
  88. data/spec/factories/diagnosis.rb +0 -12
  89. data/spec/factories/disease.rb +0 -11
  90. data/spec/factories/donation/participant.rb +0 -27
  91. data/spec/factories/donation.rb +0 -68
  92. data/spec/factories/donor.rb +0 -13
  93. data/spec/factories/email_address.rb +0 -11
  94. data/spec/factories/error.rb +0 -9
  95. data/spec/factories/event/coach_tracking/coaching_interactions.rb +0 -12
  96. data/spec/factories/event/coach_tracking/plaque.rb +0 -12
  97. data/spec/factories/event/coach_tracking/proceeds.rb +0 -12
  98. data/spec/factories/event/coach_tracking.rb +0 -18
  99. data/spec/factories/event/contacts/contact.rb +0 -17
  100. data/spec/factories/event/contacts/name_pieces.rb +0 -12
  101. data/spec/factories/event/contacts.rb +0 -16
  102. data/spec/factories/event/photos.rb +0 -12
  103. data/spec/factories/event/totals.rb +0 -15
  104. data/spec/factories/event/venue/location.rb +0 -18
  105. data/spec/factories/event/venue/social.rb +0 -16
  106. data/spec/factories/event/venue.rb +0 -16
  107. data/spec/factories/event.rb +0 -66
  108. data/spec/factories/event_application.rb +0 -34
  109. data/spec/factories/event_supporter.rb +0 -19
  110. data/spec/factories/fund.rb +0 -18
  111. data/spec/factories/fundraiser/photos.rb +0 -12
  112. data/spec/factories/fundraiser/policies.rb +0 -11
  113. data/spec/factories/fundraiser/totals.rb +0 -11
  114. data/spec/factories/fundraiser.rb +0 -24
  115. data/spec/factories/fundraising_page.rb +0 -29
  116. data/spec/factories/grant.rb +0 -22
  117. data/spec/factories/grant_institution.rb +0 -17
  118. data/spec/factories/institution.rb +0 -18
  119. data/spec/factories/kid/custom_institution.rb +0 -12
  120. data/spec/factories/kid.rb +0 -68
  121. data/spec/factories/kid_honor.rb +0 -16
  122. data/spec/factories/kid_institution.rb +0 -23
  123. data/spec/factories/lib/faker_patch.rb +0 -27
  124. data/spec/factories/lib/helpers.rb +0 -7
  125. data/spec/factories/location.rb +0 -17
  126. data/spec/factories/memorial/photos.rb +0 -14
  127. data/spec/factories/memorial/totals.rb +0 -11
  128. data/spec/factories/memorial/tribute.rb +0 -19
  129. data/spec/factories/memorial.rb +0 -22
  130. data/spec/factories/message.rb +0 -31
  131. data/spec/factories/milestone.rb +0 -15
  132. data/spec/factories/name_pieces.rb +0 -24
  133. data/spec/factories/newsletter_recipient.rb +0 -13
  134. data/spec/factories/organization/addresses.rb +0 -16
  135. data/spec/factories/organization/email_addresses.rb +0 -14
  136. data/spec/factories/organization/phone_numbers.rb +0 -14
  137. data/spec/factories/organization.rb +0 -34
  138. data/spec/factories/page.rb +0 -5
  139. data/spec/factories/participant/photos.rb +0 -14
  140. data/spec/factories/participant/policies.rb +0 -12
  141. data/spec/factories/participant/rankings/ranking.rb +0 -12
  142. data/spec/factories/participant/rankings.rb +0 -16
  143. data/spec/factories/participant/roles/role.rb +0 -154
  144. data/spec/factories/participant/roles.rb +0 -37
  145. data/spec/factories/participant/totals.rb +0 -11
  146. data/spec/factories/participant.rb +0 -95
  147. data/spec/factories/payment.rb +0 -13
  148. data/spec/factories/permissions.rb +0 -12
  149. data/spec/factories/person/addresses.rb +0 -16
  150. data/spec/factories/person/email_addresses.rb +0 -14
  151. data/spec/factories/person/phone_numbers.rb +0 -14
  152. data/spec/factories/person/policies.rb +0 -13
  153. data/spec/factories/person.rb +0 -22
  154. data/spec/factories/phone.rb +0 -11
  155. data/spec/factories/photo.rb +0 -11
  156. data/spec/factories/photos.rb +0 -9
  157. data/spec/factories/recurring_gift.rb +0 -22
  158. data/spec/factories/researcher.rb +0 -15
  159. data/spec/factories/response.rb +0 -38
  160. data/spec/factories/search_event.rb +0 -19
  161. data/spec/factories/search_fundraiser.rb +0 -15
  162. data/spec/factories/search_kid.rb +0 -13
  163. data/spec/factories/search_participant.rb +0 -15
  164. data/spec/factories/search_team.rb +0 -13
  165. data/spec/factories/shave_schedule/time_selection_permissions.rb +0 -12
  166. data/spec/factories/shave_schedule.rb +0 -33
  167. data/spec/factories/team/photos.rb +0 -12
  168. data/spec/factories/team/rankings/ranking.rb +0 -12
  169. data/spec/factories/team/rankings.rb +0 -15
  170. data/spec/factories/team/totals.rb +0 -14
  171. data/spec/factories/team.rb +0 -43
  172. data/spec/factories/third_party_media.rb +0 -12
  173. data/spec/factories/treatment_status.rb +0 -10
  174. data/spec/factories/user.rb +0 -14
  175. data/spec/factories/venue.rb +0 -15
@@ -67,8 +67,7 @@ module SBF
67
67
  end
68
68
 
69
69
  class Totals < SBF::Client::BaseEntity
70
- attr_reader :amount_raised
71
- attr_reader :donations
70
+ attr_reader :amount_raised, :donations
72
71
  end
73
72
  end
74
73
 
@@ -79,28 +78,23 @@ module SBF
79
78
  class FullOrganization < SBF::Client::Organization
80
79
  class ContactName < SBF::Client::BaseEntity
81
80
  attr_reader :name
81
+
82
82
  entity_attr_accessor :name_pieces, 'SBF::Client::NamePieces'
83
83
  end
84
84
 
85
- attr_accessor :id
86
- attr_accessor :salesforce_id
87
- attr_accessor :salesforce_account_id
88
- attr_accessor :type
89
- attr_accessor :status
90
- attr_reader :display_name
91
- attr_accessor :display_name_override
92
- attr_accessor :name
85
+ attr_accessor :id, :salesforce_id, :salesforce_account_id, :type, :status, :display_name_override, :name,
86
+ :selected_shipping_method, :modified_by, :how_created
87
+ attr_reader :display_name, :created_at, :modified_at
88
+
93
89
  entity_attr_accessor :contact, 'SBF::Client::FullOrganization::ContactName'
94
90
  entity_attr_accessor :addresses, 'SBF::Client::Organization::Addresses'
95
91
  entity_attr_accessor :phone_numbers, 'SBF::Client::Organization::PhoneNumbers'
96
92
  entity_attr_accessor :email_addresses, 'SBF::Client::Organization::EmailAddresses'
97
- entity_attr_accessor :opt_out_settings, 'SBF::Client::OptOutSettings', nil, true
98
- attr_accessor :selected_shipping_method
99
- entity_attr_accessor :alternate_shipping_address, 'SBF::Client::AlternateShippingAddress', nil, true
100
- attr_reader :created_at, :modified_at
101
- attr_accessor :modified_by
102
- attr_accessor :how_created
103
- entity_attr_reader :totals, 'SBF::Client::Organization::Totals', nil, true
93
+ entity_attr_accessor :opt_out_settings, 'SBF::Client::OptOutSettings', nil, optional: true
94
+
95
+ entity_attr_accessor :alternate_shipping_address, 'SBF::Client::AlternateShippingAddress', nil, optional: true
96
+
97
+ entity_attr_reader :totals, 'SBF::Client::Organization::Totals', nil, optional: true
104
98
 
105
99
  def active?
106
100
  status == SBF::Client::Organization::Status::ACTIVE
@@ -9,13 +9,8 @@ module SBF
9
9
  actions DEFAULT_CRUD_ACTIONS
10
10
 
11
11
  class Content < SBF::Client::BaseEntity
12
- attr_reader :id
13
- attr_accessor :is_draft
14
- attr_accessor :type
15
- attr_accessor :title
16
- attr_accessor :text
17
- attr_accessor :sort_order
18
- attr_reader :date_modified
12
+ attr_reader :id, :date_modified
13
+ attr_accessor :is_draft, :type, :title, :text, :sort_order
19
14
 
20
15
  module Type
21
16
  TEXT = 'text'.freeze
@@ -23,13 +18,9 @@ module SBF
23
18
  end
24
19
  end
25
20
 
26
- attr_reader :id
27
- attr_accessor :title
28
- attr_accessor :lookup
29
- attr_accessor :title_tag
30
- attr_accessor :locked_by_profile_id
31
- attr_accessor :locked_at
32
- attr_reader :may_edit
21
+ attr_reader :id, :may_edit
22
+ attr_accessor :title, :lookup, :title_tag, :locked_by_profile_id, :locked_at
23
+
33
24
  entity_collection_attr_accessor :content, 'SBF::Client::Page::Content'
34
25
 
35
26
  def meta_content
@@ -73,7 +64,7 @@ module SBF
73
64
  # update or create draft version of content
74
65
  draft = draft_content.find { |d| d.id == cid }
75
66
  if draft.nil?
76
- self.content << SBF::Client::Page::Content.new(content.to_hash.merge(is_draft: true, title: data[:title], text: data[:text]))
67
+ self.content << SBF::Client::Page::Content.new(content.to_hash.merge(is_draft: true, title: data[:title], text: data[:text]), **(;{}))
77
68
  else
78
69
  draft.title = data[:title]
79
70
  draft.text = data[:text]
@@ -138,8 +138,8 @@ module SBF
138
138
 
139
139
  class Organizer < SBF::Client::Participant::Roles::LeadRole
140
140
  class Policies < SBF::Client::BaseEntity
141
- attr_accessor :agreement_received_date, :coaches_questionnaire_received_date
142
- attr_accessor :is_revenue_waiver_accepted, :is_host_agreement_waiver_accepted
141
+ attr_accessor :agreement_received_date, :coaches_questionnaire_received_date, :is_revenue_waiver_accepted,
142
+ :is_host_agreement_waiver_accepted
143
143
  end
144
144
 
145
145
  class PreviousOrganization < SBF::Client::BaseEntity
@@ -147,6 +147,7 @@ module SBF
147
147
  end
148
148
 
149
149
  attr_accessor :is_lead, :status
150
+
150
151
  entity_attr_accessor :policies, 'SBF::Client::Participant::Roles::Organizer::Policies'
151
152
  entity_attr_accessor :previous_organization, 'SBF::Client::Participant::Roles::Organizer::PreviousOrganization'
152
153
  end
@@ -158,6 +159,7 @@ module SBF
158
159
 
159
160
  class Salon < SBF::Client::BaseEntity
160
161
  attr_accessor :name
162
+
161
163
  entity_attr_accessor :phone, 'SBF::Client::Phone'
162
164
  end
163
165
 
@@ -209,40 +211,28 @@ module SBF
209
211
  extend Forwardable
210
212
  def_delegator :@photos, :avatar, :avatar_photo_url
211
213
 
212
- attr_accessor :id
214
+ attr_accessor :id, :display_name_override, :facebook_fundraiser_id, :fund_relationship_type, :fundraising_goal, :fundraising_message,
215
+ :how_created, :is_virtual, :modified_by, :offline_donation_uuid, :offline_donation_form, :shirt_size, :status
216
+
217
+ attr_reader :created_at, :modified_at, :display_name, :is_website_allowed
213
218
 
214
- attr_reader :created_at, :modified_at
215
- attr_reader :display_name
216
- attr_reader :is_website_allowed
217
-
218
- attr_accessor :display_name_override
219
- attr_accessor :facebook_fundraiser_id
220
- attr_accessor :fund_relationship_type
221
- attr_accessor :fundraising_goal, :fundraising_message
222
- attr_accessor :how_created
223
- attr_accessor :is_virtual
224
- attr_accessor :modified_by
225
- attr_accessor :offline_donation_uuid, :offline_donation_form
226
- attr_accessor :shirt_size
227
- attr_accessor :status
228
-
229
- entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
230
- entity_attr_reader :permissions_at_event, 'SBF::Client::PermissionsAtEvent', nil, true
219
+ entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, optional: true
220
+ entity_attr_reader :permissions_at_event, 'SBF::Client::PermissionsAtEvent', nil, optional: true
231
221
  entity_attr_reader :photos, 'SBF::Client::Participant::Photos'
232
- entity_attr_reader :rankings, 'SBF::Client::Participant::Rankings', nil, true
222
+ entity_attr_reader :rankings, 'SBF::Client::Participant::Rankings', nil, optional: true
233
223
  entity_attr_reader :totals, 'SBF::Client::Participant::Totals'
234
224
 
235
- entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', true
236
- entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
237
- entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, true
225
+ entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', optional: true
226
+ entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', optional: true
227
+ entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, optional: true
238
228
  entity_attr_accessor :person, 'SBF::Client::FullPerson'
239
229
  entity_attr_accessor :policies, 'SBF::Client::Participant::Policies'
240
- entity_attr_accessor :roles, 'SBF::Client::Participant::Roles', nil, true
230
+ entity_attr_accessor :roles, 'SBF::Client::Participant::Roles', nil, optional: true
241
231
  entity_attr_accessor :shave_schedule, 'SBF::Client::Participant::ShaveSchedule'
242
- entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', true
243
- entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, true
232
+ entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', optional: true
233
+ entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, optional: true
244
234
 
245
- entity_collection_attr_accessor :milestones, 'SBF::Client::Milestone', nil, true
235
+ entity_collection_attr_accessor :milestones, 'SBF::Client::Milestone', nil, optional: true
246
236
 
247
237
  def active?
248
238
  status == SBF::Client::Participant::Status::ACTIVE
@@ -9,11 +9,9 @@ module SBF
9
9
  blacklist_action :update
10
10
  blacklist_action :delete
11
11
 
12
- attr_accessor :amount_raised
13
- attr_accessor :donations
14
- attr_accessor :event_year
12
+ attr_accessor :amount_raised, :donations, :event_year
15
13
 
16
- entity_attr_reader :participant, 'SBF::Client::FullParticipant', nil, true
14
+ entity_attr_reader :participant, 'SBF::Client::FullParticipant', nil, optional: true
17
15
  end
18
16
  end
19
17
  end
@@ -92,15 +92,16 @@ module SBF
92
92
 
93
93
  class Policies < SBF::Client::BaseEntity
94
94
  BACKGROUND_CHECK_YEARS_VALID = 5
95
- attr_accessor :is_photo_policy_accepted
96
- attr_accessor :background_check_date, :background_check_url
95
+ attr_accessor :is_photo_policy_accepted, :background_check_date, :background_check_url
97
96
 
98
97
  def background_check_valid_at_date?(check_date)
99
98
  check_date = DateTime.parse(check_date) if check_date.is_a?(String)
100
99
  check_date = DateTime.parse(check_date.to_s) if check_date.is_a?(Date)
101
100
  check_date = DateTime.parse(check_date.strftime('%d/%m/%Y %H:%M:%S')) if check_date.is_a?(Time)
102
101
  background_check_date && check_date.is_a?(DateTime) \
103
- && background_check_date > check_date.prev_year(SBF::Client::Person::Policies::BACKGROUND_CHECK_YEARS_VALID)
102
+ && DateTime.parse(background_check_date) > check_date.prev_year(
103
+ SBF::Client::Person::Policies::BACKGROUND_CHECK_YEARS_VALID
104
+ )
104
105
  end
105
106
  end
106
107
 
@@ -205,6 +206,7 @@ module SBF
205
206
  end
206
207
  end
207
208
  end
209
+
208
210
  class Occupation < SBF::Client::BaseEntity
209
211
  module Type
210
212
  STUDENT = 'Student'.freeze
@@ -342,21 +344,21 @@ module SBF
342
344
  # able to determine what type it should be. As it is currently written, it cannot instanitate itself
343
345
  # without the information contained in the SBF::Client::Person::Occupation instance.
344
346
  attr_accessor :details
347
+
345
348
  def details=(value)
346
349
  details_will_change!
347
350
  if educator? || student?
348
- @details = SBF::Client::Person::Occupation::EducationDetails.new(value)
351
+ @details = SBF::Client::Person::Occupation::EducationDetails.new(value, **(;{}))
349
352
  elsif military?
350
- @details = SBF::Client::Person::Occupation::MilitaryDetails.new(value)
353
+ @details = SBF::Client::Person::Occupation::MilitaryDetails.new(value, **(;{}))
351
354
  elsif finance? || other?
352
- @details = SBF::Client::Person::Occupation::FinanceDetails.new(value)
355
+ @details = SBF::Client::Person::Occupation::FinanceDetails.new(value, **(;{}))
353
356
  end
354
357
  end
355
358
  end
356
359
 
357
360
  class Totals < SBF::Client::BaseEntity
358
- attr_reader :amount_raised
359
- attr_reader :donations
361
+ attr_reader :amount_raised, :donations
360
362
  end
361
363
 
362
364
  def league_status_title
@@ -382,33 +384,23 @@ module SBF
382
384
  end
383
385
 
384
386
  class FullPerson < SBF::Client::Person
385
- attr_accessor :id
386
- attr_accessor :salesforce_id
387
- attr_accessor :salesforce_account_id
388
- attr_accessor :type
389
- attr_accessor :status
390
- attr_accessor :gender
391
- attr_accessor :is_minor
392
- attr_accessor :birthday
393
- attr_reader :display_name, :first_and_last_name
394
- attr_accessor :display_name_override
395
- attr_accessor :years_as_participant, :years_as_organizer
396
- attr_reader :league_status
397
- attr_reader :name
387
+ attr_accessor :id, :salesforce_id, :salesforce_account_id, :type, :status, :gender, :is_minor, :birthday,
388
+ :display_name_override, :years_as_participant, :years_as_organizer, :selected_shipping_method,
389
+ :modified_by, :how_created
390
+ attr_reader :display_name, :first_and_last_name, :league_status, :name, :created_at, :modified_at
391
+
398
392
  entity_attr_accessor :name_pieces, 'SBF::Client::NamePieces'
399
393
  entity_attr_accessor :addresses, 'SBF::Client::Person::Addresses'
400
394
  entity_attr_accessor :phone_numbers, 'SBF::Client::Person::PhoneNumbers'
401
395
  entity_attr_accessor :email_addresses, 'SBF::Client::Person::EmailAddresses'
402
- entity_attr_accessor :occupation, 'SBF::Client::Person::Occupation', nil, true
396
+ entity_attr_accessor :occupation, 'SBF::Client::Person::Occupation', nil, optional: true
403
397
  entity_attr_accessor :policies, 'SBF::Client::Person::Policies'
404
- entity_attr_accessor :how_affected, 'SBF::Client::Person::HowAffected', nil, true
405
- entity_attr_accessor :opt_out_settings, 'SBF::Client::OptOutSettings', nil, true
406
- attr_accessor :selected_shipping_method
407
- entity_attr_accessor :alternate_shipping_address, 'SBF::Client::AlternateShippingAddress', nil, true
408
- attr_reader :created_at, :modified_at
409
- attr_accessor :modified_by
410
- attr_accessor :how_created
411
- entity_attr_reader :totals, 'SBF::Client::Person::Totals', nil, true
398
+ entity_attr_accessor :how_affected, 'SBF::Client::Person::HowAffected', nil, optional: true
399
+ entity_attr_accessor :opt_out_settings, 'SBF::Client::OptOutSettings', nil, optional: true
400
+
401
+ entity_attr_accessor :alternate_shipping_address, 'SBF::Client::AlternateShippingAddress', nil, optional: true
402
+
403
+ entity_attr_reader :totals, 'SBF::Client::Person::Totals', nil, optional: true
412
404
 
413
405
  def active?
414
406
  status == SBF::Client::Person::Status::ACTIVE
@@ -9,8 +9,7 @@ module SBF
9
9
  blacklist_action :update
10
10
  blacklist_action :delete
11
11
 
12
- attr_accessor :donations
13
- attr_accessor :cumulative_total
12
+ attr_accessor :donations, :cumulative_total
14
13
  attr_reader :modified_at
15
14
 
16
15
  entity_attr_accessor :person, 'SBF::Client::FullPerson', 'SBF::Client::PartialPerson'
@@ -26,13 +26,8 @@ module SBF
26
26
  endpoint.send(:upload, *args)
27
27
  end
28
28
 
29
- attr_accessor :id
30
- attr_accessor :caption
31
- attr_accessor :sort_order
32
- attr_accessor :year
33
- attr_accessor :category
34
- attr_accessor :file
35
- attr_accessor :filename
29
+ attr_accessor :id, :caption, :sort_order, :year, :category, :file, :filename, :base_photo_url
30
+
36
31
  multitype_attr_accessor(
37
32
  :model,
38
33
  [
@@ -84,12 +79,11 @@ module SBF
84
79
  ],
85
80
  optional: false
86
81
  )
87
- attr_accessor :base_photo_url
88
- attr_reader :original_file_id
89
- attr_reader :original_filename
82
+ attr_reader :original_file_id, :original_filename
90
83
 
91
84
  def to_json(*a)
92
- to_hash.reject { |k, _v| %i(file filename).include? k }.to_json(*a)
85
+ names = %i(file filename)
86
+ to_hash.reject { |k, _v| names.include? k }.to_json(*a)
93
87
  end
94
88
 
95
89
  module Category
@@ -168,6 +168,7 @@ module SBF
168
168
  class Tribute < SBF::Client::BaseEntity
169
169
  attr_accessor :type
170
170
  attr_reader :name
171
+
171
172
  entity_attr_accessor :name_pieces, 'SBF::Client::NamePieces'
172
173
 
173
174
  module Type
@@ -180,24 +181,15 @@ module SBF
180
181
  class PartialRecurringGift < SBF::Client::RecurringGift
181
182
  attr_accessor :id
182
183
  end
184
+
183
185
  class FullRecurringGift < SBF::Client::RecurringGift
184
- attr_accessor :status
185
- attr_accessor :event_year
186
- attr_accessor :amount
187
- attr_accessor :fee_amount
188
- attr_accessor :billing_day_of_month
189
- attr_accessor :last_collected_at
190
- attr_accessor :last_failed_at
191
- attr_accessor :display_name
192
- attr_accessor :display_name_override
193
- attr_accessor :is_unrecognized
194
- attr_accessor :promotional_code
195
- attr_accessor :funding_type
196
- attr_accessor :payment_gateway
197
- attr_accessor :customer_id
198
- attr_accessor :subscription_id
186
+ attr_accessor :status, :event_year, :amount, :fee_amount, :billing_day_of_month, :last_collected_at,
187
+ :last_failed_at, :display_name, :display_name_override, :is_unrecognized, :promotional_code,
188
+ :funding_type, :payment_gateway, :customer_id, :subscription_id, :created_at, :modified_at,
189
+ :modified_by, :how_created, :how_created_id, :past_due_at
190
+
199
191
  entity_collection_attr_accessor :donations, 'SBF::Client::FullDonation', 'SBF::Client::PartialDonation'
200
- attr_accessor :created_at, :modified_at, :modified_by, :how_created, :how_created_id, :past_due_at
192
+
201
193
  entity_attr_accessor :tribute, 'SBF::Client::RecurringGift::Tribute'
202
194
 
203
195
  multitype_attr_accessor(
@@ -291,12 +283,12 @@ module SBF
291
283
 
292
284
  def amount=(value)
293
285
  amount_will_change!
294
- @amount = value.to_s.gsub(/[^0-9\.]/, '').to_f
286
+ @amount = value.to_s.gsub(/[^0-9.]/, '').to_f
295
287
  end
296
288
 
297
289
  def fee_amount=(value)
298
290
  fee_amount_will_change!
299
- @fee_amount = value.to_s.gsub(/[^0-9\.]/, '').to_f
291
+ @fee_amount = value.to_s.gsub(/[^0-9.]/, '').to_f
300
292
  end
301
293
  end
302
294
  end
@@ -7,6 +7,7 @@ module SBF
7
7
  attr_accessor :http_code, :data, :error
8
8
 
9
9
  def initialize(http_code: nil, data: nil, error: nil)
10
+ super()
10
11
  @http_code = http_code
11
12
  @data = data
12
13
  @error = error || SBF::Client::ErrorEntity.new(nil)
@@ -39,195 +39,57 @@ module SBF
39
39
  end
40
40
 
41
41
  class Fund < SBF::Client::BaseEntity
42
- attr_reader :fund_id
43
- attr_reader :slug
44
- attr_reader :name
45
- attr_reader :website
46
- attr_reader :disabled
47
- attr_reader :event_year
48
- attr_reader :total_donations
49
- attr_reader :total_events
50
- attr_reader :total_participants
51
- attr_reader :total_shavees
52
- attr_reader :mypage_url
53
- attr_reader :default_photo_url
54
- attr_reader :avatar_photo_url
42
+ attr_reader :fund_id, :slug, :name, :website, :disabled, :event_year, :total_donations, :total_events,
43
+ :total_participants, :total_shavees, :mypage_url, :default_photo_url, :avatar_photo_url
55
44
  end
56
45
 
57
46
  class Campaign < SBF::Client::BaseEntity
58
- attr_reader :campaign_id
59
- attr_reader :slug
60
- attr_reader :name
61
- attr_reader :website
62
- attr_reader :disabled
63
- attr_reader :event_year
64
- attr_reader :total_donations
65
- attr_reader :total_events
66
- attr_reader :total_participants
67
- attr_reader :total_shavees
68
- attr_reader :mypage_url
47
+ attr_reader :campaign_id, :slug, :name, :website, :disabled, :event_year, :total_donations, :total_events,
48
+ :total_participants, :total_shavees, :mypage_url
69
49
  end
70
50
 
71
51
  class Event < SBF::Client::BaseEntity
72
- attr_reader :venue_name
73
- attr_reader :event_title
74
- attr_reader :zip_code
75
- attr_reader :address1
76
- attr_reader :city
77
- attr_reader :state
78
- attr_reader :state_full
79
- attr_reader :country
80
- attr_reader :country_full
81
- attr_reader :address2
82
- attr_reader :event_access_type_id
83
- attr_reader :event_date
84
- attr_reader :event_year
85
- attr_reader :event_id
86
- attr_reader :is_website_allowed
87
- attr_reader :is_expired
88
- attr_reader :start_time
89
- attr_reader :end_time
90
- attr_reader :status_id
91
- attr_reader :website_url
92
- attr_reader :total_donations
93
- attr_reader :total_participants
94
- attr_reader :total_shavees
95
- attr_reader :icon
96
- attr_reader :mypage_url
97
- attr_reader :default_photo_url
98
- attr_reader :avatar_photo_url
99
- attr_reader :closed_roles
52
+ attr_reader :venue_name, :event_title, :zip_code, :address1, :city, :state, :state_full, :country,
53
+ :country_full, :address2, :event_access_type_id, :event_date, :event_year, :event_id,
54
+ :is_website_allowed, :is_expired, :start_time, :end_time, :status_id, :website_url,
55
+ :total_donations, :total_participants, :total_shavees, :icon, :mypage_url, :default_photo_url,
56
+ :avatar_photo_url, :closed_roles
100
57
  end
101
58
 
102
59
  class Team < SBF::Client::BaseEntity
103
- attr_reader :team_name
104
- attr_reader :venue_name
105
- attr_reader :event_title
106
- attr_reader :zip_code
107
- attr_reader :address1
108
- attr_reader :city
109
- attr_reader :state
110
- attr_reader :state_full
111
- attr_reader :country_full
112
- attr_reader :country
113
- attr_reader :event_date
114
- attr_reader :event_id
115
- attr_reader :event_year
116
- attr_reader :event_status_id
117
- attr_reader :team_id
118
- attr_reader :is_website_allowed
119
- attr_reader :status_id
120
- attr_reader :total_donations
121
- attr_reader :total_participants
122
- attr_reader :total_shavees
123
- attr_reader :icon
124
- attr_reader :mypage_url
125
- attr_reader :default_photo_url
126
- attr_reader :avatar_photo_url
60
+ attr_reader :team_name, :venue_name, :event_title, :zip_code, :address1, :city, :state, :state_full,
61
+ :country_full, :country, :event_date, :event_id, :event_year, :event_status_id, :team_id,
62
+ :is_website_allowed, :status_id, :total_donations, :total_participants, :total_shavees, :icon,
63
+ :mypage_url, :default_photo_url, :avatar_photo_url
127
64
  end
128
65
 
129
66
  class Participant < SBF::Client::BaseEntity
130
- attr_reader :participant_id
131
- attr_reader :event_year
132
- attr_reader :raw_display_name
133
- attr_reader :display_name
134
- attr_reader :team_name
135
- attr_reader :venue_name
136
- attr_reader :event_title
137
- attr_reader :zip_code
138
- attr_reader :city
139
- attr_reader :state
140
- attr_reader :state_full
141
- attr_reader :participant_state
142
- attr_reader :participant_state_full
143
- attr_reader :country
144
- attr_reader :country_full
145
- attr_reader :participant_country
146
- attr_reader :participant_country_full
147
- attr_reader :event_date
148
- attr_reader :event_id
149
- attr_reader :is_website_allowed
150
- attr_reader :profile_id
151
- attr_reader :status_id
152
- attr_reader :event_status_id
153
- attr_reader :team_id
154
- attr_reader :virtual_participation_date
155
- attr_reader :total_donations
156
- attr_reader :icon
157
- attr_reader :mypage_url
158
- attr_reader :default_photo_url
159
- attr_reader :avatar_photo_url
67
+ attr_reader :participant_id, :event_year, :raw_display_name, :display_name, :team_name, :venue_name,
68
+ :event_title, :zip_code, :city, :state, :state_full, :participant_state, :participant_state_full,
69
+ :country, :country_full, :participant_country, :participant_country_full, :event_date, :event_id,
70
+ :is_website_allowed, :profile_id, :status_id, :event_status_id, :team_id,
71
+ :virtual_participation_date, :total_donations, :icon, :mypage_url, :default_photo_url,
72
+ :avatar_photo_url
160
73
  end
161
74
 
162
75
  class Fundraiser < SBF::Client::BaseEntity
163
- attr_reader :fundraiser_id
164
- attr_reader :event_year
165
- attr_reader :event_id
166
- attr_reader :event_status_id
167
- attr_reader :event_title
168
- attr_reader :team_id
169
- attr_reader :title
170
- attr_reader :status_id
171
- attr_reader :profile_id
172
- attr_reader :raw_display_name
173
- attr_reader :display_name
174
- attr_reader :start_date
175
- attr_reader :start_time
176
- attr_reader :end_date
177
- attr_reader :end_time
178
- attr_reader :zip_code
179
- attr_reader :venue_name
180
- attr_reader :team_name
181
- attr_reader :event_venue_name
182
- attr_reader :address1
183
- attr_reader :address2
184
- attr_reader :city
185
- attr_reader :state
186
- attr_reader :state_full
187
- attr_reader :country
188
- attr_reader :country_full
189
- attr_reader :total_donations
190
- attr_reader :icon
191
- attr_reader :mypage_url
192
- attr_reader :default_photo_url
193
- attr_reader :avatar_photo_url
76
+ attr_reader :fundraiser_id, :event_year, :event_id, :event_status_id, :event_title, :team_id, :title,
77
+ :status_id, :profile_id, :raw_display_name, :display_name, :start_date, :start_time, :end_date,
78
+ :end_time, :zip_code, :venue_name, :team_name, :event_venue_name, :address1, :address2, :city,
79
+ :state, :state_full, :country, :country_full, :total_donations, :icon, :mypage_url,
80
+ :default_photo_url, :avatar_photo_url
194
81
  end
195
82
 
196
83
  class Kid < SBF::Client::BaseEntity
197
- attr_reader :kid_id
198
- attr_reader :display_name
199
- attr_reader :city
200
- attr_reader :state
201
- attr_reader :state_full
202
- attr_reader :country_full
203
- attr_reader :country
204
- attr_reader :diagnosis_slug
205
- attr_reader :diagnosis_other
206
- attr_reader :status_id
207
- attr_reader :treatment_status_slug
208
- attr_reader :treatment_status_other
209
- attr_reader :mypage_url
210
- attr_reader :default_photo_url
211
- attr_reader :avatar_photo_url
84
+ attr_reader :kid_id, :display_name, :city, :state, :state_full, :country_full, :country, :diagnosis_slug,
85
+ :diagnosis_other, :status_id, :treatment_status_slug, :treatment_status_other, :mypage_url,
86
+ :default_photo_url, :avatar_photo_url
212
87
  end
213
88
 
214
89
  class Memorial < SBF::Client::BaseEntity
215
- attr_reader :memorial_id
216
- attr_reader :tribute_name
217
- attr_reader :display_name
218
- attr_reader :status_id
219
- attr_reader :city
220
- attr_reader :state
221
- attr_reader :state_full
222
- attr_reader :country_full
223
- attr_reader :country
224
- attr_reader :tribute_birthday
225
- attr_reader :tribute_date_of_passing
226
- attr_reader :expiration_date
227
- attr_reader :total_donations
228
- attr_reader :mypage_url
229
- attr_reader :default_photo_url
230
- attr_reader :avatar_photo_url
90
+ attr_reader :memorial_id, :tribute_name, :display_name, :status_id, :city, :state, :state_full, :country_full,
91
+ :country, :tribute_birthday, :tribute_date_of_passing, :expiration_date, :total_donations,
92
+ :mypage_url, :default_photo_url, :avatar_photo_url
231
93
  end
232
94
  end
233
95
  end
@@ -6,10 +6,7 @@ module SBF
6
6
  actions DEFAULT_CRUD_ACTIONS
7
7
 
8
8
  attr_reader :id
9
- attr_accessor :title
10
- attr_accessor :pages
11
- attr_accessor :parent_section
12
- attr_accessor :subsections
9
+ attr_accessor :title, :pages, :parent_section, :subsections
13
10
  end
14
11
  end
15
12
  end
@@ -31,23 +31,14 @@ module SBF
31
31
  SHAVEE = 'shavee'.freeze
32
32
  end
33
33
 
34
- attr_accessor :id
35
- attr_accessor :type
36
- attr_accessor :participant
37
- attr_accessor :is_notification_sent
38
- attr_accessor :shave_time
34
+ attr_accessor :id, :type, :participant, :is_notification_sent, :shave_time
39
35
  end
40
36
 
41
- attr_accessor :id
42
- attr_accessor :year
43
- attr_accessor :start_time
44
- attr_accessor :end_time
45
- attr_accessor :shave_duration_in_minutes
46
- attr_accessor :number_of_seats
47
- attr_accessor :is_published
37
+ attr_accessor :id, :year, :start_time, :end_time, :shave_duration_in_minutes, :number_of_seats, :is_published
38
+
48
39
  entity_attr_accessor :time_selection_permissions, 'SBF::Client::ShaveSchedule::TimeSelectionPermissions'
49
40
  entity_collection_attr_accessor :assignments, 'SBF::Client::ShaveSchedule::ShaveScheduleAssignment'
50
- entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
41
+ entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, optional: true
51
42
 
52
43
  def published?
53
44
  is_published