effective_memberships 0.3.14 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/admin/organizations_controller.rb +19 -0
- data/app/controllers/admin/representatives_controller.rb +19 -0
- data/app/controllers/effective/applicants_controller.rb +2 -3
- data/app/controllers/effective/fee_payments_controller.rb +1 -2
- data/app/controllers/effective/organizations_controller.rb +16 -0
- data/app/controllers/effective/representatives_controller.rb +19 -0
- data/app/datatables/admin/effective_applicants_datatable.rb +10 -5
- data/app/datatables/admin/effective_categories_datatable.rb +7 -0
- data/app/datatables/admin/effective_fee_payments_datatable.rb +11 -6
- data/app/datatables/admin/effective_organizations_datatable.rb +31 -0
- data/app/datatables/admin/effective_representatives_datatable.rb +28 -0
- data/app/datatables/effective_applicants_datatable.rb +1 -1
- data/app/datatables/effective_fee_payments_datatable.rb +5 -4
- data/app/datatables/effective_organizations_datatable.rb +18 -0
- data/app/datatables/effective_representatives_datatable.rb +40 -0
- data/app/helpers/effective_memberships_helper.rb +25 -0
- data/app/mailers/effective/memberships_mailer.rb +7 -7
- data/app/models/concerns/effective_memberships_applicant.rb +63 -30
- data/app/models/concerns/effective_memberships_category.rb +32 -5
- data/app/models/concerns/effective_memberships_fee_payment.rb +44 -45
- data/app/models/concerns/effective_memberships_organization.rb +94 -0
- data/app/models/concerns/effective_memberships_owner.rb +0 -55
- data/app/models/concerns/effective_memberships_registrar.rb +2 -2
- data/app/models/concerns/effective_memberships_user.rb +70 -0
- data/app/models/effective/fee.rb +1 -1
- data/app/models/effective/organization.rb +8 -0
- data/app/models/effective/representative.rb +56 -0
- data/app/views/admin/categories/_form_applicant_eligibility.html.haml +1 -1
- data/app/views/admin/categories/_form_applicant_steps.html.haml +29 -24
- data/app/views/admin/categories/_form_category.html.haml +3 -0
- data/app/views/admin/categories/_form_renewals.html.haml +0 -2
- data/app/views/admin/organizations/_fields.html.haml +6 -0
- data/app/views/admin/organizations/_form.html.haml +31 -0
- data/app/views/admin/organizations/_form_organization.html.haml +23 -0
- data/app/views/admin/representatives/_form.html.haml +38 -0
- data/app/views/{effective/applicants/_demographics_fields.html.haml → admin/representatives/_user_fields.html.haml} +2 -6
- data/app/views/effective/applicants/_dashboard.html.haml +24 -5
- data/app/views/effective/applicants/_demographics.html.haml +1 -1
- data/app/views/effective/applicants/_missing_info.html.haml +7 -3
- data/app/views/effective/applicants/_organization.html.haml +9 -0
- data/app/views/effective/applicants/_select_organization.html.haml +21 -0
- data/app/views/effective/applicants/_summary.html.haml +17 -9
- data/app/views/effective/applicants/billing.html.haml +2 -2
- data/app/views/effective/applicants/demographics.html.haml +7 -6
- data/app/views/effective/applicants/education.html.haml +2 -2
- data/app/views/effective/applicants/organization.html.haml +19 -0
- data/app/views/effective/applicants/references.html.haml +1 -1
- data/app/views/effective/applicants/select.html.haml +11 -1
- data/app/views/effective/applicants/stamp.html.haml +2 -2
- data/app/views/effective/applicants/start.html.haml +17 -11
- data/app/views/effective/applicants/submitted.html.haml +5 -5
- data/app/views/effective/applicants/summary.html.haml +1 -1
- data/app/views/effective/fee_payments/_demographics.html.haml +1 -1
- data/app/views/effective/fee_payments/_organization.html.haml +9 -0
- data/app/views/effective/fee_payments/_summary.html.haml +39 -1
- data/app/views/effective/fee_payments/billing.html.haml +2 -2
- data/app/views/effective/fee_payments/demographics.html.haml +2 -2
- data/app/views/effective/fee_payments/organization.html.haml +18 -0
- data/app/views/effective/fee_payments/start.html.haml +20 -17
- data/app/views/effective/fee_payments/submitted.html.haml +10 -3
- data/app/views/effective/fees/_dashboard.html.haml +20 -8
- data/app/views/effective/memberships/_dashboard.html.haml +16 -5
- data/app/views/effective/organizations/_dashboard.html.haml +10 -0
- data/app/views/effective/organizations/_form.html.haml +8 -0
- data/app/views/effective/organizations/_form_organization.html.haml +11 -0
- data/app/views/effective/representatives/_form.html.haml +33 -0
- data/app/views/effective/{fee_payments/_demographics_fields.html.haml → representatives/_user_fields.html.haml} +2 -6
- data/app/views/organizations/_demographics.html.haml +45 -0
- data/app/views/organizations/_fields_demographics.html.haml +29 -0
- data/app/views/users/_demographics.html.haml +50 -0
- data/app/views/users/_fields_demographics.html.haml +29 -0
- data/config/effective_memberships.rb +3 -0
- data/config/routes.rb +9 -0
- data/db/migrate/01_create_effective_memberships.rb.erb +57 -10
- data/db/seeds.rb +18 -0
- data/lib/effective_memberships/engine.rb +3 -0
- data/lib/effective_memberships/version.rb +1 -1
- data/lib/effective_memberships.rb +6 -2
- metadata +33 -20
- data/app/views/effective/applicants/_demographics_owner.html.haml +0 -20
- data/app/views/effective/fee_payments/_demographics_owner.html.haml +0 -20
@@ -1,20 +1,32 @@
|
|
1
1
|
%h2 Fees
|
2
|
-
- current_owner = current_user.effective_memberships_owner
|
3
2
|
|
4
|
-
-
|
5
|
-
-
|
3
|
+
- memberships = current_user.memberships
|
4
|
+
- outstanding_owners = current_user.memberships_owners.select { |owner| owner.outstanding_fee_payment_fees.present? }
|
6
5
|
|
7
|
-
- if
|
8
|
-
- if membership.category.create_renewal_fees?
|
6
|
+
- if memberships.present?
|
7
|
+
- if memberships.any? { |membership| membership.category.create_renewal_fees? }
|
9
8
|
- date = EffectiveMemberships.Registrar.renewal_fee_date(date: Time.zone.now)
|
10
9
|
%p Annual fees become available for purchase on #{date.strftime('%B %e')} of each year.
|
11
10
|
|
12
|
-
- if membership.category.create_late_fees?
|
11
|
+
- if memberships.any? { |membership| membership.category.create_late_fees? }
|
13
12
|
- date = EffectiveMemberships.Registrar.late_fee_date(date: Time.zone.now)
|
14
13
|
%p Late fees will be applied on #{date.strftime('%B %e')}.
|
15
14
|
|
16
|
-
- if
|
17
|
-
|
15
|
+
- if memberships.any? { |membership| membership.category.create_bad_standing? }
|
16
|
+
- date = EffectiveMemberships.Registrar.bad_standing_date(date: Time.zone.now)
|
17
|
+
%p Memberships with unpaid fees will be marked in bad standing on #{date.strftime('%B %e')}.
|
18
|
+
|
19
|
+
- if outstanding_owners.present?
|
20
|
+
.alert.alert-warning.mb-3 You have outstanding fees ready to purchase.
|
21
|
+
|
22
|
+
%ul
|
23
|
+
- outstanding_owners.each do |owner|
|
24
|
+
%li
|
25
|
+
= owner
|
26
|
+
|
27
|
+
- if owner.outstanding_fee_payment_fees.present?
|
28
|
+
= '-'
|
29
|
+
= pluralize(owner.outstanding_fee_payment_fees.length, 'outstanding fee')
|
18
30
|
|
19
31
|
%p= link_to 'Pay Fees', effective_memberships.new_fee_payment_path, class: 'btn btn-primary'
|
20
32
|
|
@@ -1,8 +1,9 @@
|
|
1
|
-
-
|
2
|
-
-
|
1
|
+
- membership = current_user.membership
|
2
|
+
- membership_organizations = current_user.membership_organizations
|
3
3
|
|
4
4
|
%h2 Membership
|
5
5
|
|
6
|
+
-# Individual membership
|
6
7
|
- if membership.present?
|
7
8
|
- if membership.categories.length == 0
|
8
9
|
%p
|
@@ -29,8 +30,18 @@
|
|
29
30
|
- if membership.bad_standing?
|
30
31
|
%p Your membership is in bad standing with the following reason: #{membership.bad_standing_reason}.
|
31
32
|
|
32
|
-
-
|
33
|
-
%p Your membership was removed on #{
|
33
|
+
- if current_user.membership_removed?
|
34
|
+
%p Your membership was removed on #{current_user.membership_removed_on.strftime('%F')}.
|
34
35
|
|
35
|
-
-
|
36
|
+
- if membership_organizations.present?
|
37
|
+
%p You are a representative for #{pluralize(membership_organizations.length, 'member organization')}.
|
38
|
+
|
39
|
+
%ul
|
40
|
+
- membership_organizations.each do |organization|
|
41
|
+
%li
|
42
|
+
= organization
|
43
|
+
= '-'
|
44
|
+
= organization.membership.categories.to_sentence
|
45
|
+
|
46
|
+
- if current_user.is?(:member) == false
|
36
47
|
%p You are not a member.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%h2 Organizations
|
2
|
+
|
3
|
+
- if current_user.organizations.present?
|
4
|
+
%p You are a representative for #{pluralize(current_user.organizations.length, 'organization')}.
|
5
|
+
|
6
|
+
- datatable = EffectiveResources.best('EffectiveOrganizationsDatatable').new(self, namespace: :effective)
|
7
|
+
= render_datatable(datatable, simple: true)
|
8
|
+
|
9
|
+
- else
|
10
|
+
%p You are not a representative. When you create an organization, or if someone else adds you to their organization, we'll show them here.
|
@@ -0,0 +1,8 @@
|
|
1
|
+
= tabs do
|
2
|
+
= tab 'Organization' do
|
3
|
+
= render 'effective/organizations/form_organization', organization: organization
|
4
|
+
|
5
|
+
- if organization.persisted?
|
6
|
+
- if organization.respond_to?(:log_changes_datatable)
|
7
|
+
= tab 'Logs' do
|
8
|
+
= render_inline_datatable(organization.log_changes_datatable)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- url = (organization.persisted? ? effective_memberships.organization_path(organization) : effective_memberships.organizations_path)
|
2
|
+
|
3
|
+
= effective_form_with(model: organization, url: url) do |f|
|
4
|
+
%h2 Organization Info
|
5
|
+
= render 'organizations/fields_demographics', f: f, organization: organization
|
6
|
+
= f.submit
|
7
|
+
|
8
|
+
- if organization.persisted?
|
9
|
+
%h2 Representatives
|
10
|
+
- datatable = EffectiveRepresentativesDatatable.new(organization: organization)
|
11
|
+
= render_inline_datatable(datatable)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
= effective_form_with(model: representative, engine: true) do |f|
|
2
|
+
- f.object.user_type ||= current_user.class.name
|
3
|
+
|
4
|
+
= f.hidden_field :user_id
|
5
|
+
= f.hidden_field :user_type
|
6
|
+
= f.hidden_field :organization_id
|
7
|
+
= f.hidden_field :organization_type
|
8
|
+
|
9
|
+
- if f.object.new_record?
|
10
|
+
- unless inline_datatable? && inline_datatable.attributes[:organization_id].present?
|
11
|
+
= f.select :organization, { 'Organizations' => EffectiveMemberships.Organization.sorted }, polymorphic: true
|
12
|
+
|
13
|
+
= f.checks :roles, EffectiveRoles.roles_collection(f.object, skip_disabled: true)
|
14
|
+
|
15
|
+
- unless inline_datatable? && inline_datatable.attributes[:user_id].present?
|
16
|
+
= f.hidden_field :new_representative_user_action, value: 'Invite new user'
|
17
|
+
|
18
|
+
= f.fields_for :user, (f.object.user || f.object.build_user) do |fu|
|
19
|
+
= render 'effective/representatives/user_fields', f: fu
|
20
|
+
|
21
|
+
- if f.object.persisted?
|
22
|
+
- unless inline_datatable? && inline_datatable.attributes[:organization_id].present?
|
23
|
+
= f.static_field :organization
|
24
|
+
|
25
|
+
- unless inline_datatable? && inline_datatable.attributes[:user_id].present?
|
26
|
+
= f.static_field :user
|
27
|
+
|
28
|
+
= f.checks :roles, EffectiveRoles.roles_collection(f.object, skip_disabled: true)
|
29
|
+
|
30
|
+
= f.fields_for :user, f.object.user do |fu|
|
31
|
+
= render 'effective/representatives/user_fields', f: fu
|
32
|
+
|
33
|
+
= f.submit
|
@@ -1,11 +1,7 @@
|
|
1
|
+
= f.email_field :email
|
2
|
+
|
1
3
|
- if f.object.respond_to?(:first_name)
|
2
4
|
= f.text_field :first_name
|
3
5
|
|
4
6
|
- if f.object.respond_to?(:last_name)
|
5
7
|
= f.text_field :last_name
|
6
|
-
|
7
|
-
- if f.object.respond_to?(:date_of_birth)
|
8
|
-
= f.date_field :date_of_birth
|
9
|
-
|
10
|
-
- if f.object.respond_to?(:phone)
|
11
|
-
= f.tel_field :phone
|
@@ -0,0 +1,45 @@
|
|
1
|
+
-# This is a placeholder file that should be overriden by the main application
|
2
|
+
|
3
|
+
%table.table.table-sm
|
4
|
+
%tbody
|
5
|
+
%tr
|
6
|
+
%th Name
|
7
|
+
%td= organization.to_s
|
8
|
+
|
9
|
+
%tr
|
10
|
+
%th Email
|
11
|
+
%td= mail_to organization.email
|
12
|
+
|
13
|
+
- if organization.respond_to?(:website)
|
14
|
+
%tr
|
15
|
+
%th Website:
|
16
|
+
%td= organization.website.presence || '-'
|
17
|
+
|
18
|
+
- if organization.respond_to?(:phone)
|
19
|
+
%tr
|
20
|
+
%th Phone:
|
21
|
+
%td= organization.phone.presence || '-'
|
22
|
+
|
23
|
+
- if organization.respond_to?(:company_phone)
|
24
|
+
%tr
|
25
|
+
%th Company Phone:
|
26
|
+
%td= organization.company_phone.presence || '-'
|
27
|
+
|
28
|
+
- if organization.respond_to?(:cell_phone)
|
29
|
+
%tr
|
30
|
+
%th Cell Phone:
|
31
|
+
%td= organization.cell_phone.presence || '-'
|
32
|
+
|
33
|
+
- if organization.respond_to?(:fax)
|
34
|
+
%tr
|
35
|
+
%th Fax:
|
36
|
+
%td= organization.fax.presence || '-'
|
37
|
+
|
38
|
+
- if organization.respond_to?(:billing_address)
|
39
|
+
%tr
|
40
|
+
%th Billing Address:
|
41
|
+
%td
|
42
|
+
- if organization.billing_address.present?
|
43
|
+
= organization.billing_address.to_html
|
44
|
+
- else
|
45
|
+
= '-'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
-# This is a placeholder file that should be overriden by the main application
|
2
|
+
|
3
|
+
- if f.object.respond_to?(:title)
|
4
|
+
= f.text_field :title
|
5
|
+
|
6
|
+
- if f.object.respond_to?(:name)
|
7
|
+
= f.text_field :name
|
8
|
+
|
9
|
+
- if f.object.respond_to?(:email)
|
10
|
+
= f.email_field :email
|
11
|
+
|
12
|
+
- if f.object.respond_to?(:website)
|
13
|
+
= f.url_field :website
|
14
|
+
|
15
|
+
- if f.object.respond_to?(:phone)
|
16
|
+
= f.tel_field :phone
|
17
|
+
|
18
|
+
- if f.object.respond_to?(:company_phone)
|
19
|
+
= f.tel_field :company_phone
|
20
|
+
|
21
|
+
- if f.object.respond_to?(:cell_phone)
|
22
|
+
= f.tel_field :cell_phone
|
23
|
+
|
24
|
+
- if f.object.respond_to?(:fax)
|
25
|
+
= f.tel_field :fax
|
26
|
+
|
27
|
+
- if f.object.respond_to?(:billing_address)
|
28
|
+
%h2 Billing Address
|
29
|
+
= effective_address_fields(f, :billing_address)
|
@@ -0,0 +1,50 @@
|
|
1
|
+
-# This is a placeholder file that should be overriden by the main application
|
2
|
+
|
3
|
+
%table.table.table-sm
|
4
|
+
%tbody
|
5
|
+
%tr
|
6
|
+
%th Name
|
7
|
+
%td= user.to_s
|
8
|
+
|
9
|
+
%tr
|
10
|
+
%th Email
|
11
|
+
%td= mail_to user.email
|
12
|
+
|
13
|
+
- if user.respond_to?(:job_title)
|
14
|
+
%tr
|
15
|
+
%th Job Title:
|
16
|
+
%td= user.job_title.presence || '-'
|
17
|
+
|
18
|
+
- if user.respond_to?(:date_of_birth)
|
19
|
+
%tr
|
20
|
+
%th Date of Birth
|
21
|
+
%td= user.date_of_birth&.strftime('%F').presence || '-'
|
22
|
+
|
23
|
+
- if user.respond_to?(:phone)
|
24
|
+
%tr
|
25
|
+
%th Phone:
|
26
|
+
%td= user.phone.presence || '-'
|
27
|
+
|
28
|
+
- if user.respond_to?(:home_phone)
|
29
|
+
%tr
|
30
|
+
%th Home Phone:
|
31
|
+
%td= user.home_phone.presence || '-'
|
32
|
+
|
33
|
+
- if user.respond_to?(:cell_phone)
|
34
|
+
%tr
|
35
|
+
%th Cell Phone:
|
36
|
+
%td= user.cell_phone.presence || '-'
|
37
|
+
|
38
|
+
- if user.respond_to?(:fax)
|
39
|
+
%tr
|
40
|
+
%th Fax:
|
41
|
+
%td= user.fax.presence || '-'
|
42
|
+
|
43
|
+
- if user.respond_to?(:billing_address)
|
44
|
+
%tr
|
45
|
+
%th Billing Address:
|
46
|
+
%td
|
47
|
+
- if user.billing_address.present?
|
48
|
+
= user.billing_address.to_html
|
49
|
+
- else
|
50
|
+
= '-'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
-# This is a placeholder file that should be overriden by the main application
|
2
|
+
|
3
|
+
- if f.object.respond_to?(:first_name)
|
4
|
+
= f.text_field :first_name
|
5
|
+
|
6
|
+
- if f.object.respond_to?(:last_name)
|
7
|
+
= f.text_field :last_name
|
8
|
+
|
9
|
+
- if f.object.respond_to?(:job_title)
|
10
|
+
= f.text_field :job_title
|
11
|
+
|
12
|
+
- if f.object.respond_to?(:date_of_birth)
|
13
|
+
= f.date_field :date_of_birth
|
14
|
+
|
15
|
+
- if f.object.respond_to?(:phone)
|
16
|
+
= f.tel_field :phone
|
17
|
+
|
18
|
+
- if f.object.respond_to?(:home_phone)
|
19
|
+
= f.tel_field :home_phone
|
20
|
+
|
21
|
+
- if f.object.respond_to?(:cell_phone)
|
22
|
+
= f.tel_field :cell_phone
|
23
|
+
|
24
|
+
- if f.object.respond_to?(:fax)
|
25
|
+
= f.tel_field :fax
|
26
|
+
|
27
|
+
- if f.object.respond_to?(:billing_address)
|
28
|
+
%h2 Billing Address
|
29
|
+
= effective_address_fields(f, :billing_address)
|
@@ -3,6 +3,8 @@ EffectiveMemberships.setup do |config|
|
|
3
3
|
config.applicants_table_name = :applicants
|
4
4
|
config.applicant_reviews_table_name = :applicant_reviews
|
5
5
|
config.fee_payments_table_name = :fee_payments
|
6
|
+
config.organizations_table_name = :organizations
|
7
|
+
config.representatives_table_name = :representatives
|
6
8
|
|
7
9
|
# Layout Settings
|
8
10
|
# Configure the Layout per controller, or all at once
|
@@ -16,6 +18,7 @@ EffectiveMemberships.setup do |config|
|
|
16
18
|
# config.applicant_class_name = 'Effective::Applicant'
|
17
19
|
# config.applicant_review_class_name = 'Effective::ApplicantReview'
|
18
20
|
# config.registrar_class_name = 'Effective::Registrar'
|
21
|
+
# config.organization_class_name = 'Effective::Organization'
|
19
22
|
|
20
23
|
# Fee Categories
|
21
24
|
# The defaults include: Applicant, Prorated, Renewal, Late, Admin
|
data/config/routes.rb
CHANGED
@@ -25,6 +25,8 @@ EffectiveMemberships::Engine.routes.draw do
|
|
25
25
|
get :membership_card, on: :member, to: 'membership_cards#show'
|
26
26
|
end
|
27
27
|
|
28
|
+
resources :organizations, except: [:show, :destroy]
|
29
|
+
resources :representatives, except: [:show]
|
28
30
|
end
|
29
31
|
|
30
32
|
namespace :admin do
|
@@ -43,6 +45,13 @@ EffectiveMemberships::Engine.routes.draw do
|
|
43
45
|
resources :fee_payments, only: [:index, :show]
|
44
46
|
resources :memberships, only: [:index]
|
45
47
|
resources :registrar_actions, only: [:create]
|
48
|
+
|
49
|
+
resources :organizations, except: [:show] do
|
50
|
+
post :archive, on: :member
|
51
|
+
post :unarchive, on: :member
|
52
|
+
end
|
53
|
+
|
54
|
+
resources :representatives, except: [:show]
|
46
55
|
end
|
47
56
|
|
48
57
|
end
|
@@ -3,8 +3,10 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
|
|
3
3
|
|
4
4
|
# Categories
|
5
5
|
create_table :categories do |t|
|
6
|
+
t.string :category_type # Individual or Organization
|
7
|
+
|
6
8
|
t.string :title
|
7
|
-
t.string :category
|
9
|
+
t.string :category # Freeform
|
8
10
|
|
9
11
|
t.integer :position
|
10
12
|
|
@@ -119,12 +121,57 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
|
|
119
121
|
add_index :membership_histories, [:owner_id, :owner_type]
|
120
122
|
add_index :membership_histories, :start_on
|
121
123
|
|
124
|
+
# Organizations
|
125
|
+
create_table :organizations do |t|
|
126
|
+
t.string :email
|
127
|
+
|
128
|
+
t.string :title
|
129
|
+
|
130
|
+
t.string :phone
|
131
|
+
t.string :fax
|
132
|
+
t.string :website
|
133
|
+
|
134
|
+
t.string :category
|
135
|
+
t.text :notes
|
136
|
+
|
137
|
+
t.integer :roles_mask
|
138
|
+
t.boolean :archived, default: false
|
139
|
+
|
140
|
+
t.integer :representatives_count, default: 0
|
141
|
+
|
142
|
+
t.datetime :updated_at
|
143
|
+
t.datetime :created_at
|
144
|
+
end
|
145
|
+
|
146
|
+
add_index :organizations, :title
|
147
|
+
|
148
|
+
# Representatives
|
149
|
+
create_table :representatives do |t|
|
150
|
+
t.integer :organization_id
|
151
|
+
t.string :organization_type
|
152
|
+
|
153
|
+
t.integer :user_id
|
154
|
+
t.string :user_type
|
155
|
+
|
156
|
+
t.integer :roles_mask
|
157
|
+
|
158
|
+
t.datetime :updated_at
|
159
|
+
t.datetime :created_at
|
160
|
+
end
|
161
|
+
|
162
|
+
add_index :representatives, [:organization_id, :organization_type]
|
163
|
+
add_index :representatives, [:user_id, :user_type]
|
164
|
+
|
122
165
|
# Applicants
|
123
166
|
create_table :applicants do |t|
|
167
|
+
t.string :applicant_type
|
124
168
|
t.string :token
|
125
169
|
|
126
|
-
t.integer :
|
127
|
-
t.string :
|
170
|
+
t.integer :user_id
|
171
|
+
t.string :user_type
|
172
|
+
|
173
|
+
t.integer :organization_id
|
174
|
+
t.string :organization_type
|
128
175
|
|
129
176
|
t.integer :category_id
|
130
177
|
t.string :category_type
|
@@ -132,8 +179,6 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
|
|
132
179
|
t.integer :from_category_id
|
133
180
|
t.string :from_category_type
|
134
181
|
|
135
|
-
t.string :applicant_type
|
136
|
-
|
137
182
|
# Acts as Statused
|
138
183
|
t.string :status
|
139
184
|
t.text :status_steps
|
@@ -169,7 +214,8 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
|
|
169
214
|
t.datetime :created_at
|
170
215
|
end
|
171
216
|
|
172
|
-
add_index :applicants, [:
|
217
|
+
add_index :applicants, [:user_id, :user_type]
|
218
|
+
add_index :applicants, [:organization_id, :organization_type]
|
173
219
|
add_index :applicants, :status
|
174
220
|
add_index :applicants, :token
|
175
221
|
|
@@ -361,12 +407,12 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
|
|
361
407
|
create_table :fee_payments do |t|
|
362
408
|
t.string :token
|
363
409
|
|
364
|
-
t.integer :owner_id
|
365
|
-
t.string :owner_type
|
366
|
-
|
367
410
|
t.integer :user_id
|
368
411
|
t.string :user_type
|
369
412
|
|
413
|
+
t.integer :organization_id
|
414
|
+
t.string :organization_type
|
415
|
+
|
370
416
|
t.integer :category_id
|
371
417
|
t.string :category_type
|
372
418
|
|
@@ -386,7 +432,8 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
|
|
386
432
|
t.datetime :created_at
|
387
433
|
end
|
388
434
|
|
389
|
-
add_index :fee_payments, [:
|
435
|
+
add_index :fee_payments, [:user_id, :user_type]
|
436
|
+
add_index :fee_payments, [:organization_id, :organization_type]
|
390
437
|
add_index :fee_payments, :status
|
391
438
|
add_index :fee_payments, :token
|
392
439
|
|
data/db/seeds.rb
CHANGED
@@ -56,6 +56,24 @@ retired = Effective::Category.create!(
|
|
56
56
|
tax_exempt: false
|
57
57
|
)
|
58
58
|
|
59
|
+
member = Effective::Category.create!(
|
60
|
+
category_type: 'Organization',
|
61
|
+
title: "Corporate",
|
62
|
+
can_apply_new: true,
|
63
|
+
can_apply_existing: true,
|
64
|
+
create_renewal_fees: true,
|
65
|
+
create_late_fees: true,
|
66
|
+
min_applicant_references: 2,
|
67
|
+
min_applicant_reviews: 2,
|
68
|
+
applicant_fee: 100_00,
|
69
|
+
renewal_fee: 250_00,
|
70
|
+
late_fee: 50_00,
|
71
|
+
prorated_jan: 120_00, prorated_feb: 110_00, prorated_mar: 100_00, prorated_apr: 90_00, prorated_may: 80_00, prorated_jun: 70_00,
|
72
|
+
prorated_jul: 60_00, prorated_aug: 50_00, prorated_sep: 40_00, prorated_oct: 30_00, prorated_nov: 20_00, prorated_dec: 10_00,
|
73
|
+
qb_item_name: 'Corporate Member Quickbooks Name',
|
74
|
+
tax_exempt: false
|
75
|
+
)
|
76
|
+
|
59
77
|
area = Effective::ApplicantCourseArea.create!(title: 'Science')
|
60
78
|
area.applicant_course_names.create!(title: 'Science 100')
|
61
79
|
area.applicant_course_names.create!(title: 'Science 200')
|
@@ -13,6 +13,9 @@ module EffectiveMemberships
|
|
13
13
|
ActiveRecord::Base.extend(EffectiveMembershipsOwner::Base)
|
14
14
|
ActiveRecord::Base.extend(EffectiveMembershipsCategory::Base)
|
15
15
|
|
16
|
+
ActiveRecord::Base.extend(EffectiveMembershipsUser::Base)
|
17
|
+
ActiveRecord::Base.extend(EffectiveMembershipsOrganization::Base)
|
18
|
+
|
16
19
|
ActiveRecord::Base.extend(EffectiveMembershipsApplicant::Base)
|
17
20
|
ActiveRecord::Base.extend(EffectiveMembershipsApplicantReview::Base)
|
18
21
|
ActiveRecord::Base.extend(EffectiveMembershipsFeePayment::Base)
|
@@ -6,8 +6,8 @@ module EffectiveMemberships
|
|
6
6
|
|
7
7
|
def self.config_keys
|
8
8
|
[
|
9
|
-
:categories_table_name, :applicants_table_name, :applicant_reviews_table_name, :fee_payments_table_name,
|
10
|
-
:category_class_name, :applicant_class_name, :applicant_review_class_name, :fee_payment_class_name, :registrar_class_name, :membership_card_class_name,
|
9
|
+
:categories_table_name, :applicants_table_name, :applicant_reviews_table_name, :fee_payments_table_name, :organizations_table_name, :representatives_table_name,
|
10
|
+
:category_class_name, :organization_class_name, :applicant_class_name, :applicant_review_class_name, :fee_payment_class_name, :registrar_class_name, :membership_card_class_name,
|
11
11
|
:additional_fee_types, :applicant_reviews,
|
12
12
|
:layout,
|
13
13
|
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject, :use_effective_email_templates
|
@@ -20,6 +20,10 @@ module EffectiveMemberships
|
|
20
20
|
category_class_name&.constantize || Effective::Category
|
21
21
|
end
|
22
22
|
|
23
|
+
def self.Organization
|
24
|
+
organization_class_name&.constantize || Effective::Organization
|
25
|
+
end
|
26
|
+
|
23
27
|
def self.Applicant
|
24
28
|
applicant_class_name&.constantize || Effective::Applicant
|
25
29
|
end
|