stbaldricks 12.15.0 → 15.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -38
  3. data/lib/stbaldricks/configuration.rb +2 -2
  4. data/lib/stbaldricks/default_logger.rb +2 -2
  5. data/lib/stbaldricks/endpoints/blog_post.rb +8 -8
  6. data/lib/stbaldricks/endpoints/communicate.rb +1 -1
  7. data/lib/stbaldricks/endpoints/config.rb +1 -1
  8. data/lib/stbaldricks/endpoints/deduplicator_match.rb +2 -2
  9. data/lib/stbaldricks/endpoints/fund.rb +1 -1
  10. data/lib/stbaldricks/endpoints/fundraiser.rb +1 -1
  11. data/lib/stbaldricks/endpoints/kid.rb +1 -1
  12. data/lib/stbaldricks/endpoints/lib/entity.rb +13 -11
  13. data/lib/stbaldricks/endpoints/newsletter_recipient.rb +11 -5
  14. data/lib/stbaldricks/endpoints/participant.rb +3 -3
  15. data/lib/stbaldricks/endpoints/photo.rb +5 -4
  16. data/lib/stbaldricks/endpoints/search.rb +2 -2
  17. data/lib/stbaldricks/endpoints/user.rb +1 -1
  18. data/lib/stbaldricks/entities/batch.rb +3 -5
  19. data/lib/stbaldricks/entities/blog_post.rb +1 -7
  20. data/lib/stbaldricks/entities/campaign.rb +6 -13
  21. data/lib/stbaldricks/entities/challenge.rb +4 -6
  22. data/lib/stbaldricks/entities/challenger.rb +4 -6
  23. data/lib/stbaldricks/entities/concerns/entity_response_concern.rb +2 -2
  24. data/lib/stbaldricks/entities/config.rb +3 -8
  25. data/lib/stbaldricks/entities/contact.rb +4 -7
  26. data/lib/stbaldricks/entities/contact_group.rb +2 -2
  27. data/lib/stbaldricks/entities/deduplicator_history.rb +1 -6
  28. data/lib/stbaldricks/entities/deduplicator_match.rb +4 -7
  29. data/lib/stbaldricks/entities/disease.rb +2 -5
  30. data/lib/stbaldricks/entities/document_library.rb +3 -8
  31. data/lib/stbaldricks/entities/document_library_category.rb +1 -4
  32. data/lib/stbaldricks/entities/donation/payment_type.rb +6 -5
  33. data/lib/stbaldricks/entities/donation.rb +13 -18
  34. data/lib/stbaldricks/entities/donor.rb +1 -5
  35. data/lib/stbaldricks/entities/event.rb +33 -44
  36. data/lib/stbaldricks/entities/event_application.rb +6 -10
  37. data/lib/stbaldricks/entities/event_donation_summary.rb +2 -5
  38. data/lib/stbaldricks/entities/event_participant_summary.rb +1 -3
  39. data/lib/stbaldricks/entities/event_supporter.rb +3 -3
  40. data/lib/stbaldricks/entities/fund.rb +6 -23
  41. data/lib/stbaldricks/entities/fundraiser.rb +16 -29
  42. data/lib/stbaldricks/entities/grant.rb +12 -25
  43. data/lib/stbaldricks/entities/institution.rb +3 -4
  44. data/lib/stbaldricks/entities/international_partner.rb +4 -16
  45. data/lib/stbaldricks/entities/kid.rb +12 -29
  46. data/lib/stbaldricks/entities/kid_honor.rb +1 -0
  47. data/lib/stbaldricks/entities/kid_institution.rb +2 -2
  48. data/lib/stbaldricks/entities/lib/address.rb +3 -6
  49. data/lib/stbaldricks/entities/lib/alternate_shipping_address.rb +1 -3
  50. data/lib/stbaldricks/entities/lib/base.rb +48 -40
  51. data/lib/stbaldricks/entities/lib/collection.rb +2 -2
  52. data/lib/stbaldricks/entities/lib/email_address.rb +1 -2
  53. data/lib/stbaldricks/entities/lib/fundraising_page.rb +1 -2
  54. data/lib/stbaldricks/entities/lib/location.rb +1 -0
  55. data/lib/stbaldricks/entities/lib/milestone.rb +1 -3
  56. data/lib/stbaldricks/entities/lib/name.rb +2 -2
  57. data/lib/stbaldricks/entities/lib/not_implemented_object.rb +1 -1
  58. data/lib/stbaldricks/entities/lib/payment.rb +25 -4
  59. data/lib/stbaldricks/entities/lib/permissions.rb +2 -4
  60. data/lib/stbaldricks/entities/lib/phone.rb +2 -3
  61. data/lib/stbaldricks/entities/lib/third_party_media.rb +1 -5
  62. data/lib/stbaldricks/entities/lib/top_level.rb +1 -1
  63. data/lib/stbaldricks/entities/matching_gift_company.rb +16 -39
  64. data/lib/stbaldricks/entities/memorial.rb +9 -14
  65. data/lib/stbaldricks/entities/message.rb +4 -15
  66. data/lib/stbaldricks/entities/organization.rb +11 -17
  67. data/lib/stbaldricks/entities/page.rb +9 -17
  68. data/lib/stbaldricks/entities/participant.rb +18 -28
  69. data/lib/stbaldricks/entities/participant_donation_summary.rb +2 -4
  70. data/lib/stbaldricks/entities/person.rb +24 -33
  71. data/lib/stbaldricks/entities/person_donation_by_year_summary.rb +1 -2
  72. data/lib/stbaldricks/entities/photo.rb +5 -11
  73. data/lib/stbaldricks/entities/recurring_gift.rb +10 -18
  74. data/lib/stbaldricks/entities/response.rb +1 -0
  75. data/lib/stbaldricks/entities/search.rb +30 -168
  76. data/lib/stbaldricks/entities/section.rb +1 -4
  77. data/lib/stbaldricks/entities/shave_schedule.rb +4 -13
  78. data/lib/stbaldricks/entities/summary.rb +1 -7
  79. data/lib/stbaldricks/entities/team.rb +12 -16
  80. data/lib/stbaldricks/entities/team_donation_summary.rb +2 -4
  81. data/lib/stbaldricks/request.rb +2 -2
  82. data/lib/stbaldricks/version.rb +1 -1
  83. metadata +85 -279
  84. data/lib/stbaldricks_factories.rb +0 -5
  85. data/spec/factories/address.rb +0 -14
  86. data/spec/factories/campaign/totals.rb +0 -9
  87. data/spec/factories/campaign.rb +0 -9
  88. data/spec/factories/challenge.rb +0 -19
  89. data/spec/factories/challenger.rb +0 -33
  90. data/spec/factories/collection.rb +0 -17
  91. data/spec/factories/contact.rb +0 -18
  92. data/spec/factories/contact_group.rb +0 -18
  93. data/spec/factories/diagnosis.rb +0 -12
  94. data/spec/factories/disease.rb +0 -11
  95. data/spec/factories/donation/participant.rb +0 -27
  96. data/spec/factories/donation.rb +0 -68
  97. data/spec/factories/donor.rb +0 -13
  98. data/spec/factories/email_address.rb +0 -11
  99. data/spec/factories/error.rb +0 -9
  100. data/spec/factories/event/coach_tracking/coaching_interactions.rb +0 -12
  101. data/spec/factories/event/coach_tracking/plaque.rb +0 -12
  102. data/spec/factories/event/coach_tracking/proceeds.rb +0 -12
  103. data/spec/factories/event/coach_tracking.rb +0 -18
  104. data/spec/factories/event/contacts/contact.rb +0 -17
  105. data/spec/factories/event/contacts/name_pieces.rb +0 -12
  106. data/spec/factories/event/contacts.rb +0 -16
  107. data/spec/factories/event/photos.rb +0 -12
  108. data/spec/factories/event/totals.rb +0 -15
  109. data/spec/factories/event/venue/location.rb +0 -18
  110. data/spec/factories/event/venue/social.rb +0 -16
  111. data/spec/factories/event/venue.rb +0 -16
  112. data/spec/factories/event.rb +0 -66
  113. data/spec/factories/event_application.rb +0 -34
  114. data/spec/factories/event_supporter.rb +0 -19
  115. data/spec/factories/fund.rb +0 -18
  116. data/spec/factories/fundraiser/photos.rb +0 -12
  117. data/spec/factories/fundraiser/policies.rb +0 -11
  118. data/spec/factories/fundraiser/totals.rb +0 -11
  119. data/spec/factories/fundraiser.rb +0 -24
  120. data/spec/factories/fundraising_page.rb +0 -29
  121. data/spec/factories/grant.rb +0 -22
  122. data/spec/factories/grant_institution.rb +0 -17
  123. data/spec/factories/institution.rb +0 -18
  124. data/spec/factories/kid/custom_institution.rb +0 -12
  125. data/spec/factories/kid.rb +0 -58
  126. data/spec/factories/kid_honor.rb +0 -16
  127. data/spec/factories/kid_institution.rb +0 -23
  128. data/spec/factories/lib/faker_patch.rb +0 -27
  129. data/spec/factories/lib/helpers.rb +0 -7
  130. data/spec/factories/location.rb +0 -17
  131. data/spec/factories/memorial/photos.rb +0 -14
  132. data/spec/factories/memorial/totals.rb +0 -11
  133. data/spec/factories/memorial/tribute.rb +0 -19
  134. data/spec/factories/memorial.rb +0 -22
  135. data/spec/factories/message.rb +0 -31
  136. data/spec/factories/milestone.rb +0 -15
  137. data/spec/factories/name_pieces.rb +0 -24
  138. data/spec/factories/newsletter_recipient.rb +0 -13
  139. data/spec/factories/organization/addresses.rb +0 -16
  140. data/spec/factories/organization/email_addresses.rb +0 -14
  141. data/spec/factories/organization/phone_numbers.rb +0 -14
  142. data/spec/factories/organization.rb +0 -34
  143. data/spec/factories/page.rb +0 -5
  144. data/spec/factories/participant/photos.rb +0 -14
  145. data/spec/factories/participant/policies.rb +0 -12
  146. data/spec/factories/participant/rankings/ranking.rb +0 -12
  147. data/spec/factories/participant/rankings.rb +0 -16
  148. data/spec/factories/participant/roles/role.rb +0 -154
  149. data/spec/factories/participant/roles.rb +0 -37
  150. data/spec/factories/participant/totals.rb +0 -11
  151. data/spec/factories/participant.rb +0 -95
  152. data/spec/factories/payment.rb +0 -13
  153. data/spec/factories/permissions.rb +0 -12
  154. data/spec/factories/person/addresses.rb +0 -16
  155. data/spec/factories/person/email_addresses.rb +0 -14
  156. data/spec/factories/person/phone_numbers.rb +0 -14
  157. data/spec/factories/person/policies.rb +0 -13
  158. data/spec/factories/person.rb +0 -22
  159. data/spec/factories/phone.rb +0 -11
  160. data/spec/factories/photo.rb +0 -11
  161. data/spec/factories/photos.rb +0 -9
  162. data/spec/factories/recurring_gift.rb +0 -22
  163. data/spec/factories/researcher.rb +0 -15
  164. data/spec/factories/response.rb +0 -38
  165. data/spec/factories/search_event.rb +0 -19
  166. data/spec/factories/search_fundraiser.rb +0 -15
  167. data/spec/factories/search_kid.rb +0 -13
  168. data/spec/factories/search_participant.rb +0 -15
  169. data/spec/factories/search_team.rb +0 -13
  170. data/spec/factories/shave_schedule/time_selection_permissions.rb +0 -12
  171. data/spec/factories/shave_schedule.rb +0 -33
  172. data/spec/factories/team/photos.rb +0 -12
  173. data/spec/factories/team/rankings/ranking.rb +0 -12
  174. data/spec/factories/team/rankings.rb +0 -15
  175. data/spec/factories/team/totals.rb +0 -14
  176. data/spec/factories/team.rb +0 -43
  177. data/spec/factories/third_party_media.rb +0 -12
  178. data/spec/factories/treatment_status.rb +0 -10
  179. data/spec/factories/user.rb +0 -14
  180. data/spec/factories/venue.rb +0 -15
