stbaldricks 12.15.0.alpha.1 → 12.15.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stbaldricks/configuration.rb +2 -2
- data/lib/stbaldricks/default_logger.rb +2 -2
- data/lib/stbaldricks/endpoints/blog_post.rb +8 -8
- data/lib/stbaldricks/endpoints/communicate.rb +1 -1
- data/lib/stbaldricks/endpoints/config.rb +1 -1
- data/lib/stbaldricks/endpoints/deduplicator_match.rb +2 -2
- data/lib/stbaldricks/endpoints/kid.rb +1 -1
- data/lib/stbaldricks/endpoints/lib/entity.rb +11 -13
- data/lib/stbaldricks/endpoints/newsletter_recipient.rb +5 -11
- data/lib/stbaldricks/endpoints/participant.rb +3 -3
- data/lib/stbaldricks/endpoints/photo.rb +4 -5
- data/lib/stbaldricks/endpoints/search.rb +2 -2
- data/lib/stbaldricks/endpoints/user.rb +1 -1
- data/lib/stbaldricks/entities/batch.rb +5 -3
- data/lib/stbaldricks/entities/blog_post.rb +7 -1
- data/lib/stbaldricks/entities/campaign.rb +13 -6
- data/lib/stbaldricks/entities/challenge.rb +6 -4
- data/lib/stbaldricks/entities/challenger.rb +6 -4
- data/lib/stbaldricks/entities/concerns/entity_response_concern.rb +1 -1
- data/lib/stbaldricks/entities/config.rb +8 -3
- data/lib/stbaldricks/entities/contact.rb +7 -4
- data/lib/stbaldricks/entities/contact_group.rb +2 -2
- data/lib/stbaldricks/entities/deduplicator_history.rb +6 -1
- data/lib/stbaldricks/entities/deduplicator_match.rb +7 -4
- data/lib/stbaldricks/entities/disease.rb +5 -2
- data/lib/stbaldricks/entities/document_library.rb +8 -3
- data/lib/stbaldricks/entities/document_library_category.rb +4 -1
- data/lib/stbaldricks/entities/donation/payment_gateway.rb +5 -0
- data/lib/stbaldricks/entities/donation/payment_type.rb +4 -0
- data/lib/stbaldricks/entities/donation.rb +23 -13
- data/lib/stbaldricks/entities/donor.rb +5 -1
- data/lib/stbaldricks/entities/event.rb +44 -33
- data/lib/stbaldricks/entities/event_application.rb +10 -6
- data/lib/stbaldricks/entities/event_donation_summary.rb +5 -2
- data/lib/stbaldricks/entities/event_participant_summary.rb +3 -1
- data/lib/stbaldricks/entities/event_supporter.rb +3 -3
- data/lib/stbaldricks/entities/fund.rb +23 -6
- data/lib/stbaldricks/entities/fundraiser.rb +29 -16
- data/lib/stbaldricks/entities/grant.rb +25 -12
- data/lib/stbaldricks/entities/institution.rb +4 -3
- data/lib/stbaldricks/entities/international_partner.rb +16 -4
- data/lib/stbaldricks/entities/kid.rb +28 -11
- data/lib/stbaldricks/entities/kid_honor.rb +0 -1
- data/lib/stbaldricks/entities/kid_institution.rb +2 -2
- data/lib/stbaldricks/entities/lib/address.rb +6 -3
- data/lib/stbaldricks/entities/lib/alternate_shipping_address.rb +3 -1
- data/lib/stbaldricks/entities/lib/base.rb +39 -47
- data/lib/stbaldricks/entities/lib/collection.rb +2 -2
- data/lib/stbaldricks/entities/lib/email_address.rb +2 -1
- data/lib/stbaldricks/entities/lib/fundraising_page.rb +2 -1
- data/lib/stbaldricks/entities/lib/location.rb +0 -1
- data/lib/stbaldricks/entities/lib/milestone.rb +3 -1
- data/lib/stbaldricks/entities/lib/name.rb +2 -2
- data/lib/stbaldricks/entities/lib/not_implemented_object.rb +1 -1
- data/lib/stbaldricks/entities/lib/payment.rb +33 -0
- data/lib/stbaldricks/entities/lib/permissions.rb +4 -2
- data/lib/stbaldricks/entities/lib/phone.rb +3 -2
- data/lib/stbaldricks/entities/lib/third_party_media.rb +5 -1
- data/lib/stbaldricks/entities/lib/top_level.rb +1 -1
- data/lib/stbaldricks/entities/matching_gift_company.rb +39 -16
- data/lib/stbaldricks/entities/memorial.rb +14 -9
- data/lib/stbaldricks/entities/message.rb +15 -4
- data/lib/stbaldricks/entities/organization.rb +17 -11
- data/lib/stbaldricks/entities/page.rb +17 -8
- data/lib/stbaldricks/entities/participant.rb +28 -18
- data/lib/stbaldricks/entities/participant_donation_summary.rb +4 -2
- data/lib/stbaldricks/entities/person.rb +31 -22
- data/lib/stbaldricks/entities/person_donation_by_year_summary.rb +2 -1
- data/lib/stbaldricks/entities/photo.rb +11 -5
- data/lib/stbaldricks/entities/recurring_gift.rb +18 -10
- data/lib/stbaldricks/entities/response.rb +0 -1
- data/lib/stbaldricks/entities/search.rb +168 -30
- data/lib/stbaldricks/entities/section.rb +4 -1
- data/lib/stbaldricks/entities/shave_schedule.rb +13 -4
- data/lib/stbaldricks/entities/summary.rb +7 -1
- data/lib/stbaldricks/entities/team.rb +16 -12
- data/lib/stbaldricks/entities/team_donation_summary.rb +4 -2
- data/lib/stbaldricks/request.rb +2 -2
- data/lib/stbaldricks/version.rb +1 -1
- data/lib/stbaldricks_factories.rb +5 -0
- data/spec/factories/address.rb +14 -0
- data/spec/factories/campaign/totals.rb +9 -0
- data/spec/factories/campaign.rb +9 -0
- data/spec/factories/challenge.rb +19 -0
- data/spec/factories/challenger.rb +33 -0
- data/spec/factories/collection.rb +17 -0
- data/spec/factories/contact.rb +18 -0
- data/spec/factories/contact_group.rb +18 -0
- data/spec/factories/diagnosis.rb +12 -0
- data/spec/factories/disease.rb +11 -0
- data/spec/factories/donation/participant.rb +27 -0
- data/spec/factories/donation.rb +68 -0
- data/spec/factories/donor.rb +13 -0
- data/spec/factories/email_address.rb +11 -0
- data/spec/factories/error.rb +9 -0
- data/spec/factories/event/coach_tracking/coaching_interactions.rb +12 -0
- data/spec/factories/event/coach_tracking/plaque.rb +12 -0
- data/spec/factories/event/coach_tracking/proceeds.rb +12 -0
- data/spec/factories/event/coach_tracking.rb +18 -0
- data/spec/factories/event/contacts/contact.rb +17 -0
- data/spec/factories/event/contacts/name_pieces.rb +12 -0
- data/spec/factories/event/contacts.rb +16 -0
- data/spec/factories/event/photos.rb +12 -0
- data/spec/factories/event/totals.rb +15 -0
- data/spec/factories/event/venue/location.rb +18 -0
- data/spec/factories/event/venue/social.rb +16 -0
- data/spec/factories/event/venue.rb +16 -0
- data/spec/factories/event.rb +66 -0
- data/spec/factories/event_application.rb +34 -0
- data/spec/factories/event_supporter.rb +19 -0
- data/spec/factories/fund.rb +18 -0
- data/spec/factories/fundraiser/photos.rb +12 -0
- data/spec/factories/fundraiser/policies.rb +11 -0
- data/spec/factories/fundraiser/totals.rb +11 -0
- data/spec/factories/fundraiser.rb +24 -0
- data/spec/factories/fundraising_page.rb +29 -0
- data/spec/factories/grant.rb +22 -0
- data/spec/factories/grant_institution.rb +17 -0
- data/spec/factories/institution.rb +18 -0
- data/spec/factories/kid/custom_institution.rb +12 -0
- data/spec/factories/kid.rb +58 -0
- data/spec/factories/kid_honor.rb +16 -0
- data/spec/factories/kid_institution.rb +23 -0
- data/spec/factories/lib/faker_patch.rb +27 -0
- data/spec/factories/lib/helpers.rb +7 -0
- data/spec/factories/location.rb +17 -0
- data/spec/factories/memorial/photos.rb +14 -0
- data/spec/factories/memorial/totals.rb +11 -0
- data/spec/factories/memorial/tribute.rb +19 -0
- data/spec/factories/memorial.rb +22 -0
- data/spec/factories/message.rb +31 -0
- data/spec/factories/milestone.rb +15 -0
- data/spec/factories/name_pieces.rb +24 -0
- data/spec/factories/newsletter_recipient.rb +13 -0
- data/spec/factories/organization/addresses.rb +16 -0
- data/spec/factories/organization/email_addresses.rb +14 -0
- data/spec/factories/organization/phone_numbers.rb +14 -0
- data/spec/factories/organization.rb +34 -0
- data/spec/factories/page.rb +5 -0
- data/spec/factories/participant/photos.rb +14 -0
- data/spec/factories/participant/policies.rb +12 -0
- data/spec/factories/participant/rankings/ranking.rb +12 -0
- data/spec/factories/participant/rankings.rb +16 -0
- data/spec/factories/participant/roles/role.rb +154 -0
- data/spec/factories/participant/roles.rb +37 -0
- data/spec/factories/participant/totals.rb +11 -0
- data/spec/factories/participant.rb +95 -0
- data/spec/factories/payment.rb +13 -0
- data/spec/factories/permissions.rb +12 -0
- data/spec/factories/person/addresses.rb +16 -0
- data/spec/factories/person/email_addresses.rb +14 -0
- data/spec/factories/person/phone_numbers.rb +14 -0
- data/spec/factories/person/policies.rb +13 -0
- data/spec/factories/person.rb +22 -0
- data/spec/factories/phone.rb +11 -0
- data/spec/factories/photo.rb +11 -0
- data/spec/factories/photos.rb +9 -0
- data/spec/factories/recurring_gift.rb +22 -0
- data/spec/factories/researcher.rb +15 -0
- data/spec/factories/response.rb +38 -0
- data/spec/factories/search_event.rb +19 -0
- data/spec/factories/search_fundraiser.rb +15 -0
- data/spec/factories/search_kid.rb +13 -0
- data/spec/factories/search_participant.rb +15 -0
- data/spec/factories/search_team.rb +13 -0
- data/spec/factories/shave_schedule/time_selection_permissions.rb +12 -0
- data/spec/factories/shave_schedule.rb +33 -0
- data/spec/factories/team/photos.rb +12 -0
- data/spec/factories/team/rankings/ranking.rb +12 -0
- data/spec/factories/team/rankings.rb +15 -0
- data/spec/factories/team/totals.rb +14 -0
- data/spec/factories/team.rb +43 -0
- data/spec/factories/third_party_media.rb +12 -0
- data/spec/factories/treatment_status.rb +10 -0
- data/spec/factories/user.rb +14 -0
- data/spec/factories/venue.rb +15 -0
- metadata +275 -81
@@ -39,57 +39,195 @@ module SBF
|
|
39
39
|
end
|
40
40
|
|
41
41
|
class Fund < SBF::Client::BaseEntity
|
42
|
-
attr_reader :fund_id
|
43
|
-
|
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
|
44
55
|
end
|
45
56
|
|
46
57
|
class Campaign < SBF::Client::BaseEntity
|
47
|
-
attr_reader :campaign_id
|
48
|
-
|
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
|
49
69
|
end
|
50
70
|
|
51
71
|
class Event < SBF::Client::BaseEntity
|
52
|
-
attr_reader :venue_name
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
57
100
|
end
|
58
101
|
|
59
102
|
class Team < SBF::Client::BaseEntity
|
60
|
-
attr_reader :team_name
|
61
|
-
|
62
|
-
|
63
|
-
|
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
|
64
127
|
end
|
65
128
|
|
66
129
|
class Participant < SBF::Client::BaseEntity
|
67
|
-
attr_reader :participant_id
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
73
160
|
end
|
74
161
|
|
75
162
|
class Fundraiser < SBF::Client::BaseEntity
|
76
|
-
attr_reader :fundraiser_id
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
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
|
81
194
|
end
|
82
195
|
|
83
196
|
class Kid < SBF::Client::BaseEntity
|
84
|
-
attr_reader :kid_id
|
85
|
-
|
86
|
-
|
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
|
87
212
|
end
|
88
213
|
|
89
214
|
class Memorial < SBF::Client::BaseEntity
|
90
|
-
attr_reader :memorial_id
|
91
|
-
|
92
|
-
|
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
|
93
231
|
end
|
94
232
|
end
|
95
233
|
end
|
@@ -31,14 +31,23 @@ module SBF
|
|
31
31
|
SHAVEE = 'shavee'.freeze
|
32
32
|
end
|
33
33
|
|
34
|
-
attr_accessor :id
|
34
|
+
attr_accessor :id
|
35
|
+
attr_accessor :type
|
36
|
+
attr_accessor :participant
|
37
|
+
attr_accessor :is_notification_sent
|
38
|
+
attr_accessor :shave_time
|
35
39
|
end
|
36
40
|
|
37
|
-
attr_accessor :id
|
38
|
-
|
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
|
39
48
|
entity_attr_accessor :time_selection_permissions, 'SBF::Client::ShaveSchedule::TimeSelectionPermissions'
|
40
49
|
entity_collection_attr_accessor :assignments, 'SBF::Client::ShaveSchedule::ShaveScheduleAssignment'
|
41
|
-
entity_attr_reader :permissions, 'SBF::Client::Permissions', nil,
|
50
|
+
entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
|
42
51
|
|
43
52
|
def published?
|
44
53
|
is_published
|
@@ -19,7 +19,13 @@ module SBF
|
|
19
19
|
entity_attr_reader :weekly_totals, 'SBF::Client::Summary::Totals'
|
20
20
|
|
21
21
|
class Totals < SBF::Client::BaseEntity
|
22
|
-
attr_reader :donations
|
22
|
+
attr_reader :donations
|
23
|
+
attr_reader :events
|
24
|
+
attr_reader :male_shavees
|
25
|
+
attr_reader :female_shavees
|
26
|
+
attr_reader :barbers
|
27
|
+
attr_reader :participants
|
28
|
+
attr_reader :fundraisers
|
23
29
|
end
|
24
30
|
end
|
25
31
|
end
|
@@ -67,21 +67,25 @@ module SBF
|
|
67
67
|
extend Forwardable
|
68
68
|
def_delegator :@photos, :avatar, :avatar_photo_url
|
69
69
|
|
70
|
-
attr_accessor :id
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent',
|
75
|
-
entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund',
|
76
|
-
|
77
|
-
|
70
|
+
attr_accessor :id
|
71
|
+
attr_accessor :name
|
72
|
+
attr_accessor :status
|
73
|
+
attr_reader :display_name
|
74
|
+
entity_attr_accessor :event, 'SBF::Client::FullEvent', 'SBF::Client::PartialEvent', true
|
75
|
+
entity_attr_accessor :fund, 'SBF::Client::FullFund', 'SBF::Client::PartialFund', true
|
76
|
+
attr_accessor :fund_relationship_type
|
77
|
+
attr_accessor :offline_donation_uuid, :offline_donation_form
|
78
|
+
attr_accessor :fundraising_goal, :fundraising_message
|
79
|
+
entity_attr_accessor :fundraising_page, 'SBF::Client::FundraisingPage', nil, true
|
78
80
|
entity_attr_reader :photos, 'SBF::Client::Team::Photos'
|
79
81
|
entity_attr_accessor :captain, 'SBF::Client::FullParticipant'
|
80
|
-
entity_attr_reader :rankings, 'SBF::Client::Team::Rankings', nil,
|
82
|
+
entity_attr_reader :rankings, 'SBF::Client::Team::Rankings', nil, true
|
81
83
|
entity_attr_reader :totals, 'SBF::Client::Team::Totals'
|
82
|
-
|
83
|
-
|
84
|
-
|
84
|
+
attr_reader :created_at, :modified_at
|
85
|
+
attr_accessor :modified_by
|
86
|
+
attr_accessor :how_created
|
87
|
+
entity_attr_reader :permissions, 'SBF::Client::Permissions', nil, true
|
88
|
+
entity_attr_accessor :third_party_media, 'SBF::Client::ThirdPartyMedia', nil, true
|
85
89
|
|
86
90
|
def active?
|
87
91
|
status == SBF::Client::Team::Status::ACTIVE
|
@@ -9,9 +9,11 @@ module SBF
|
|
9
9
|
blacklist_action :update
|
10
10
|
blacklist_action :delete
|
11
11
|
|
12
|
-
attr_accessor :amount_raised
|
12
|
+
attr_accessor :amount_raised
|
13
|
+
attr_accessor :donations
|
14
|
+
attr_accessor :event_year
|
13
15
|
|
14
|
-
entity_attr_reader :team, 'SBF::Client::FullTeam', nil,
|
16
|
+
entity_attr_reader :team, 'SBF::Client::FullTeam', nil, true
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/stbaldricks/request.rb
CHANGED
@@ -56,7 +56,7 @@ module SBF
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
def self.file_post_request(path:, file:, filename
|
59
|
+
def self.file_post_request(path:, params: {}, file:, filename:)
|
60
60
|
raise SBF::Client::InvalidURIError, "Invalid URI: #{path}" unless valid_uri?(path)
|
61
61
|
raise SBF::Client::Error, 'Not yet authenticated' if user_token.nil?
|
62
62
|
raise SBF::Client::Error, 'Invalid File' unless file.is_a?(File) || file.is_a?(Tempfile)
|
@@ -112,7 +112,7 @@ module SBF
|
|
112
112
|
private_class_method :valid_uri?
|
113
113
|
|
114
114
|
def self.verify_ssl_peer?
|
115
|
-
(ENV
|
115
|
+
(ENV['VERIFY_SSL_PEER'] || true).to_b
|
116
116
|
end
|
117
117
|
private_class_method :verify_ssl_peer?
|
118
118
|
end
|
data/lib/stbaldricks/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :address, class: SBF::Client::Address do
|
3
|
+
skip_create
|
4
|
+
|
5
|
+
initialize_with do
|
6
|
+
new(attributes)
|
7
|
+
end
|
8
|
+
|
9
|
+
type { SBF::Client::Address::Type::HOME }
|
10
|
+
city { Faker::Address.ascii_city }
|
11
|
+
state { 'NE' }
|
12
|
+
country { 'US' }
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative 'lib/helpers'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :challenge, class: SBF::Client::Challenge do
|
5
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
+
|
7
|
+
initialize_with do
|
8
|
+
new(attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
status { SBF::Client::Challenge::Status::PENDING }
|
12
|
+
end_date { [Date.today + 30, Date.new(Date.today.year, 12, 31)].min }
|
13
|
+
|
14
|
+
after :build do |challenge, evaluator|
|
15
|
+
challenge.challenger = build(:challenger) if unpopulated?(evaluator, :challenger)
|
16
|
+
challenge.challengee = build(:challengee) if unpopulated?(evaluator, :challengee)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'lib/helpers'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :_base_challenger, class: SBF::Client::Challenger do
|
5
|
+
to_create do |it|
|
6
|
+
raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save
|
7
|
+
end
|
8
|
+
|
9
|
+
initialize_with do
|
10
|
+
new(attributes)
|
11
|
+
end
|
12
|
+
|
13
|
+
after :build do |challenger, evaluator|
|
14
|
+
# TODO: Unable to move to to_create block, to_create block.
|
15
|
+
# Entity returns a DataNotProvidedError when referenced in
|
16
|
+
# the to_create block. Needs to be fixed when the data model
|
17
|
+
# is fixed.
|
18
|
+
if unpopulated?(evaluator, :entity)
|
19
|
+
event = build(:event)
|
20
|
+
participant = create(:shavee, event: event)
|
21
|
+
challenger.entity = participant.to_partial
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
factory :challenger, class: SBF::Client::Challenger, parent: :_base_challenger do
|
27
|
+
is_accepted { true }
|
28
|
+
end
|
29
|
+
|
30
|
+
factory :challengee, class: SBF::Client::Challenger, parent: :_base_challenger do
|
31
|
+
is_accepted { false }
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :collection, class: SBF::Client::EntityCollection do
|
3
|
+
skip_create
|
4
|
+
end
|
5
|
+
|
6
|
+
factory :collection_with_error, parent: :collection do
|
7
|
+
after :build do |collection, evaluator|
|
8
|
+
if evaluator.error
|
9
|
+
collection.add_errors(evaluator.error)
|
10
|
+
else
|
11
|
+
error = SBF::Client::ErrorEntity.new(code: 5007, type: 'BadRequest', details: 'Invalid Request')
|
12
|
+
collection.add_errors(error)
|
13
|
+
end
|
14
|
+
collection.errors_http_code = evaluator.http_code || 400
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative 'lib/helpers'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :contact, class: SBF::Client::CustomContact do
|
5
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
+
|
7
|
+
initialize_with do
|
8
|
+
new(attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
email { Faker::Internet.email }
|
12
|
+
contact_groups { [] }
|
13
|
+
|
14
|
+
after :build do |contact_group, evaluator|
|
15
|
+
contact_group.owner = build(:person) if unpopulated?(evaluator, :owner)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative 'lib/helpers'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :contact_group, class: SBF::Client::ContactGroup do
|
5
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
+
|
7
|
+
initialize_with do
|
8
|
+
new(attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
display_name { random }
|
12
|
+
contacts { [] }
|
13
|
+
|
14
|
+
after :build do |contact_group, evaluator|
|
15
|
+
contact_group.owner = build(:person) if unpopulated?(evaluator, :owner)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :disease, class: SBF::Client::Grant::Disease do
|
3
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
4
|
+
|
5
|
+
initialize_with do
|
6
|
+
new(attributes)
|
7
|
+
end
|
8
|
+
|
9
|
+
name { SecureRandom.hex }
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative '../lib/helpers'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :full_donation_participant, class: SBF::Client::Donation::FullParticipant do
|
5
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
+
|
7
|
+
initialize_with do
|
8
|
+
new(attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
fundraising_goal { 100 }
|
12
|
+
shave_time { Time.now.to_s }
|
13
|
+
sequence(:display_name) { |n| "Display Name #{n}" }
|
14
|
+
model_type { 'person' }
|
15
|
+
|
16
|
+
after :build do |participant, evaluator|
|
17
|
+
participant.person = build(:person) if unpopulated?(evaluator, :person)
|
18
|
+
participant.send(:totals=, build(:participant_totals)) if unpopulated?(evaluator, :totals)
|
19
|
+
participant.send(:rankings=, build(:participant_rankings)) if unpopulated?(evaluator, :rankings)
|
20
|
+
participant.roles = build(:participant_roles) if unpopulated?(evaluator, :roles)
|
21
|
+
participant.send(:photos=, build(:participant_photos)) if unpopulated?(evaluator, :photos)
|
22
|
+
participant.event = build(:event) if unpopulated?(evaluator, :event)
|
23
|
+
participant.team = build(:team, event: participant.event) if unpopulated?(evaluator, :team)
|
24
|
+
participant.fundraising_page = build(:fundraising_page) if unpopulated?(evaluator, :fundraising_page)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require_relative 'lib/helpers'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :_donation, class: SBF::Client::FullDonation do
|
5
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
+
|
7
|
+
initialize_with do
|
8
|
+
new(attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
status { SBF::Client::Donation::Status::ACTIVE }
|
12
|
+
amount { rand(10..100) }
|
13
|
+
display_name { Faker::Name.name }
|
14
|
+
year { DateTime.now.year }
|
15
|
+
fund { nil }
|
16
|
+
memorial { nil }
|
17
|
+
end
|
18
|
+
|
19
|
+
factory :donation, class: SBF::Client::FullDonation, parent: :_donation do
|
20
|
+
after :build do |donation, evaluator|
|
21
|
+
donation.payment_details = build(:cc_payment) if unpopulated?(evaluator, :payment_details)
|
22
|
+
donation.donor = build(:person) if unpopulated?(evaluator, :donor)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
factory :cc_payment, class: SBF::Client::Payment::CreditCardDetails do
|
27
|
+
end
|
28
|
+
|
29
|
+
factory :cash_donation, class: SBF::Client::FullDonation, parent: :_donation do
|
30
|
+
status { SBF::Client::Donation::Status::PENDING }
|
31
|
+
how_created { SBF::Client::Donation::HowCreated::SUBMIT_CASH }
|
32
|
+
|
33
|
+
after :build do |donation, evaluator|
|
34
|
+
donation.payment_details = build(:cash_payment) if unpopulated?(evaluator, :payment_details)
|
35
|
+
donation.donor = build(:person, status: SBF::Client::Person::Status::PENDING) if unpopulated?(evaluator, :donor)
|
36
|
+
donation.submitter = build(:person) if unpopulated?(evaluator, :submitter)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
factory :cash_payment, class: SBF::Client::Payment::CashDetails do
|
41
|
+
end
|
42
|
+
|
43
|
+
factory :nonce_payment, class: SBF::Client::Payment::NonceDetails do
|
44
|
+
gateway { SBF::Client::Payment::Gateway::PAYMENTSPRING }
|
45
|
+
nonce { fake_valid_nonce }
|
46
|
+
device_data { random }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
require 'httparty'
|
51
|
+
require 'uri'
|
52
|
+
def fake_valid_nonce
|
53
|
+
url = "#{ENV['PAYMENTSPRING_BASE_URL']}/tokens/jsonp"
|
54
|
+
pub_key = ENV['PAYMENTSPRING_PUBLIC_KEY']
|
55
|
+
data = {
|
56
|
+
public_api_key: pub_key,
|
57
|
+
card_number: '4111111111111111',
|
58
|
+
card_exp_month: '1',
|
59
|
+
card_exp_year: Date.today.year + 1,
|
60
|
+
card_owner_name: 'John%20Doe'
|
61
|
+
}
|
62
|
+
|
63
|
+
uri = URI.parse("#{url}?#{data.to_query}")
|
64
|
+
response = HTTParty.get(uri, headers: {'Accept' => 'application/json'})
|
65
|
+
raise 'Error retrieving valid nonce' unless response.ok?
|
66
|
+
|
67
|
+
response.parsed_response['id']
|
68
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :donor, class: SBF::Client::Donor do
|
3
|
+
skip_create
|
4
|
+
|
5
|
+
initialize_with do
|
6
|
+
new(attributes)
|
7
|
+
end
|
8
|
+
|
9
|
+
sequence(:donor_name) { |n| "donor name #{n}" }
|
10
|
+
amount { 100 }
|
11
|
+
donation_created_at { DateTime.now.to_s }
|
12
|
+
end
|
13
|
+
end
|