effective_memberships 0.13.5 → 0.13.7

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/concerns/effective_memberships_applicant.rb +39 -2
  3. data/app/models/concerns/effective_memberships_category.rb +16 -1
  4. data/app/models/concerns/effective_memberships_fee_payment.rb +36 -0
  5. data/app/models/concerns/effective_memberships_registrar.rb +41 -40
  6. data/app/models/effective/applicant_endorsement.rb +4 -1
  7. data/app/models/effective/applicant_reference.rb +3 -1
  8. data/app/models/effective/fee.rb +6 -0
  9. data/app/views/admin/applicants/_form_applicant.html.haml +1 -1
  10. data/app/views/admin/categories/_fields_applicant_requirements.html.haml +55 -0
  11. data/app/views/admin/categories/_fields_applicant_steps.html.haml +4 -0
  12. data/app/views/admin/categories/_fields_fee_payment_requirements.html.haml +11 -0
  13. data/app/views/admin/categories/_fields_fee_payment_steps.html.haml +4 -0
  14. data/app/views/admin/categories/_form.html.haml +3 -5
  15. data/app/views/admin/categories/_form_wizards.html.haml +16 -0
  16. data/app/views/effective/applicant_endorsements/complete.html.haml +1 -1
  17. data/app/views/effective/applicant_references/_form_declaration.html.haml +3 -2
  18. data/app/views/effective/applicant_references/complete.html.haml +1 -1
  19. data/app/views/effective/applicants/_cpd.html.haml +3 -0
  20. data/app/views/effective/applicants/_cpd_requirements.html.haml +2 -0
  21. data/app/views/effective/applicants/_declarations_fields.html.haml +5 -0
  22. data/app/views/effective/applicants/_references_requirements.html.haml +1 -0
  23. data/app/views/effective/applicants/cpd.html.haml +20 -0
  24. data/app/views/effective/applicants/declarations.html.haml +1 -7
  25. data/app/views/effective/applicants/files.html.haml +3 -1
  26. data/app/views/effective/applicants/references.html.haml +4 -0
  27. data/app/views/effective/applicants/submitted.html.haml +5 -0
  28. data/app/views/effective/applicants/transcripts.html.haml +2 -0
  29. data/app/views/effective/wizard_steps/_cpd_fields.html.haml +3 -0
  30. data/app/views/effective/wizard_steps/_cpd_requirements.html.haml +15 -0
  31. data/app/views/effective/wizard_steps/_cpd_statements.html.haml +18 -0
  32. data/db/migrate/01_create_effective_memberships.rb.erb +6 -5
  33. data/lib/effective_memberships/version.rb +1 -1
  34. metadata +15 -3
  35. data/app/views/admin/categories/_form_fee_payment_steps.html.haml +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02521eeb4da07e9cece1d9cbd784b6ecf5fe7d042ab48f0407455bbe3f9d725c
4
- data.tar.gz: 42255afdbdcebbf4787328d0088e6183453e79cef39a84f6b81123eb19a9be86
3
+ metadata.gz: fee4d3bcf27de0af18f92b9e8cfa6c1deb2ab8d5269252bda05aa4b5053a474e
4
+ data.tar.gz: 1feb91e4f927b50cedadfba765af24eaee716300c65ea3d7d924226d254361ee
5
5
  SHA512:
6
- metadata.gz: 7ec1e5ca1c59f678388a0d8750a768de77bb7f63bc7803fd9c0627f8370b26e8d764a313013234dbbe1d435f38e4c67ba612840607f2620ce9772d955a705345
7
- data.tar.gz: 066b68def2279607ac729e81ef88e42cc13ed619165ab75c734a68a61d007bf26fae2dfacc59e6427efceba4130fab81009fe0c659f067a736fdbe26a1d2de20
6
+ metadata.gz: d6a4a5e2057af3fc3f60f4e56305359f7ffd73a97cd3d2043a2c5f201039670ebd5a85e5ae3a5e2a2df4d3ede01d758b22be3166656192bfb29f30d8a4cb9be3
7
+ data.tar.gz: 9548a342bcf721e7cc9e1bdbe222cfcebfd832d25f9b8b26678e1e5943d513dd0b9f5127c7f32b100491dc904ca2f3a55cf37f85a2958f40a39277b385c83827
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  # EffectiveMembershipsApplicant
4
2
  #
5
3
  # Mark your owner model with effective_memberships_applicant to get all the includes
@@ -63,6 +61,7 @@ module EffectiveMembershipsApplicant
63
61
  experience: 'Work Experience',
64
62
  references: 'References',