@@ -27,13 +27,10 @@ module SBF
27
27
  ERROR_OUT_OF_SYNC_UPDATE = 'error_out_of_sync_update'.freeze
28
28
  end
29
29
 
30
- attr_accessor :id
31
- attr_accessor :checkout_id
32
- attr_accessor :status
33
- attr_accessor :date_created
34
- attr_accessor :date_modified
35
- entity_collection_attr_accessor :persons, 'SBF::Client::FullPerson', nil, true
36
- entity_collection_attr_accessor :organizations, 'SBF::Client::FullOrganization', nil, true
30
+ attr_accessor :id, :checkout_id, :status, :date_created, :date_modified
31
+
32
+ entity_collection_attr_accessor :persons, 'SBF::Client::FullPerson', nil, optional: true
33
+ entity_collection_attr_accessor :organizations, 'SBF::Client::FullOrganization', nil, optional: true
37
34
  end
38
35
  end
39
36
  end
@@ -13,11 +13,8 @@ module SBF
13
13
 
14
14
  disallow_instantiation
15
15
 
16
- attr_accessor :id
17
- attr_accessor :name
18
- attr_accessor :description
19
- attr_reader :created_at
20
- attr_reader :modified_at
16
+ attr_accessor :id, :name, :description
17
+ attr_reader :created_at, :modified_at
21
18
  end
