Module: EffectiveMembershipsCategory
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/effective_memberships_category.rb
Overview
EffectiveMembershipsCategory
Mark your category model with effective_memberships_category to get all the includes
Defined Under Namespace
Modules: Base, ClassMethods
Instance Method Summary
collapse
Instance Method Details
#applicant_fee_qb_item_name ⇒ Object
267
268
269
|
# File 'app/models/concerns/effective_memberships_category.rb', line 267
def applicant_fee_qb_item_name
'Applicant'
end
|
#applicant_fee_tax_exempt ⇒ Object
271
272
273
|
# File 'app/models/concerns/effective_memberships_category.rb', line 271
def applicant_fee_tax_exempt
tax_exempt
end
|
#applicant_reinstatement_wizard_steps ⇒ Object
237
238
239
|
# File 'app/models/concerns/effective_memberships_category.rb', line 237
def applicant_reinstatement_wizard_steps
[:reinstatement]
end
|
#applicant_resignation_fee ⇒ Object
232
233
234
|
# File 'app/models/concerns/effective_memberships_category.rb', line 232
def applicant_resignation_fee
0
end
|
#applicant_resignation_wizard_steps ⇒ Object
228
229
230
|
# File 'app/models/concerns/effective_memberships_category.rb', line 228
def applicant_resignation_wizard_steps
[:resignation]
end
|
#applicant_review_wizard_steps ⇒ Object
245
246
247
|
# File 'app/models/concerns/effective_memberships_category.rb', line 245
def applicant_review_wizard_steps
(Array(self[:applicant_review_wizard_steps]) - [nil, '']).map(&:to_sym)
end
|
#applicant_wizard_steps ⇒ Object
Apply to Join or Apply to Reclassify
223
224
225
|
# File 'app/models/concerns/effective_memberships_category.rb', line 223
def applicant_wizard_steps
(Array(self[:applicant_wizard_steps]) - [nil, '']).map(&:to_sym)
end
|
#applicant_wizard_steps_collection ⇒ Object
249
250
251
252
253
254
255
256
|
# File 'app/models/concerns/effective_memberships_category.rb', line 249
def applicant_wizard_steps_collection
wizard_steps = EffectiveMemberships.Applicant.wizard_steps_hash
required_steps = EffectiveMemberships.Applicant.required_wizard_steps
wizard_steps.map do |step, title|
[title, step, 'disabled' => required_steps.include?(step)]
end
end
|
#can_apply? ⇒ Boolean
182
183
184
|
# File 'app/models/concerns/effective_memberships_category.rb', line 182
def can_apply?
can_apply_new? || can_apply_existing? || can_apply_restricted?
end
|
#can_apply_restricted_ids ⇒ Object
206
207
208
|
# File 'app/models/concerns/effective_memberships_category.rb', line 206
def can_apply_restricted_ids
Array(self[:can_apply_restricted_ids]) - [nil, '']
end
|
#can_stamp_wizard? ⇒ Boolean
This enables the permission to use the effective products stamp wizard To buy a stamp outside of the applicant process
277
278
279
|
# File 'app/models/concerns/effective_memberships_category.rb', line 277
def can_stamp_wizard?
applicant_wizard_steps.include?(:stamp)
end
|
#cpd_target_score(cpd_cycle:) ⇒ Object
293
294
295
|
# File 'app/models/concerns/effective_memberships_category.rb', line 293
def cpd_target_score(cpd_cycle:)
nil
end
|
#discount_fee(date:) ⇒ Object
202
203
204
|
# File 'app/models/concerns/effective_memberships_category.rb', line 202
def discount_fee(date:)
0 - prorated_fee(date: date)
end
|
#fee_payment_wizard_steps ⇒ Object
241
242
243
|
# File 'app/models/concerns/effective_memberships_category.rb', line 241
def fee_payment_wizard_steps
(Array(self[:fee_payment_wizard_steps]) - [nil, '']).map(&:to_sym)
end
|
#fee_payment_wizard_steps_collection ⇒ Object
258
259
260
261
262
263
264
265
|
# File 'app/models/concerns/effective_memberships_category.rb', line 258
def fee_payment_wizard_steps_collection
wizard_steps = EffectiveMemberships.FeePayment.wizard_steps_hash
required_steps = EffectiveMemberships.FeePayment.required_wizard_steps
wizard_steps.map do |step, title|
[title, step, 'disabled' => required_steps.include?(step)]
end
end
|
#individual? ⇒ Boolean
186
187
188
|
# File 'app/models/concerns/effective_memberships_category.rb', line 186
def individual?
category_type == 'Individual'
end
|
#membership_directory_title ⇒ Object
178
179
180
|
# File 'app/models/concerns/effective_memberships_category.rb', line 178
def membership_directory_title
to_s
end
|
#membership_number_required? ⇒ Boolean
194
195
196
|
# File 'app/models/concerns/effective_memberships_category.rb', line 194
def membership_number_required?
true
end
|
#optional_applicant_review_wizard_steps ⇒ Object
218
219
220
|
# File 'app/models/concerns/effective_memberships_category.rb', line 218
def optional_applicant_review_wizard_steps
applicant_review_wizard_steps - EffectiveMemberships.ApplicantReview.required_wizard_steps
end
|
#optional_applicant_wizard_steps ⇒ Object
210
211
212
|
# File 'app/models/concerns/effective_memberships_category.rb', line 210
def optional_applicant_wizard_steps
applicant_wizard_steps - EffectiveMemberships.Applicant.required_wizard_steps
end
|
#optional_fee_payment_wizard_steps ⇒ Object
214
215
216
|
# File 'app/models/concerns/effective_memberships_category.rb', line 214
def optional_fee_payment_wizard_steps
fee_payment_wizard_steps - EffectiveMemberships.FeePayment.required_wizard_steps
end
|
#organization? ⇒ Boolean
190
191
192
|
# File 'app/models/concerns/effective_memberships_category.rb', line 190
def organization?
category_type == 'Organization'
end
|
#prorated_fee(date:) ⇒ Object
198
199
200
|
# File 'app/models/concerns/effective_memberships_category.rb', line 198
def prorated_fee(date:)
send("prorated_#{date.strftime('%b').downcase}").to_i
end
|
#stamp_fee ⇒ Object
281
282
283
|
# File 'app/models/concerns/effective_memberships_category.rb', line 281
def stamp_fee
0
end
|
#stamp_fee_qb_item_name ⇒ Object
285
286
287
|
# File 'app/models/concerns/effective_memberships_category.rb', line 285
def stamp_fee_qb_item_name
qb_item_name
end
|
#stamp_fee_tax_exempt ⇒ Object
289
290
291
|
# File 'app/models/concerns/effective_memberships_category.rb', line 289
def stamp_fee_tax_exempt
tax_exempt
end
|
#to_s ⇒ Object
174
175
176
|
# File 'app/models/concerns/effective_memberships_category.rb', line 174
def to_s
title.presence || 'New Membership Category'
end
|