65
63
  files: 'Attach Files',
64
+ cpd: 'Continuing Professional Development',
66
65
  stamp: 'Professional Stamp',
67
66
  declarations: 'Declarations',
68
67
  summary: 'Review',
@@ -78,6 +77,8 @@ module EffectiveMembershipsApplicant
78
77
  has_many_attached :applicant_files
79
78
  has_many_attached :transcripts
80
79
 
80
+ has_many_purgable if respond_to?(:has_many_purgable)
81
+
81
82
  # Transcripts Step
82
83
  attr_accessor :declare_will_send_transcripts
83
84
 
@@ -88,6 +89,9 @@ module EffectiveMembershipsApplicant
88
89
  # Reinstatements Step
89
90
  attr_accessor :declare_reinstatement
90
91
 
92
+ # CPD Step
93
+ attr_accessor :declare_cpd
94
+
91
95
  # Admin Approve Step
92
96
  attr_accessor :approved_membership_number
93
97
  attr_accessor :approved_membership_date
@@ -344,6 +348,17 @@ module EffectiveMembershipsApplicant
344
348
  end
345
349
  end
346
350
 
351
+ # CPD step
352
+ with_options(if: -> { current_step == :cpd }) do
353
+ validates :declare_cpd, acceptance: true
354
+
355
+ validate do
356
+ if (cpd_cycles = cpd_uncompleted_cpd_cycles).present?
357
+ self.errors.add(:base, "Please complete #{cpd_cycles.map(&:to_s).to_sentence} to continue")
358
+ end
359
+ end
360
+ end
361
+
347
362
  # Transcripts step
348
363
  with_options(if: -> { current_step == :transcripts }) do
349
364
  validates :declare_will_send_transcripts, acceptance: true
@@ -710,6 +725,28 @@ module EffectiveMembershipsApplicant
710
725
  required_steps.include?(:transcripts)
711
726
  end
712
727
 