22
19
  end
23
20
  end
@@ -6,14 +6,9 @@ module SBF
6
6
  class DocumentLibrary < SBF::Client::TopLevelEntity
7
7
  actions DEFAULT_CRUD_ACTIONS
8
8
 
9
- attr_accessor :id
10
- attr_accessor :type
11
- attr_accessor :title
12
- attr_accessor :description
13
- attr_accessor :url
14
- attr_accessor :media_storage_id
15
- attr_accessor :sort_order
16
- entity_attr_reader :category, 'SBF::Client::DocumentLibraryCategory', nil, true
9
+ attr_accessor :id, :type, :title, :description, :url, :media_storage_id, :sort_order
10
+
11
+ entity_attr_reader :category, 'SBF::Client::DocumentLibraryCategory', nil, optional: true
17
12
  end
18
13
  end
19
14
  end
@@ -5,10 +5,7 @@ module SBF
5
5
  class DocumentLibraryCategory < SBF::Client::TopLevelEntity
6
6
  actions DEFAULT_CRUD_ACTIONS
7
7
 
8
- attr_accessor :id
9
- attr_accessor :top_level_category
10
- attr_accessor :name
11
- attr_accessor :sort_order
8
+ attr_accessor :id, :top_level_category, :name, :sort_order
12
9
  end
13
10
  end
14
11
  end
@@ -10,19 +10,20 @@ module SBF
10
10
  CASH = 'cash'
11
11
  CHECK = 'check'
12
12
  CREDIT_CARD = 'credit_card'
13
+ CRYPTO = 'crypto'
13
14
  FACEBOOK = 'facebook'
14
15
  GOOGLE_PAY = 'google_pay'
16
+ INSTAGRAM = 'instagram'
15
17
  MONEY_ORDER = 'money_order'
18
+ NONCE = 'nonce'
16
19
  PAYPAL = 'paypal'
20
+ SQUARE = 'square'
21
+ STOCK = 'stock'
17
22
  STORED = 'stored'
18
23
  STRIPE = 'stripe'
19
24
  UNKNOWN = 'unknown'
20
- WIRE_TRANSFER = 'wire_transfer'
21
25
  VENMO = 'venmo'
22
- CRYPTO = 'crypto'
23
- SQUARE = 'square'
24
- STOCK = 'stock'
25
- INSTAGRAM = 'instagram'
26
+ WIRE_TRANSFER = 'wire_transfer'
26
27
  end
27
28
  end
28
29
  end
@@ -35,12 +35,14 @@ module SBF
35
35
 
36
36
  class EmployerMatched < SBF::Client::BaseEntity
37
37
  attr_accessor :is_match
38
+
38
39
  entity_attr_accessor :matching_donation, 'SBF::Client::FullDonation'
