stbaldricks 10.11.1 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stbaldricks/endpoints/participant.rb +0 -8
- data/lib/stbaldricks/entities/participant.rb +8 -5
- data/lib/stbaldricks/entities/search.rb +2 -1
- data/lib/stbaldricks/enums/permission.rb +9 -4
- data/lib/stbaldricks/version.rb +1 -1
- data/spec/factories/event.rb +25 -0
- data/spec/factories/participant/roles/role.rb +17 -13
- data/spec/factories/participant/roles.rb +4 -2
- data/spec/factories/participant.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f321f40442d3cb41f671be6bb856f61550ae430833236c1febb8eaa298304405
|
4
|
+
data.tar.gz: bc89ab4091046b4670096428242ec66fb620a8c695b520dfb8e6d6808756ed6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49eb7703eb8616046bb994318f3ccb8b7563b1024c6bae4ac3e003a1126fafe48487ac065bba0037489d7a0498c8b35875f5b8c6bbbc7ee87eca324e5deb1c54
|
7
|
+
data.tar.gz: 983355608faec9b4335dfc383430c017d13d53095bf4c80c48b0a4ce59b309831b34e38733136ffc6936ba0402f6266761a6fb7609b8215850296b051541fa7f
|
@@ -46,14 +46,6 @@ module SBF
|
|
46
46
|
SBF::Client::Api::Response.new(http_code: response.code, data: data, error: error)
|
47
47
|
end
|
48
48
|
|
49
|
-
def delete_role(participant_id, role)
|
50
|
-
response = SBF::Client::Api::Request.post_request("#{base_uri}/delete_role", participant_id: participant_id, role: role)
|
51
|
-
|
52
|
-
error = SBF::Client::ErrorEntity.new(JSON.parse(response.body).symbolize!) unless ok?(response)
|
53
|
-
|
54
|
-
SBF::Client::Api::Response.new(http_code: response.code, data: nil, error: error)
|
55
|
-
end
|
56
|
-
|
57
49
|
def move_to_different_event(participant_id, new_event_id)
|
58
50
|
response = SBF::Client::Api::Request.post_request("#{base_uri}/move_to_different_event",
|
59
51
|
id: participant_id, new_event_id: new_event_id)
|
@@ -24,7 +24,6 @@ module SBF
|
|
24
24
|
action :join_team
|
25
25
|
action :start_team
|
26
26
|
action :leave_team
|
27
|
-
action :delete_role
|
28
27
|
action :move_to_different_event
|
29
28
|
|
30
29
|
disallow_instantiation
|
@@ -118,11 +117,13 @@ module SBF
|
|
118
117
|
LEAD_TREASURER = 'lead_treasurer'.freeze
|
119
118
|
LEAD_ORGANIZER = 'lead_organizer'.freeze
|
120
119
|
BARBER_COORDINATOR = 'barber_coordinator'.freeze
|
121
|
-
|
120
|
+
EVENT_SUPPORT_VOLUNTEER = 'event_support_volunteer'.freeze
|
121
|
+
INDIVIDUAL_FUNDRAISER = 'individual_fundraiser'.freeze
|
122
122
|
end
|
123
123
|
|
124
124
|
CORE_COMMITTEE_TYPES = [Type::ORGANIZER, Type::TREASURER, Type::BARBER_COORDINATOR, Type::SHAVEE_RECRUITER].freeze
|
125
|
-
|
125
|
+
TYPES_WITHOUT_LEADS = [Type::SHAVEE, Type::EVENT_SUPPORT_VOLUNTEER, Type::INDIVIDUAL_FUNDRAISER, Type::SHAVEE_RECRUITER, Type::TEAM_CAPTAIN,
|
126
|
+
Type::BARBER_COORDINATOR, Type::BARBER, Type::TREASURER, Type::ORGANIZER].freeze
|
126
127
|
class Role < SBF::Client::BaseEntity
|
127
128
|
attr_accessor :status
|
128
129
|
|
@@ -168,14 +169,16 @@ module SBF
|
|
168
169
|
attr_accessor :requested_shavee_packet
|
169
170
|
end
|
170
171
|
|
171
|
-
class
|
172
|
+
class EventSupportVolunteer < SBF::Client::Participant::Roles::Role; end
|
173
|
+
class IndividualFundraiser < SBF::Client::Participant::Roles::Role; end
|
172
174
|
class ShaveeRecruiter < SBF::Client::Participant::Roles::Role; end
|
173
175
|
class TeamCaptain < SBF::Client::Participant::Roles::Role; end
|
174
176
|
class BarberCoordinator < SBF::Client::Participant::Roles::Role; end
|
175
177
|
class Treasurer < SBF::Client::Participant::Roles::LeadRole; end
|
176
178
|
|
177
179
|
entity_attr_accessor :shavee, 'SBF::Client::Participant::Roles::Shavee'
|
178
|
-
entity_attr_accessor :
|
180
|
+
entity_attr_accessor :event_support_volunteer, 'SBF::Client::Participant::Roles::EventSupportVolunteer'
|
181
|
+
entity_attr_accessor :individual_fundraiser, 'SBF::Client::Participant::Roles::IndividualFundraiser'
|
179
182
|
entity_attr_accessor :barber_coordinator, 'SBF::Client::Participant::Roles::BarberCoordinator'
|
180
183
|
entity_attr_accessor :shavee_recruiter, 'SBF::Client::Participant::Roles::ShaveeRecruiter'
|
181
184
|
entity_attr_accessor :team_captain, 'SBF::Client::Participant::Roles::TeamCaptain'
|
@@ -31,7 +31,7 @@ module SBF
|
|
31
31
|
EVENT_ADD_SUPPORTERS = 209
|
32
32
|
EVENT_DELETE_SUPPORTERS = 210
|
33
33
|
EVENT_MANAGE_PARTICIPANTS = 211
|
34
|
-
|
34
|
+
EVENT_MANAGE_INDIVIDUAL_FUNDRAISERS = 212
|
35
35
|
EVENT_MANAGE_KIDS = 213
|
36
36
|
EVENT_ADD_KID = 214
|
37
37
|
EVENT_DELETE_KID = 215
|
@@ -41,13 +41,15 @@ module SBF
|
|
41
41
|
EVENT_MASS_PASSWORD_RESET = 219
|
42
42
|
EVENT_FAST_REGISTRATION = 220
|
43
43
|
EVENT_DELETE_EVENT = 221
|
44
|
+
EVENT_VIEW_EVENT_PERFORMANCE = 222
|
45
|
+
EVENT_MANAGE_EVENT_SUPPORT_VOLUNTEERS = 223
|
44
46
|
|
45
47
|
# text descriptions found in LookupUtility
|
46
48
|
EVENT_MEMBER_UPDATE_EVENT_INFORMATION = 300
|
47
49
|
EVENT_MEMBER_ACTIVITIES = 301
|
48
50
|
EVENT_MEMBER_PHOTO_GALLERY = 302
|
49
51
|
EVENT_MEMBER_SUPPORTERS = 303
|
50
|
-
|
52
|
+
EVENT_MEMBER_MANAGE_INDIVIDUAL_FUNDRAISERS_AND_ORGANIZERS = 305
|
51
53
|
EVENT_MEMBER_MANAGE_HONORED_KIDS_WITH_CANCER = 306
|
52
54
|
EVENT_MEMBER_VIEW_FUNDRAISING_REPORTS = 307
|
53
55
|
EVENT_MEMBER_DOWNLOAD_EVENT_PLANNING_MATERIALS = 308
|
@@ -59,6 +61,7 @@ module SBF
|
|
59
61
|
EVENT_MEMBER_VIEW_TEAM_TOTALS_LIST = 314
|
60
62
|
EVENT_MEMBER_COMMUNICATE = 315
|
61
63
|
EVENT_MEMBER_FAST_DONATION = 316
|
64
|
+
EVENT_MEMBER_MANAGE_EVENT_SUPPORT_VOLUNTEERS_AND_ORGANIZERS = 317
|
62
65
|
|
63
66
|
# Participant Role Permissions
|
64
67
|
EVENT_ORGANIZER = 1905
|
@@ -153,7 +156,8 @@ module SBF
|
|
153
156
|
EVENT_ADD_SUPPORTERS => :EVENT_ADD_SUPPORTERS,
|
154
157
|
EVENT_DELETE_SUPPORTERS => :EVENT_DELETE_SUPPORTERS,
|
155
158
|
EVENT_MANAGE_PARTICIPANTS => :EVENT_MANAGE_PARTICIPANTS,
|
156
|
-
|
159
|
+
EVENT_MANAGE_INDIVIDUAL_FUNDRAISERS => :EVENT_MANAGE_INDIVIDUAL_FUNDRAISERS,
|
160
|
+
EVENT_MANAGE_EVENT_SUPPORT_VOLUNTEERS => :EVENT_MANAGE_EVENT_SUPPORT_VOLUNTEERS,
|
157
161
|
EVENT_MANAGE_KIDS => :EVENT_MANAGE_KIDS,
|
158
162
|
EVENT_ADD_KID => :EVENT_ADD_KID,
|
159
163
|
EVENT_DELETE_KID => :EVENT_DELETE_KID,
|
@@ -167,7 +171,8 @@ module SBF
|
|
167
171
|
EVENT_MEMBER_ACTIVITIES => :EVENT_MEMBER_ACTIVITIES,
|
168
172
|
EVENT_MEMBER_PHOTO_GALLERY => :EVENT_MEMBER_PHOTO_GALLERY,
|
169
173
|
EVENT_MEMBER_SUPPORTERS => :EVENT_MEMBER_SUPPORTERS,
|
170
|
-
|
174
|
+
EVENT_MEMBER_MANAGE_INDIVIDUAL_FUNDRAISERS_AND_ORGANIZERS => :EVENT_MEMBER_MANAGE_INDIVIDUAL_FUNDRAISERS_AND_ORGANIZERS,
|
175
|
+
EVENT_MEMBER_MANAGE_EVENT_SUPPORT_VOLUNTEERS_AND_ORGANIZERS => :EVENT_MEMBER_MANAGE_EVENT_SUPPORT_VOLUNTEERS_AND_ORGANIZERS,
|
171
176
|
EVENT_MEMBER_MANAGE_HONORED_KIDS_WITH_CANCER => :EVENT_MEMBER_MANAGE_HONORED_KIDS_WITH_CANCER,
|
172
177
|
EVENT_MEMBER_VIEW_FUNDRAISING_REPORTS => :EVENT_MEMBER_VIEW_FUNDRAISING_REPORTS,
|
173
178
|
EVENT_MEMBER_DOWNLOAD_EVENT_PLANNING_MATERIALS => :EVENT_MEMBER_DOWNLOAD_EVENT_PLANNING_MATERIALS,
|
data/lib/stbaldricks/version.rb
CHANGED
data/spec/factories/event.rb
CHANGED
@@ -38,4 +38,29 @@ FactoryBot.define do
|
|
38
38
|
activity { random }
|
39
39
|
sort_order { 1 }
|
40
40
|
end
|
41
|
+
factory :past_event, class: SBF::Client::FullEvent do
|
42
|
+
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.create }
|
43
|
+
|
44
|
+
initialize_with do
|
45
|
+
new(attributes)
|
46
|
+
end
|
47
|
+
|
48
|
+
id { rand(1000) }
|
49
|
+
event_title { "#{Faker::Team.name} #{random}" }
|
50
|
+
year { Time.now.year - 5 }
|
51
|
+
date { Time.now.to_s }
|
52
|
+
fund_relationship_type { 'no_association' }
|
53
|
+
status { 'active' }
|
54
|
+
type { 'head_shaving' }
|
55
|
+
sub_type { 'community' }
|
56
|
+
how_created { 'admin_control_panel' }
|
57
|
+
fundraising_goal { rand(20) * 5000 }
|
58
|
+
is_private { false }
|
59
|
+
|
60
|
+
after :build do |event, evaluator|
|
61
|
+
event.venue = build(:event_venue) if unpopulated?(evaluator, :venue)
|
62
|
+
event.contacts = build(:event_contacts) if unpopulated?(evaluator, :contacts)
|
63
|
+
event.organizers = [build(:lead_organizer, person: build(:person))] if unpopulated?(evaluator, :organizers)
|
64
|
+
end
|
65
|
+
end
|
41
66
|
end
|
@@ -10,10 +10,23 @@ FactoryBot.define do
|
|
10
10
|
|
11
11
|
after :build do |role, evaluator|
|
12
12
|
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
13
|
+
role.requested_shavee_packet = false if unpopulated?(evaluator, :requested_shavee_packet)
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
|
-
factory :
|
17
|
+
factory :participant_roles_event_support_volunteer, class: SBF::Client::Participant::Roles::EventSupportVolunteer do
|
18
|
+
skip_create
|
19
|
+
|
20
|
+
initialize_with do
|
21
|
+
new(attributes)
|
22
|
+
end
|
23
|
+
|
24
|
+
after :build do |role, evaluator|
|
25
|
+
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
factory :participant_roles_individual_fundraiser, class: SBF::Client::Participant::Roles::IndividualFundraiser do
|
17
30
|
skip_create
|
18
31
|
|
19
32
|
initialize_with do
|
@@ -70,6 +83,7 @@ FactoryBot.define do
|
|
70
83
|
|
71
84
|
after :build do |role, evaluator|
|
72
85
|
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
86
|
+
role.policies = build(:participant_roles_organizer_role_policies) if unpopulated?(evaluator, :policies)
|
73
87
|
end
|
74
88
|
end
|
75
89
|
|
@@ -119,19 +133,9 @@ FactoryBot.define do
|
|
119
133
|
|
120
134
|
status { SBF::Client::Participant::Roles::Status::ACTIVE }
|
121
135
|
is_lead { true }
|
122
|
-
end
|
123
|
-
|
124
|
-
factory :participant_roles_organizer_role, class: SBF::Client::Participant::Roles::Organizer do
|
125
|
-
skip_create
|
126
|
-
|
127
|
-
initialize_with do
|
128
|
-
new(attributes)
|
129
|
-
end
|
130
|
-
|
131
|
-
status { SBF::Client::Participant::Roles::Status::ACTIVE }
|
132
136
|
|
133
|
-
after :build do |organizer|
|
134
|
-
organizer.policies = build(:participant_roles_organizer_role_policies)
|
137
|
+
after :build do |organizer, evaluator|
|
138
|
+
organizer.policies = build(:participant_roles_organizer_role_policies) if unpopulated?(evaluator, :policies)
|
135
139
|
end
|
136
140
|
end
|
137
141
|
|
@@ -8,7 +8,8 @@ FactoryBot.define do
|
|
8
8
|
|
9
9
|
transient do
|
10
10
|
shavee { true }
|
11
|
-
|
11
|
+
event_support_volunteer { nil }
|
12
|
+
individual_fundraiser { nil }
|
12
13
|
shavee_recruiter { nil }
|
13
14
|
team_captain { nil }
|
14
15
|
barber_coordinator { nil }
|
@@ -21,7 +22,8 @@ FactoryBot.define do
|
|
21
22
|
|
22
23
|
after :build do |roles, evaluator|
|
23
24
|
roles.shavee = build(:participant_roles_shavee) if evaluator.shavee
|
24
|
-
roles.
|
25
|
+
roles.event_support_volunteer = build(:participant_roles_event_support_volunteer) if evaluator.event_support_volunteer
|
26
|
+
roles.individual_fundraiser = build(:participant_roles_individual_fundraiser) if evaluator.individual_fundraiser
|
25
27
|
roles.shavee_recruiter = build(:participant_roles_shavee_recruiter) if evaluator.shavee_recruiter
|
26
28
|
roles.team_captain = build(:participant_roles_team_captain) if evaluator.team_captain
|
27
29
|
roles.barber_coordinator = build(:participant_roles_barber_coordinator) if evaluator.barber_coordinator
|
@@ -81,9 +81,15 @@ FactoryBot.define do
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
factory :
|
84
|
+
factory :event_support_volunteer, class: SBF::Client::FullParticipant, parent: :participant do
|
85
85
|
after :build do |participant, evaluator|
|
86
|
-
participant.roles = build(:participant_roles,
|
86
|
+
participant.roles = build(:participant_roles, event_support_volunteer: true, shavee: false) if unpopulated?(evaluator, :roles)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
factory :individual_fundraiser, class: SBF::Client::FullParticipant, parent: :participant do
|
91
|
+
after :build do |participant, evaluator|
|
92
|
+
participant.roles = build(:participant_roles, individual_fundraiser: true, shavee: false) if unpopulated?(evaluator, :roles)
|
87
93
|
end
|
88
94
|
end
|
89
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stbaldricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|