728
+ # CPD Step
729
+ def cpd_requirement
730
+ (category&.applicant_cpd_step_requirement.presence || EffectiveMemberships.Category.cpd_step_requirements.first)
731
+ end
732
+
733
+ def cpd_required_cpd_cycles
734
+ date = submitted_at || Time.zone.now
735
+
736
+ [
737
+ (EffectiveCpd.previous_cpd_cycle(date: date) if cpd_requirement.to_s.include?('previous')),
738
+ (EffectiveCpd.current_cpd_cycle(date: date) if cpd_requirement.to_s.include?('current'))
739
+ ].compact
740
+ end
741
+
742
+ def cpd_completed_cpd_cycles
743
+ cpd_required_cpd_cycles.select { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
744
+ end
745
+
746
+ def cpd_uncompleted_cpd_cycles
747
+ cpd_required_cpd_cycles.reject { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
748
+ end
749
+
713
750
  # Files Step
714
751
  def min_applicant_files
715
752
  category&.min_applicant_files.to_i
@@ -23,6 +23,19 @@ module EffectiveMembershipsCategory
23
23
  def categories
24
24
  []
25
25
  end
26
+
27
+ # These are the values for the Applicant and FeePayment cpd_step_requirements fields
28
+ # The first entry should always mean None Required.
29
+ # Please use current and previous as lowercase
30
+ def cpd_step_requirements
31
+ [
32
+ 'None',
33
+ 'Must submit current',
34
+ 'Must submit previous',
35
+ 'Must submit current and previous'
36
+ ]
37
+ end
38
+
26
39
  end
27
40
 
28
41
  included do
@@ -55,6 +68,7 @@ module EffectiveMembershipsCategory
55
68
  applicant_reinstatement_fee :integer
56
69
  applicant_wizard_steps :text
57
70
 
71
+ applicant_cpd_step_requirement :string
58
72
  min_applicant_educations :integer
59
73
  min_applicant_endorsements :integer
60
74
  min_applicant_equivalences :integer
@@ -82,7 +96,8 @@ module EffectiveMembershipsCategory
82
96
  prorated_dec :integer
83
97
 
84
98
  # Fee Payments
85
- fee_payment_wizard_steps :text
99
+ fee_payment_wizard_steps :text
100
+ fee_payment_cpd_step_requirement :string
86
101
 
87
102
  # Renewals
88
103
  create_renewal_fees :boolean
@@ -45,6 +45,9 @@ module EffectiveMembershipsFeePayment
45
45
 
46
46
  log_changes(except: :wizard_steps) if respond_to?(:log_changes)
47
47
 
48
+ # CPD Step
49
+ attr_accessor :declare_cpd
50
+
48
51
  # Declarations Step
49
52
  attr_accessor :declare_code_of_ethics
50
53
  attr_accessor :declare_truth
@@ -120,6 +123,17 @@ module EffectiveMembershipsFeePayment
120
123
  self.errors.add(:base, 'please complete your existing fee payment first') if existing.present?
121
124
  end
122
125
 
126
+ # CPD step
127
+ with_options(if: -> { current_step == :cpd }) do
128
+ validates :declare_cpd, acceptance: true
129
+
130
+ validate do
131
+ if (cpd_cycles = cpd_uncompleted_cpd_cycles).present?
132
+ self.errors.add(:base, "Please complete #{cpd_cycles.map(&:to_s).to_sentence} to continue")
133
+ end
134
+ end
135
+ end
136
+
123
137
  # Declarations Step
124
138
  with_options(if: -> { current_step == :declarations }) do
125
139
  validates :declare_code_of_ethics, acceptance: true
@@ -225,4 +239,26 @@ module EffectiveMembershipsFeePayment
225
239
  save!
226
240
  end
227
241
 
242
+ # CPD Step
243
+ def cpd_requirement
244
+ (category&.fee_payment_cpd_step_requirement.presence || EffectiveMemberships.Category.cpd_step_requirements.first)
245
+ end
246
+
247
+ def cpd_required_cpd_cycles
248
+ date = submitted_at || Time.zone.now
249
+
250
+ [
251
+ (EffectiveCpd.previous_cpd_cycle(date: date) if cpd_requirement.to_s.include?('previous')),
252
+ (EffectiveCpd.current_cpd_cycle(date: date) if cpd_requirement.to_s.include?('current'))
253
+ ].compact
254
+ end
255
+
256
+ def cpd_completed_cpd_cycles
257
+ cpd_required_cpd_cycles.select { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
258
+ end
259
+
260
+ def cpd_uncompleted_cpd_cycles
261
+ cpd_required_cpd_cycles.reject { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
262
+ end
263
+
228
264
  end
@@ -63,6 +63,47 @@ module EffectiveMembershipsRegistrar
63
63
  period(date: date).end_of_year
64
64
  end
65
65
 
66
+ def current_period
67
+ period(date: Time.zone.now)
68
+ end
69
+
70
+ def last_period
71
+ advance_period(period: current_period, number: -1)
72
+ end
73
+
74
+ # Returns a date of Jan 1, Year
75
+ def period(date:)
76
+ cutoff = renewal_fee_date(date: date) # period_end_on
77
+ period = (date < cutoff) ? advance_period(period: date, number: 0) : advance_period(period: date, number: 1)
78
+ period.to_date
79
+ end
80
+
81
+ # This is only used for a form collection on admin memberships
82
+ def periods(from:, to: nil)
83
+ to ||= Time.zone.now
84
+
85
+ raise('expected to date') unless to.respond_to?(:strftime)
86
+ raise('expected from date') unless from.respond_to?(:strftime)
87
+
88
+ from = period(date: from)
89
+ to = period(date: to)
90
+
91
+ retval = []
92
+
93
+ loop do
94
+ retval << from
95
+ from = advance_period(period: from, number: 1)
96
+ break if from > to
97
+ end
98
+
99
+ retval
100
+ end
101
+
102
+ def periods_collection(from: nil, to: nil)
103
+ from ||= Time.zone.now - 10.years
104
+ periods(from: from, to: to).reverse.map { |period| [period_end_on(date: period), period] }
105
+ end
106
+
66
107
  # Category is required, statuses are optional
67
108
  def assign!(owner, categories:, statuses: nil, date: nil, number: nil)
68
109
  categories = Array(categories)
@@ -423,46 +464,6 @@ module EffectiveMembershipsRegistrar
423
464
  number.to_s
424
465
  end
425
466
 
426
- def current_period
427
- period(date: Time.zone.now)
428
- end
429
-
430
- def last_period
431
- advance_period(period: current_period, number: -1)
432
- end
433
-
434
- # Returns a date of Jan 1, Year
435
- def period(date:)
436
- cutoff = renewal_fee_date(date: date) # period_end_on
437
- period = (date < cutoff) ? advance_period(period: date, number: 0) : advance_period(period: date, number: 1)
438
- period.to_date
439
- end
440
-
441
- # This is only used for a form collection on admin memberships
442
- def periods(from:, to: nil)
443
- to ||= Time.zone.now
444
-
445
- raise('expected to date') unless to.respond_to?(:strftime)
446
- raise('expected from date') unless from.respond_to?(:strftime)
447
-
448
- from = period(date: from)
449
- to = period(date: to)
450
-
451
- retval = []
452
-
453
- loop do
454
- retval << from
455
- from = advance_period(period: from, number: 1)
456
- break if from > to
457
- end
458
-
459
- retval
460
- end
461
-
462
- def periods_collection(from: nil, to: nil)
463
- from ||= Time.zone.now - 10.years
464
- periods(from: from, to: to).reverse.map { |period| [period_end_on(date: period), period] }
465
- end
466
467
 
467
468
  # Called by applicant.approve!
468
469
  def delete_fees!(resource)
@@ -4,6 +4,8 @@ module Effective
4
4
  class ApplicantEndorsement < ActiveRecord::Base
5
5
  acts_as_tokened
6
6
 
7
+ attr_accessor :email_form_skip
8
+
7
9
  acts_as_statused(
8
10
  :submitted, # Was submitted by the applicant
9
11
  :completed # Was completed by the endorser.
@@ -14,6 +16,7 @@ module Effective
14
16
  belongs_to :applicant, polymorphic: true
15
17
  belongs_to :endorser, polymorphic: true, optional: true
16
18
 
19
+
17
20
  effective_resource do
18
21
  # These fields are submitted by the applicant
19
22
  # They should try to select an endorser from the dropdown
@@ -58,7 +61,7 @@ module Effective
58
61
  validates :accept_declaration, acceptance: true
59
62
  end
60
63
 
61
- after_commit(on: :create, if: -> { applicant.was_submitted? }) { notify! }
64
+ after_commit(on: :create, if: -> { applicant.was_submitted? && !applicant.done? }, unless: -> { email_form_skip }) { notify! }
62
65
 
63
66
  def self.endorser_collection(applicant)
64
67
  raise('expected an effective memberships applicant') unless applicant.class.try(:effective_memberships_applicant?)
@@ -3,6 +3,8 @@ module Effective
3
3
  acts_as_tokened
4
4
  acts_as_addressable :reference
5
5
 
6
+ attr_accessor :email_form_skip
7
+
6
8
  acts_as_statused(
7
9
  :submitted, # Was submitted by the applicant
8
10
  :completed # Was completed by the reference.
@@ -63,7 +65,7 @@ module Effective
63
65
  validates :accept_declaration, acceptance: true
64
66
  end
65
67
 
66
- after_commit(on: :create, if: -> { applicant.was_submitted? }) { notify! }
68
+ after_commit(on: :create, if: -> { applicant.was_submitted? && !applicant.done? }, unless: -> { email_form_skip }) { notify! }
67
69
 
68
70
  def to_s
69
71
  'reference'
@@ -53,9 +53,15 @@ module Effective
53
53
 
54
54
  before_validation do
55
55
  self.period ||= EffectiveMemberships.Registrar.current_period
56
+ self.checkout_type ||= CHECKOUT_TYPES.first
57
+
56
58
  self.title = default_title() if self.title.blank?
57
59
  end
58
60
 
61
+ before_validation(if: -> { qb_item_name.blank? && category.present? }) do
62
+ assign_attributes(qb_item_name: category.qb_item_name, tax_exempt: category.tax_exempt?)
63
+ end
64
+
59
65
  before_validation(if: -> { fee_type == 'Renewal' && category.present? && period.present? }) do
60
66
  self.late_on ||= EffectiveMemberships.Registrar.late_fee_date(period: period) if category.create_late_fees?
61
67
  self.not_in_good_standing_on ||= EffectiveMemberships.Registrar.not_in_good_standing_date(period: period) if category.create_not_in_good_standing?
@@ -17,7 +17,7 @@
17
17
  = render 'effective/applicants/applicant', applicant: applicant, namespace: :admin
18
18
 
19
19
  - # Just normal tabs now
20
- - if applicant.applicant_reviews.present?
20
+ - if applicant.applicant_reviews.present? || applicant.was_completed?
21
21
  = tab 'Reviews' do
22
22
  .mb-4= render_inline_datatable(Admin::EffectiveApplicantReviewsDatatable.new(applicant: applicant))
23
23
 
@@ -0,0 +1,55 @@
1
+ %p The following numbers set the minimum number of required items an applicant must provide to complete each step. Leave blank for none.
2
+
3
+ - applicant = EffectiveMemberships.Applicant.new
4
+
5
+ %table.table.table-sm
6
+ %tbody
7
+ - if applicant.wizard_step_keys.include?(:education)
8
+ %tr
9
+ %td= applicant.wizard_step_title(:education)
10
+ %td= f.number_field :min_applicant_educations, label: false
11
+ %td minimum number of education degrees
12
+
13
+ - if applicant.wizard_step_keys.include?(:course_amounts)
14
+ %tr
15
+ %td= applicant.wizard_step_title(:course_amounts)
16
+ %td= f.number_field :min_applicant_courses, label: false
17
+ %td minimum number of courses
18
+
19
+ - if applicant.wizard_step_keys.include?(:experience)
20
+ %tr
21
+ %td= applicant.wizard_step_title(:experience)
22
+ %td= f.number_field :min_applicant_experiences_months, label: false
23
+ %td minimimum months of work experience
24
+
25
+ - if applicant.wizard_step_keys.include?(:endorsements)
26
+ %tr
27
+ %td= applicant.wizard_step_title(:endorsements)
28
+ %td= f.number_field :min_applicant_endorsements, label: false
29
+ %td minimimum number of endorsements
30
+
31
+ - if applicant.wizard_step_keys.include?(:equivalences)
32
+ %tr
33
+ %td= applicant.wizard_step_title(:equivalences)
34
+ %td= f.number_field :min_applicant_equivalences, label: false
35
+ %td minimimum number of equivalent memberships
36
+
37
+ - if applicant.wizard_step_keys.include?(:references)
38
+ %tr
39
+ %td= applicant.wizard_step_title(:references)
40
+ %td= f.number_field :min_applicant_references, label: false
41
+ %td minimimum number of references
42
+
43
+ - if applicant.wizard_step_keys.include?(:files)
44
+ %tr
45
+ %td= applicant.wizard_step_title(:files)
46
+ %td= f.number_field :min_applicant_files, label: false
47
+ %td minimimum number of attached files
48
+
49
+ - if applicant.wizard_step_keys.include?(:cpd)
50
+ %tr
51
+ %td= applicant.wizard_step_title(:cpd)
52
+ %td= f.select :applicant_cpd_step_requirement, f.object.class.cpd_step_requirements, label: false
53
+ %td
54
+ minimum required
55
+ = ets(EffectiveCpd.CpdStatement)
@@ -0,0 +1,4 @@
1
+ %p The following wizard steps will be displayed when applying for this #{et(Effective::Category)}
2
+
3
+ - f.object.applicant_wizard_steps += EffectiveMemberships.Applicant.required_wizard_steps
4
+ = f.checks :applicant_wizard_steps, f.object.applicant_wizard_steps_collection(), label: false
@@ -0,0 +1,11 @@
1
+ - fee_payment = EffectiveMemberships.FeePayment.new
2
+
3
+ %table.table.table-sm
4
+ %tbody
5
+ - if fee_payment.wizard_step_keys.include?(:cpd)
6
+ %tr
7
+ %td= fee_payment.wizard_step_title(:cpd)
8
+ %td= f.select :fee_payment_cpd_step_requirement, f.object.class.cpd_step_requirements, label: false
9
+ %td
10
+ minimum required
11
+ = ets(EffectiveCpd.CpdStatement)
@@ -0,0 +1,4 @@
1
+ %p The following wizard steps will be displayed when applying for this #{et(Effective::FeePayment)}
2
+
3
+ - f.object.fee_payment_wizard_steps += EffectiveMemberships.FeePayment.required_wizard_steps
4
+ = f.checks :fee_payment_wizard_steps, f.object.fee_payment_wizard_steps_collection(), label: false
@@ -6,17 +6,15 @@
6
6
  = render 'admin/categories/form_fees', category: category
7
7
 
8
8
  - if category.persisted?
9
+ = tab 'Wizards' do
10
+ = render 'admin/categories/form_wizards', category: category
11
+
9
12
  = tab 'Content - Applicants' do
10
13
  = render 'admin/categories/form_applicant_content', category: category
11
14
 
12
15
  = tab 'Content - Renewals' do
13
16
  = render 'admin/categories/form_fee_payment_content', category: category
14
17
 
15
- = tab 'Wizards' do
16
- .row
17
- .col= render 'admin/categories/form_applicant_steps', category: category
18
- .col= render 'admin/categories/form_fee_payment_steps', category: category
19
-
20
18
  - if category.respond_to?(:log_changes_datatable)
21
19
  = tab 'Logs' do
22
20
  = render_inline_datatable(category.log_changes_datatable)
@@ -0,0 +1,16 @@
1
+ = effective_form_with(model: [:admin, category], engine: true) do |f|
2
+ .row
3
+ .col
4
+ = card(et(EffectiveMemberships.Applicant) + ' Wizard Steps') do
5
+ = render 'admin/categories/fields_applicant_steps', f: f
6
+
7
+ = card(et(EffectiveMemberships.Applicant) + ' Requirements') do
8
+ = render 'admin/categories/fields_applicant_requirements', f: f
9
+ .col
10
+ = card(et(EffectiveMemberships.FeePayment) + ' Wizard Steps') do
11
+ = render 'admin/categories/fields_fee_payment_steps', f: f
12
+
13
+ = card(et(EffectiveMemberships.FeePayment) + ' Requirements') do
14
+ = render 'admin/categories/fields_fee_payment_requirements', f: f
15
+
16
+ = f.submit
@@ -1,2 +1,2 @@
1
1
  = card do
2
- %p Thank you. The confidential endorsement has been completed.
2
+ %p.text-center Thank you. The confidential endorsement has been completed.
@@ -23,8 +23,9 @@
23
23
  label: "Do you have any reservations about the applicant?", inline: true, required: true
24
24
 
25
25
  = f.show_if :reservations, true do
26
- = f.text_area :reservations_reason,
27
- label: 'Please provide a brief but candid explanation of your reservations'
26
+ .mt-2
27
+ = f.text_area :reservations_reason,
28
+ label: 'Please provide a brief but candid explanation of your reservations'
28
29
 
29
30
  .mt-4
30
31
 
@@ -1,2 +1,2 @@
1
1
  = card do
2
- %p Thank you. The confidential reference has been completed.
2
+ %p.text-center Thank you. The confidential reference has been completed.
@@ -0,0 +1,3 @@
1
+ = wizard_card(applicant) do
2
+ = render('effective/wizard_steps/cpd_statements', resource: applicant)
3
+ = render('effective/wizard_steps/cpd_requirements', resource: applicant)
@@ -0,0 +1,2 @@
1
+ - # Intentionally blank
2
+ %p TODO
@@ -0,0 +1,5 @@
1
+ = f.check_box :declare_code_of_ethics,
2
+ label: 'Yes, I hereby certify that I have read and will adhere to the Code of Ethics'
3
+
4
+ = f.check_box :declare_truth,
5
+ label: 'Yes, I hereby certify that the statements and information contained herein are correct'
@@ -0,0 +1 @@
1
+ %p Please provide the names individuals who can speak to your character and reputation.
@@ -0,0 +1,20 @@
1
+ = render 'layout' do
2
+ = render 'effective/applicants/content', resource: resource
3
+
4
+ = card(et('effective_cpd.name')) do
5
+ = render('cpd_requirements', applicant: resource)
6
+
7
+ = card('All ' + cpd_statements_label) do
8
+ = render('effective/wizard_steps/cpd_statements', resource: resource)
9
+
10
+ = card('Requirements') do
11
+ = render('effective/wizard_steps/cpd_requirements', resource: resource)
12
+
13
+ = card do
14
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
15
+ = f.hidden_field :id
16
+
17
+ - f.object.declare_cpd = true if f.object.has_completed_step?(:cpd)
18
+ = render('effective/wizard_steps/cpd_fields', f: f)
19
+
20
+ = f.save 'Save and Continue'
@@ -9,12 +9,6 @@
9
9
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
10
10
  = f.hidden_field :id
11
11
 
12
- = f.check_box :declare_code_of_ethics,
13
- label: 'Yes, I hereby certify that I have read and will adhere to the Code of Ethics'
14
-
15
- = f.check_box :declare_truth,
16
- label: 'Yes, I hereby certify that the statements and information contained herein are correct'
17
-
18
- = render_if_exists("effective/applicants/declarations_fields", f: f)
12
+ = render("effective/applicants/declarations_fields", f: f)
19
13
 
20
14
  = f.save 'Save and Continue'
@@ -4,11 +4,13 @@
4
4
  = card do
5
5
  - if resource.min_applicant_files > 0
6
6
  %p You must include #{resource.min_applicant_files} or more files.
7
+ - else
8
+ %p Please add zero or more files.
7
9
 
8
10
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
9
11
  = f.hidden_field :id
10
12
 
11
- = f.file_field :applicant_files, attachment_style: :table
13
+ = f.file_field :applicant_files, attachment_style: :table, label: 'Files'
12
14
 
13
15
  = render_if_exists("effective/applicants/files_fields", f: f)
14
16
 
@@ -2,8 +2,12 @@
2
2
  = render 'effective/applicants/content', resource: resource
3
3
 
4
4
  = card do
5
+ .mb-2= render('references_requirements', applicant: resource)
6
+
5
7
  - if resource.min_applicant_references > 0
6
8
  %p You must include #{resource.min_applicant_references} or more references.
9
+ - else
10
+ %p Please include zero or more references.
7
11
 
8
12
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
9
13
  = f.hidden_field :id
@@ -22,6 +22,11 @@
22
22
  = card do
23
23
  = render 'effective/applicants/summary', applicant: resource
24
24
 
25
+ - if resource.transcripts_required? && !resource.transcripts_received?
26
+ = card do
27
+ %h3 Transcripts
28
+ = render 'effective/applicants/transcripts_requirements', applicant: resource
29
+
25
30
  - if resource.min_applicant_references.to_i > 0 || resource.applicant_references.present?
26
31
  = card do
27
32
  %h3 Confidential References
@@ -7,6 +7,8 @@
7
7
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
8
8
  = f.hidden_field :id
9
9
 
10
+ - f.object.declare_will_send_transcripts = true if f.object.has_completed_step?(:transcripts)
11
+
10
12
  = f.check_box :declare_will_send_transcripts,
11
13
  label: "Yes, I will request my transcripts be sent directly from the insitiution to the registrar.", required: true
12
14
 
@@ -0,0 +1,3 @@
1
+ - # This is a shared partial for the CPD Step on Applicants and FeePayments
2
+
3
+ = f.check_box :declare_cpd, label: "Yes, my #{et('effective_cpd.name')} (#{et('effective_cpd.acronym')}) requirements are complete"
@@ -0,0 +1,15 @@
1
+ - # This is a shared partial for the CPD Step on Applicants and FeePayments
2
+
3
+ - if resource.cpd_required_cpd_cycles.blank?
4
+ %p You are not required to submit a #{cpd_statement_label} at this time.
5
+
6
+ - elsif resource.cpd_uncompleted_cpd_cycles.blank?
7
+ %p Thank you! All required #{cpd_statements_label} have been completed.
8
+
9
+ - elsif resource.cpd_uncompleted_cpd_cycles.present?
10
+ %p You must submit a #{cpd_statement_label} for the following #{cpd_cycles_label} before you may continue:
11
+
12
+ - resource.cpd_uncompleted_cpd_cycles.each do |cpd_cycle|
13
+ %p= link_to("#{cpd_cycle}", effective_cpd.cpd_cycle_cpd_statement_build_path(cpd_cycle, :new, :start), target: '_blank')
14
+
15
+ %p Please complete any required #{cpd_statements_label} then return here.
@@ -0,0 +1,18 @@
1
+ - # This is a shared partial for the CPD Step on Applicants and FeePayments
2
+
3
+ - available = EffectiveCpdAvailableCyclesDatatable.new(self, user: resource.user) unless resource.try(:was_submitted?)
4
+ - completed = EffectiveCpdCompletedStatementsDatatable.new(self, user: resource.user)
5
+
6
+ - if available.present?
7
+ %p The following #{cpd_cycles_label} are available:
8
+ = render_datatable(available, simple: true)
9
+
10
+ - if available.present? && completed.present?
11
+ .my-2
12
+
13
+ - if completed.present?
14
+ %p The following #{cpd_statements_label} have been completed:
15
+ = render_datatable(completed, simple: true)
16
+
17
+ - if available.blank? && completed.blank?
18
+ %p No #{cpd_statements_label} are present
@@ -16,12 +16,11 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
16
16
  t.boolean :can_apply_restricted, default: false
17
17
  t.text :can_apply_restricted_ids
18
18
 
19
- t.text :applicant_wizard_steps
20
19
  t.integer :applicant_fee
21
20
  t.integer :applicant_reinstatement_fee
21
+ t.text :applicant_wizard_steps
22
22
 
23
- t.text :applicant_review_wizard_steps
24
-
23
+ t.string :applicant_cpd_step_requirement
25
24
  t.integer :min_applicant_educations
26
25
  t.integer :min_applicant_experiences_months
27
26
  t.integer :min_applicant_references
@@ -31,8 +30,7 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
31
30
  t.integer :min_applicant_files
32
31
 
33
32
  t.integer :min_applicant_reviews
34
-
35
- t.text :fee_payment_wizard_steps
33
+ t.text :applicant_review_wizard_steps
36
34
 
37
35
  t.integer :prorated_jan
38
36
  t.integer :prorated_feb
@@ -48,6 +46,9 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
48
46
  t.integer :prorated_dec
49
47
 
50
48
  # Renewals
49
+ t.text :fee_payment_wizard_steps
50
+ t.string :fee_payment_cpd_step_requirement
51
+
51
52
  t.boolean :create_renewal_fees, default: false
52
53
  t.integer :renewal_fee
53
54
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.13.5'
2
+ VERSION = '0.13.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_memberships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.5
4
+ version: 0.13.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-11 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -369,13 +369,17 @@ files:
369
369
  - app/views/admin/categories/_fees_late.html.haml
370
370
  - app/views/admin/categories/_fees_nigs.html.haml
371
371
  - app/views/admin/categories/_fees_renewal.html.haml
372
+ - app/views/admin/categories/_fields_applicant_requirements.html.haml
373
+ - app/views/admin/categories/_fields_applicant_steps.html.haml
374
+ - app/views/admin/categories/_fields_fee_payment_requirements.html.haml
375
+ - app/views/admin/categories/_fields_fee_payment_steps.html.haml
372
376
  - app/views/admin/categories/_form.html.haml
373
377
  - app/views/admin/categories/_form_applicant_content.html.haml
374
378
  - app/views/admin/categories/_form_applicant_steps.html.haml
375
379
  - app/views/admin/categories/_form_category.html.haml
376
380
  - app/views/admin/categories/_form_fee_payment_content.html.haml
377
- - app/views/admin/categories/_form_fee_payment_steps.html.haml
378
381
  - app/views/admin/categories/_form_fees.html.haml
382
+ - app/views/admin/categories/_form_wizards.html.haml
379
383
  - app/views/admin/documents/_form.html.haml
380
384
  - app/views/admin/fee_payments/_fee_payment.html.haml
381
385
  - app/views/admin/fees/_fee.html.haml
@@ -431,8 +435,11 @@ files:
431
435
  - app/views/effective/applicants/_applicant.html.haml
432
436
  - app/views/effective/applicants/_content.html.haml
433
437
  - app/views/effective/applicants/_course_amounts.html.haml
438
+ - app/views/effective/applicants/_cpd.html.haml
439
+ - app/views/effective/applicants/_cpd_requirements.html.haml
434
440
  - app/views/effective/applicants/_dashboard.html.haml
435
441
  - app/views/effective/applicants/_declarations.html.haml
442
+ - app/views/effective/applicants/_declarations_fields.html.haml
436
443
  - app/views/effective/applicants/_demographics.html.haml
437
444
  - app/views/effective/applicants/_education.html.haml
438
445
  - app/views/effective/applicants/_endorsements.html.haml
@@ -445,6 +452,7 @@ files:
445
452
  - app/views/effective/applicants/_organization.html.haml
446
453
  - app/views/effective/applicants/_owner.html.haml
447
454
  - app/views/effective/applicants/_references.html.haml
455
+ - app/views/effective/applicants/_references_requirements.html.haml
448
456
  - app/views/effective/applicants/_reinstatement.html.haml
449
457
  - app/views/effective/applicants/_select.html.haml
450
458
  - app/views/effective/applicants/_select_organization.html.haml
@@ -455,6 +463,7 @@ files:
455
463
  - app/views/effective/applicants/billing.html.haml
456
464
  - app/views/effective/applicants/checkout.html.haml
457
465
  - app/views/effective/applicants/course_amounts.html.haml
466
+ - app/views/effective/applicants/cpd.html.haml
458
467
  - app/views/effective/applicants/declarations.html.haml
459
468
  - app/views/effective/applicants/demographics.html.haml
460
469
  - app/views/effective/applicants/education.html.haml
@@ -517,6 +526,9 @@ files:
517
526
  - app/views/effective/organizations/_form_organization.html.haml
518
527
  - app/views/effective/representatives/_form.html.haml
519
528
  - app/views/effective/representatives/_user_fields.html.haml
529
+ - app/views/effective/wizard_steps/_cpd_fields.html.haml
530
+ - app/views/effective/wizard_steps/_cpd_requirements.html.haml
531
+ - app/views/effective/wizard_steps/_cpd_statements.html.haml
520
532
  - app/views/organizations/_demographics.html.haml
521
533
  - app/views/organizations/_fields_demographics.html.haml
522
534
  - app/views/users/_demographics.html.haml
@@ -1,6 +0,0 @@
1
- = effective_form_with(model: [:admin, category], engine: true) do |f|
2
- %h3 Renewal Wizard Steps
3
- - f.object.fee_payment_wizard_steps += EffectiveMemberships.FeePayment.required_wizard_steps
4
- = f.checks :fee_payment_wizard_steps, f.object.fee_payment_wizard_steps_collection(), label: false
5
-
6
- = f.submit