39
40
  end
40
41
 
41
42
  class Tribute < SBF::Client::BaseEntity
42
43
  attr_accessor :type
43
44
  attr_reader :name
45
+
44
46
  entity_attr_accessor :name_pieces, 'SBF::Client::NamePieces'
45
47
 
46
48
  module Type
@@ -124,8 +126,7 @@ module SBF
124
126
 
125
127
  class FullFund < SBF::Client::FullFund
126
128
  include ModelTypeConcern
127
- attr_reader :model_type
128
- attr_reader :direct_to_fund_donations_only
129
+ attr_reader :model_type, :direct_to_fund_donations_only
129
130
 
130
131
  def model_type
131
132
  SBF::Client::Donation::RecipientType::FUND
@@ -203,6 +204,7 @@ module SBF
203
204
  class RecognitionCard < SBF::Client::BaseEntity
204
205
  class Recipient < SBF::Client::BaseEntity
205
206
  attr_reader :name
207
+
206
208
  entity_attr_accessor :name_pieces, SBF::Client::NamePieces
207
209
  entity_attr_accessor :address, SBF::Client::Address
208
210
  end
@@ -250,7 +252,7 @@ module SBF
250
252
 
251
253
  # Get country and state from the person
252
254
  country = person.addresses.primary.country
253
- state = (country.to_sym == SBF::Client::Country.list[SBF::Client::Country::UNITED_STATES] ? person.addresses.primary.state : '')
255
+ state = ((country.to_sym == SBF::Client::Country.list[SBF::Client::Country::UNITED_STATES]) ? person.addresses.primary.state : '')
254
256
 
255
257
  else
256
258
  country = (defined?(entity.country).nil? ? nil : entity.country)
@@ -282,7 +284,7 @@ module SBF
282
284
 
283
285
  # Get country and state from the person
284
286
  country = person.addresses.primary.country
285
- state = (country.to_sym == SBF::Client::Country.list[SBF::Client::Country::UNITED_STATES] ? person.addresses.primary.state : '')
287
+ state = ((country.to_sym == SBF::Client::Country.list[SBF::Client::Country::UNITED_STATES]) ? person.addresses.primary.state : '')
286
288
 
287
289
  else
288
290
  country = (defined?(event.venue.location.address.country).nil? ? nil : event.venue.location.address.country)
@@ -298,13 +300,10 @@ module SBF
298
300
  class PartialDonation < SBF::Client::Donation
299
301
  attr_accessor :id
300
302
  end
303
+
301
304
  class FullDonation < SBF::Client::Donation
302
- attr_accessor :id
303
- attr_accessor :status
304
- attr_accessor :amount
305
- attr_accessor :fee_amount
306
- attr_accessor :display_name
307
- attr_accessor :year
305
+ attr_accessor :id, :status, :amount, :fee_amount, :display_name, :year, :is_unrecognized, :special_donation_type, :foreign_beneficiary_country,
306
+ :promotional_code, :collected_at, :created_at, :modified_at, :modified_by, :how_created, :is_thanked
308
307
  attr_reader :is_send_card
309
308
 
310
309
  multitype_attr_accessor(
@@ -348,7 +347,6 @@ module SBF
348
347
  optional: true
349
348
  )
350
349
 
351
- attr_accessor :is_unrecognized, :special_donation_type
352
350
  multitype_attr_accessor(
353
351
  :donor,
354
352
  [
@@ -395,8 +393,7 @@ module SBF
395
393
 
396
394
  entity_attr_accessor :employer_matching, 'SBF::Client::Donation::EmployerMatching'
397
395
  entity_attr_accessor :employer_matched, 'SBF::Client::Donation::EmployerMatched'
398
- attr_accessor :foreign_beneficiary_country
399
- attr_accessor :promotional_code
396
+
400
397
  entity_attr_accessor :recurring_gift, 'SBF::Client::FullRecurringGift'
401
398
  entity_attr_accessor :fund, 'SBF::Client::FullFund'
402
399
  entity_attr_accessor :memorial, 'SBF::Client::FullMemorial'
@@ -419,23 +416,21 @@ module SBF
419
416
  [->(v) { v[:type] == SBF::Client::Payment::Type::CRYPTO }, 'SBF::Client::Payment::CryptoDetails'],
420
417
  [->(v) { v[:type] == SBF::Client::Payment::Type::SQUARE }, 'SBF::Client::Payment::SquareDetails'],
421
418
  [->(v) { v[:type] == SBF::Client::Payment::Type::STOCK }, 'SBF::Client::Payment::StockDetails'],
419
+ [->(v) { v[:type] == SBF::Client::Payment::Type::STORED }, 'SBF::Client::Payment::StoredDetails'],
422
420
  [->(v) { v[:type] == SBF::Client::Payment::Type::INSTAGRAM }, 'SBF::Client::Payment::InstagramDetails']
423
421
  ]
424
422
  )
425
423
  entity_attr_accessor :tribute, 'SBF::Client::Donation::Tribute'
426
424
  entity_attr_accessor :recognition_card, 'SBF::Client::Donation::RecognitionCard'
427
- attr_accessor :collected_at
428
- attr_accessor :created_at, :modified_at, :modified_by, :how_created
429
- attr_accessor :is_thanked
430
425
 
431
426
  def amount=(value)
432
427
  amount_will_change!
433
- @amount = value.to_s.gsub(/[^0-9\.]/, '').to_f
428
+ @amount = value.to_s.gsub(/[^0-9.]/, '').to_f
434
429
  end
435
430
 
436
431
  def fee_amount=(value)
437
432
  fee_amount_will_change!
438
- @fee_amount = value.to_s.gsub(/[^0-9\.]/, '').to_f
433
+ @fee_amount = value.to_s.gsub(/[^0-9.]/, '').to_f
439
434
  end
440
435
  end
441
436
  end
@@ -6,11 +6,7 @@ module SBF
6
6
  action :find
7
7
  action :find_first
8
8
 
9
- attr_accessor :donor_name
10
- attr_accessor :amount
11
- attr_accessor :count
12
- attr_accessor :donation_created_at
13
- attr_accessor :donation_collected_at
9
+ attr_accessor :donor_name, :amount, :count, :donation_created_at, :donation_collected_at
14
10
  end
15
11
  end
16
12
  end
@@ -47,6 +47,7 @@ module SBF
47
47
  class Contacts < SBF::Client::BaseEntity
48
48
  class Contact < SBF::Client::BaseEntity
49
49
  attr_reader :name
50
+
50
51
  entity_attr_accessor :name_pieces, 'SBF::Client::Event::Contacts::NamePieces'
51
52
  entity_attr_accessor :phone, 'SBF::Client::Phone'
52
53
  entity_attr_accessor :email_address, 'SBF::Client::EmailAddress'
@@ -62,11 +63,9 @@ module SBF
62
63
 
63
64
  class Activity < SBF::Client::BaseEntity
64
65
  attr_reader :id
65
- entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', true
66
- attr_accessor :start_time
67
- attr_accessor :end_time
68
- attr_accessor :activity
69
- attr_accessor :sort_order
66
+
67
+ entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', optional: true
68
+ attr_accessor :start_time, :end_time, :activity, :sort_order
70
69
  end
71
70
 
72
71
  class CoachTracking < SBF::Client::BaseEntity
@@ -83,16 +82,16 @@ module SBF
83
82
  end
84
83
 
85
84
  attr_accessor :host_agreement_date, :activated_date, :proceeds, :coaching_interactions, :plaque
85
+
86
86
  entity_attr_accessor :proceeds, 'SBF::Client::Event::CoachTracking::Proceeds'
87
87
  entity_attr_accessor :coaching_interactions, 'SBF::Client::Event::CoachTracking::CoachingInteractions'
88
88
  entity_attr_accessor :plaque, 'SBF::Client::Event::CoachTracking::Plaque'
89
89
  end
90
90
 
91
91
  class Totals < SBF::Client::BaseEntity
92
- attr_reader :fundraisers, :participants, :shavees, :amount_raised
93
- attr_reader :current_year_ytd, :previous_year_ytd, :previous_year_total
94
- attr_reader :current_year_shavees_ytd, :previous_year_shavees_ytd, :previous_year_shavees_total
95
- attr_reader :cumulative_number_of_participants, :cumulative_number_of_shavees, :cumulative_fundraising, :number_of_active_event_years
92
+ attr_reader :fundraisers, :participants, :shavees, :amount_raised, :current_year_ytd, :previous_year_ytd, :previous_year_total,
93
+ :current_year_shavees_ytd, :previous_year_shavees_ytd, :previous_year_shavees_total, :cumulative_number_of_participants,
94
+ :cumulative_number_of_shavees, :cumulative_fundraising, :number_of_active_event_years
96
95
  end
97
96
 
98
97
  class Agreement < SBF::Client::BaseEntity
@@ -112,6 +111,7 @@ module SBF
112
111
  end
113
112
 
114
113
  attr_accessor :agreement_received_date
114
+
115
115
  entity_collection_attr_accessor :questions, 'SBF::Client::Event::Agreement::Question'
116
116
  end
117
117
 
@@ -134,13 +134,13 @@ module SBF
134
134
  HYBRID = 'hybrid'.freeze
135
135
  end
136
136
 
137
- attr_accessor :type
138
- attr_accessor :type_other
137
+ attr_accessor :type, :type_other
139
138
  end
140
139
 
141
140
  entity_attr_accessor :location, 'SBF::Client::Event::Venue::Location'
142
141
  entity_attr_accessor :phone, 'SBF::Client::Phone'
143
142
  attr_accessor :website_url
143
+
144
144
  entity_attr_accessor :social, 'SBF::Client::Event::Venue::Social'
145
145
  end
146
146
  end
@@ -158,43 +158,32 @@ module SBF
158
158
  extend Forwardable
159
159
  def_delegator :@photos, :avatar, :avatar_photo_url
160
160
 
161
- attr_accessor :id, :year
162
- attr_accessor :status
163
- attr_reader :display_name
164
- attr_accessor :event_title
165
- attr_accessor :type
166
- attr_accessor :type_other
167
- attr_accessor :sub_type
168
- attr_accessor :is_private
169
- attr_accessor :date, :is_date_confirmed
170
- attr_accessor :start_time, :end_time, :is_time_confirmed
171
- attr_accessor :is_open_for_registration, :is_open_for_fast_registration
172
- attr_accessor :offline_donation_uuid, :offline_donation_form
173
- attr_accessor :fundraising_goal, :fundraising_message
161
+ attr_accessor :id, :year, :status, :event_title, :type, :type_other, :sub_type, :is_private, :date,
162
+ :is_date_confirmed, :start_time, :end_time, :is_time_confirmed, :is_open_for_registration,
163
+ :is_open_for_fast_registration, :offline_donation_uuid, :offline_donation_form, :fundraising_goal,
164
+ :fundraising_message, :modified_by, :how_created, :promotional_code, :fund_relationship_type
165
+ attr_reader :display_name, :created_at, :modified_at
166
+
174
167
  entity_attr_accessor :geo_location, 'SBF::Client::GeoLocation'
175
- entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, true
176
- entity_attr_accessor :campaign, 'SBF::Client::FullCampaign', 'SBF::Client::PartialCampaign', true
177
- entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
168
+ entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, optional: true
169
+ entity_attr_accessor :campaign, 'SBF::Client::FullCampaign', 'SBF::Client::PartialCampaign', optional: true
170
+ entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', optional: true
178
171
  entity_attr_accessor :venue, 'SBF::Client::Event::Venue'
179
172
  entity_attr_accessor :photos, 'SBF::Client::Event::Photos'
180
- entity_attr_accessor :contacts, 'SBF::Client::Event::Contacts', nil, true
173
+ entity_attr_accessor :contacts, 'SBF::Client::Event::Contacts', nil, optional: true
181
174
  entity_attr_accessor :coach_tracking, 'SBF::Client::Event::CoachTracking'
182
- entity_attr_accessor :shave_schedule, 'SBF::Client::ShaveSchedule', nil, true
183
- entity_attr_reader :totals, 'SBF::Client::Event::Totals', nil, true
184
- entity_collection_attr_accessor :coaches, 'SBF::Client::FullPerson', nil, true
185
- entity_collection_attr_accessor :closed_roles, 'SBF::Client::Participant::Roles::Type', nil, true
186
- attr_reader :created_at, :modified_at
187
- attr_accessor :modified_by
188
- attr_accessor :how_created
189
- attr_accessor :promotional_code
190
- entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
191
- entity_attr_reader :agreement, 'SBF::Client::Event::Agreement', nil, true
192
- entity_collection_attr_accessor :organizers, 'SBF::Client::FullParticipant', nil, true
193
- entity_collection_attr_accessor :treasurers, 'SBF::Client::FullParticipant', nil, true
194
- entity_collection_attr_accessor :activities, 'SBF::Client::Event::Activity', nil, true
195
- entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, true
196
- entity_collection_attr_accessor :supporters, 'SBF::Client::FullEventSupporter', nil, true
197
- attr_accessor :fund_relationship_type
175
+ entity_attr_accessor :shave_schedule, 'SBF::Client::ShaveSchedule', nil, optional: true
176
+ entity_attr_reader :totals, 'SBF::Client::Event::Totals', nil, optional: true
177
+ entity_collection_attr_accessor :coaches, 'SBF::Client::FullPerson', nil, optional: true
178
+ entity_collection_attr_accessor :closed_roles, 'SBF::Client::Participant::Roles::Type', nil, optional: true
179
+
180
+ entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, optional: true
181
+ entity_attr_reader :agreement, 'SBF::Client::Event::Agreement', nil, optional: true
182
+ entity_collection_attr_accessor :organizers, 'SBF::Client::FullParticipant', nil, optional: true
183
+ entity_collection_attr_accessor :treasurers, 'SBF::Client::FullParticipant', nil, optional: true
184
+ entity_collection_attr_accessor :activities, 'SBF::Client::Event::Activity', nil, optional: true
185
+ entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, optional: true
186
+ entity_collection_attr_accessor :supporters, 'SBF::Client::FullEventSupporter', nil, optional: true
198
187
 
199
188
  def active?
200
189
  status == SBF::Client::Event::Status::ACTIVE
@@ -93,23 +93,19 @@ module SBF
93
93
 
94
94
  class Requestor < SBF::Client::BaseEntity
95
95
  attr_accessor :name
96
+
96
97
  entity_attr_accessor :name_pieces, 'SBF::Client::NamePieces'
97
98
  entity_attr_accessor :email_address, 'SBF::Client::EmailAddress'
98
99
  entity_attr_accessor :phone, 'SBF::Client::Phone'
99
100
  entity_attr_accessor :address, 'SBF::Client::Address'
100
101
  end
101
102
 
102
- attr_accessor :id
103
- attr_accessor :requested_event_title
104
- attr_accessor :status
105
- attr_accessor :is_archived
106
- attr_accessor :no_conversion_reason
107
- attr_accessor :promotional_code
108
- attr_accessor :created_at, :modified_at
103
+ attr_accessor :id, :requested_event_title, :status, :is_archived, :no_conversion_reason, :promotional_code, :created_at, :modified_at
104
+
109
105
  entity_attr_accessor :requestor, 'SBF::Client::EventApplication::Requestor'
110
- entity_attr_accessor :qualifier, 'SBF::Client::FullPerson', 'SBF::Client::PartialPerson', true
111
- entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
112
- entity_attr_accessor :campaign, 'SBF::Client::FullCampaign', 'SBF::Client::PartialCampaign', true
106
+ entity_attr_accessor :qualifier, 'SBF::Client::FullPerson', 'SBF::Client::PartialPerson', optional: true
107
+ entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', optional: true
108
+ entity_attr_accessor :campaign, 'SBF::Client::FullCampaign', 'SBF::Client::PartialCampaign', optional: true
113
109
 
114
110
  multitype_attr_accessor(
115
111
  :model,
@@ -9,12 +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 :direct_amount_raised
15
- attr_accessor :direct_donations
12
+ attr_accessor :amount_raised, :donations, :direct_amount_raised, :direct_donations
16
13
 
17
- entity_attr_reader :event, 'SBF::Client::FullEvent', nil, true
14
+ entity_attr_reader :event, 'SBF::Client::FullEvent', nil, optional: true
18
15
  end
19
16
  end
20
17
  end
@@ -9,9 +9,7 @@ module SBF
9
9
  blacklist_action :update
10
10
  blacklist_action :delete
11
11
 
12
- attr_accessor :shavees
13
- attr_accessor :non_shavees
14
- attr_accessor :participants
12
+ attr_accessor :shavees, :non_shavees, :participants
15
13
  end
16
14
  end
17
15
  end
@@ -15,10 +15,10 @@ module SBF
15
15
  end
16
16
 
17
17
  class FullEventSupporter < EventSupporter
18
- attr_accessor :photo_url
19
- attr_accessor :name, :url
18
+ attr_accessor :photo_url, :name, :url
20
19
  attr_reader :created_at, :modified_at
21
- entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', true
20
+
21
+ entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', optional: true
22
22
  entity_attr_accessor :photo, 'SBF::Client::Photo'
23
23
  end
24
24
  end
@@ -31,14 +31,7 @@ module SBF
31
31
  end
32
32
 
33
33
  class YearlyTotals < SBF::Client::BaseEntity
34
- attr_reader :year
35
- attr_reader :fundraisers
36
- attr_reader :participants
37
- attr_reader :shavees
38
- attr_reader :non_shavees
39
- attr_reader :teams
40
- attr_reader :events
41
- attr_reader :amount_raised
34
+ attr_reader :year, :fundraisers, :participants, :shavees, :non_shavees, :teams, :events, :amount_raised
42
35
 
43
36
  def to_hash
44
37
  {}.tap do |hsh|
@@ -48,13 +41,7 @@ module SBF
48
41
  end
49
42
 
50
43
  class Totals < SBF::Client::BaseEntity
51
- attr_reader :fundraisers
52
- attr_reader :participants
53
- attr_reader :shavees
54
- attr_reader :non_shavees
55
- attr_reader :teams
56
- attr_reader :events
57
- attr_reader :amount_raised
44
+ attr_reader :fundraisers, :participants, :shavees, :non_shavees, :teams, :events, :amount_raised
58
45
  end
59
46
 
60
47
  class Photos < SBF::Client::BaseEntity
@@ -67,18 +54,14 @@ module SBF
67
54
  end
68
55
 
69
56
  class FullFund < Fund
70
- attr_accessor :id
57
+ attr_accessor :id, :name, :disabled, :description, :kid_name, :offline_donation_uuid, :offline_donation_form
71
58
  attr_reader :display_name
72
- attr_accessor :name
73
- attr_accessor :disabled
74
- attr_accessor :description
59
+
75
60
  entity_attr_accessor :photos, 'SBF::Client::Fund::Photos'
76
61
  entity_attr_reader :totals, 'SBF::Client::Fund::Totals'
77
62
  entity_collection_attr_accessor :totals_by_year, 'SBF::Client::Fund::Total'
78
- entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, true
63
+ entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, optional: true
79
64
  entity_attr_accessor :photos, 'SBF::Client::Fund::Photos'
80
- attr_accessor :kid_name
81
- attr_accessor :offline_donation_uuid, :offline_donation_form
82
65
 
83
66
  multitype_attr_accessor(
84
67
  :manager,
@@ -110,7 +93,7 @@ module SBF
110
93
 
111
94
  totals_by_year_will_change!
112
95
  @totals_by_year = value.map do |k, v|
113
- SBF::Client::Fund::YearlyTotals.new(v.merge(year: k.to_s.to_i))
96
+ SBF::Client::Fund::YearlyTotals.new(v.merge(year: k.to_s.to_i), clear_changes: false)
114
97
  end
115
98
  end
116
99
 
@@ -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
 
74
73
  class Rankings < SBF::Client::BaseEntity
@@ -93,8 +92,8 @@ module SBF
93
92
  end
94
93
  end
95
94
 
96
- def dirty_data(with_keys = false)
97
- data = super(with_keys)
95
+ def dirty_data(with_keys: false)
96
+ data = super(with_keys: with_keys)
98
97
  data[:event].delete(:id) if data[:event] && data[:event][:id].nil?
99
98
  data
100
99
  end
@@ -108,39 +107,27 @@ module SBF
108
107
  extend Forwardable
109
108
  def_delegator :@photos, :avatar, :avatar_photo_url
110
109
 
111
- attr_accessor :id
110
+ attr_accessor :id, :category, :display_name_override, :facebook_fundraiser_id, :fund_relationship_type,
111
+ :fundraising_goal, :fundraising_message, :how_created, :modified_by, :offline_donation_uuid,
112
+ :offline_donation_form, :start_date, :end_date, :start_time, :end_time, :status, :title
113
+
114
+ attr_reader :created_at, :modified_at, :display_name
112
115
 
113
- attr_reader :created_at, :modified_at
114
- attr_reader :display_name
115
-
116
- attr_accessor :category
117
- attr_accessor :display_name_override
118
- attr_accessor :facebook_fundraiser_id
119
- attr_accessor :fund_relationship_type
120
- attr_accessor :fundraising_goal, :fundraising_message
121
- attr_accessor :how_created
122
- attr_accessor :modified_by
123
- attr_accessor :offline_donation_uuid, :offline_donation_form
124
- attr_accessor :start_date, :end_date
125
- attr_accessor :start_time, :end_time
126
- attr_accessor :status
127
- attr_accessor :title
128
-
129
- entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
130
- entity_attr_reader :rankings, 'SBF::Client::Fundraiser::Rankings', nil, true
116
+ entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, optional: true
117
+ entity_attr_reader :rankings, 'SBF::Client::Fundraiser::Rankings', nil, optional: true
131
118
  entity_attr_reader :totals, 'SBF::Client::Fundraiser::Totals'
132
119
 
133
- entity_attr_accessor :event, 'SBF::Client::Fundraiser::FullEvent', 'SBF::Client::Fundraiser::PartialEvent', true
134
- entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
135
- entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, true
120
+ entity_attr_accessor :event, 'SBF::Client::Fundraiser::FullEvent', 'SBF::Client::Fundraiser::PartialEvent', optional: true
121
+ entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', optional: true
122
+ entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, optional: true
136
123
  entity_attr_accessor :owner, 'SBF::Client::FullPerson', 'SBF::Client::PartialPerson'
137
124
  entity_attr_accessor :photos, 'SBF::Client::Fundraiser::Photos'
138
125
  entity_attr_accessor :policies, 'SBF::Client::Fundraiser::Policies'
139
- entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', true
140
- entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, true
126
+ entity_attr_accessor :team, 'SBF::Client::FullTeam', 'SBF::Client::PartialTeam', optional: true
127
+ entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, optional: true
141
128
  entity_attr_accessor :venue, 'SBF::Client::Venue'
142
129
 
143
- entity_collection_attr_accessor :milestones, 'SBF::Client::Milestone', nil, true
130
+ entity_collection_attr_accessor :milestones, 'SBF::Client::Milestone', nil, optional: true
144
131
 
145
132
  def active?
146
133
  status == SBF::Client::Fundraiser::Status::ACTIVE
@@ -22,13 +22,10 @@ module SBF
22
22
  end
23
23
 
24
24
  class FullResearcher < SBF::Client::BaseEntity
25
- attr_accessor :id
26
- attr_reader :display_name
27
- attr_accessor :description
28
- attr_accessor :photo_url
25
+ attr_accessor :id, :description, :photo_url
26
+ attr_reader :display_name, :created_at, :modified_at
27
+
29
28
  entity_attr_accessor :name_pieces, 'SBF::Client::NamePieces'
30
- attr_reader :created_at
31
- attr_reader :modified_at
32
29
  end
33
30
 
34
31
  class PartialFundingType < SBF::Client::BaseEntity
@@ -36,11 +33,8 @@ module SBF
36
33
  end
37
34
 
38
35
  class FullFundingType < SBF::Client::BaseEntity
39
- attr_accessor :id
40
- attr_accessor :name
41
- attr_accessor :description
42
- attr_reader :created_at
43
- attr_reader :modified_at
36
+ attr_accessor :id, :name, :description
37
+ attr_reader :created_at, :modified_at
44
38
  end
45
39
 
46
40
  class PartialInstitution < SBF::Client::PartialInstitution; end
@@ -55,20 +49,13 @@ module SBF
55
49
  end
56
50
 
57
51
  class FullGrant < SBF::Client::Grant
58
- attr_accessor :id
59
- attr_accessor :name
60
- attr_accessor :funding_begin_date
61
- attr_accessor :funding_end_date
62
- attr_accessor :web_message
63
- attr_accessor :article_url
64
- attr_accessor :amount
65
- entity_attr_accessor :researcher, 'SBF::Client::Grant::FullResearcher', 'SBF::Client::Grant::PartialResearcher', true
66
- entity_attr_accessor :institution, 'SBF::Client::Grant::FullInstitution', 'SBF::Client::Grant::PartialInstitution', true
67
- entity_attr_accessor :funding_type, 'SBF::Client::Grant::FullFundingType', 'SBF::Client::Grant::PartialFundingType', true
68
- entity_collection_attr_accessor :diseases, 'SBF::Client::Grant::Disease', nil, true
69
- attr_reader :photo_url
70
- attr_reader :created_at
71
- attr_reader :modified_at
52
+ attr_accessor :id, :name, :funding_begin_date, :funding_end_date, :web_message, :article_url, :amount
53
+
54
+ entity_attr_accessor :researcher, 'SBF::Client::Grant::FullResearcher', 'SBF::Client::Grant::PartialResearcher', optional: true
55
+ entity_attr_accessor :institution, 'SBF::Client::Grant::FullInstitution', 'SBF::Client::Grant::PartialInstitution', optional: true
56
+ entity_attr_accessor :funding_type, 'SBF::Client::Grant::FullFundingType', 'SBF::Client::Grant::PartialFundingType', optional: true
57
+ entity_collection_attr_accessor :diseases, 'SBF::Client::Grant::Disease', nil, optional: true
58
+ attr_reader :photo_url, :created_at, :modified_at
72
59
  end
73
60
  end
74
61
  end
@@ -19,11 +19,10 @@ module SBF
19
19
  class PartialInstitution < SBF::Client::Institution; end
20
20
 
21
21
  class FullInstitution < SBF::Client::Institution
22
- attr_accessor :name
22
+ attr_accessor :name, :institution_info
23
+
23
24
  entity_attr_accessor :address, 'SBF::Client::Address'
24
- attr_reader :created_at
25
- attr_reader :modified_at
26
- attr_accessor :institution_info
25
+ attr_reader :created_at, :modified_at
27
26
  end
28
27
  end
29
28
  end