effective_memberships 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/applicant_references_controller.rb +2 -1
- data/app/controllers/effective/applicants_controller.rb +1 -1
- data/app/controllers/effective/fee_payments_controller.rb +2 -3
- data/app/datatables/effective_applicants_datatable.rb +1 -1
- data/app/datatables/effective_fee_payments_datatable.rb +7 -12
- data/app/models/concerns/effective_memberships_fee_payment.rb +0 -1
- data/app/models/concerns/effective_memberships_owner.rb +17 -1
- data/app/views/effective/fee_payments/_dashboard.html.haml +1 -3
- data/app/views/effective/fee_payments/start.html.haml +19 -5
- data/lib/effective_memberships/version.rb +1 -1
- 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: 94c86611361e96c3285e00fde6075fcffa29463c30a7dd2b50eaec13b9932874
|
4
|
+
data.tar.gz: faaa7786c43295547b10febc3c6f55b1e4041235d693f6f7e02094c22780f5af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9c66aaa1fe570f885d5b36b83f733cf15f8b4d3e2a1968d5bd4db197cbddd33a91247405a60fde9ab5dbde210de04119d3f51594baf09946a7ebdcc8c29029d
|
7
|
+
data.tar.gz: 3b36dee1f865804437f63415680c49c131b9ee94a4ae7f8e31e2df789268ae413e43ea8db3ea8c8548e352a63cf33273b508832dcd1eb476ae877c19c8bcdc50
|
@@ -24,8 +24,9 @@ module Effective
|
|
24
24
|
|
25
25
|
def permitted_params
|
26
26
|
permitted = params.require(:effective_applicant_reference).permit!.except(:token, :last_notified_at, :status, :status_steps)
|
27
|
+
authorized = current_user.effective_memberships_owners.include?(resource.applicant.owner) == false
|
27
28
|
|
28
|
-
if resource.submitted? && resource.applicant.was_submitted? &&
|
29
|
+
if resource.submitted? && resource.applicant.was_submitted? && authorized
|
29
30
|
permitted
|
30
31
|
else
|
31
32
|
permitted.except(:reservations, :reservations_reason, :work_history, :accept_declaration)
|
@@ -4,7 +4,7 @@ module Effective
|
|
4
4
|
|
5
5
|
include Effective::WizardController
|
6
6
|
|
7
|
-
resource_scope -> { EffectiveMemberships.Applicant.deep.where(owner: current_user.
|
7
|
+
resource_scope -> { EffectiveMemberships.Applicant.deep.where(owner: current_user.effective_memberships_owners) }
|
8
8
|
|
9
9
|
# Allow only 1 in-progress application at a time
|
10
10
|
before_action(only: [:new, :show], unless: -> { resource&.done? }) do
|
@@ -4,7 +4,7 @@ module Effective
|
|
4
4
|
|
5
5
|
include Effective::WizardController
|
6
6
|
|
7
|
-
resource_scope -> { EffectiveMemberships.FeePayment.deep.where(owner: current_user.
|
7
|
+
resource_scope -> { EffectiveMemberships.FeePayment.deep.where(owner: current_user.effective_memberships_owners) }
|
8
8
|
|
9
9
|
# Allow only 1 in-progress fee payment at a time
|
10
10
|
before_action(only: [:new, :show], unless: -> { resource&.done? }) do
|
@@ -20,8 +20,7 @@ module Effective
|
|
20
20
|
|
21
21
|
def permitted_params
|
22
22
|
params.require(:fee_payment).permit!.except(
|
23
|
-
:
|
24
|
-
:submitted_at
|
23
|
+
:status, :status_steps, :wizard_steps, :submitted_at
|
25
24
|
)
|
26
25
|
end
|
27
26
|
|
@@ -28,7 +28,7 @@ class EffectiveApplicantsDatatable < Effective::Datatable
|
|
28
28
|
end
|
29
29
|
|
30
30
|
collection do
|
31
|
-
EffectiveMemberships.Applicant.deep.where(owner: current_user.
|
31
|
+
EffectiveMemberships.Applicant.deep.where(owner: current_user.effective_memberships_owners)
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|
@@ -6,24 +6,19 @@ class EffectiveFeePaymentsDatatable < Effective::Datatable
|
|
6
6
|
col :token, visible: false
|
7
7
|
col :created_at, visible: false
|
8
8
|
|
9
|
-
col :
|
10
|
-
col :
|
9
|
+
col :owner
|
10
|
+
col :status, visible: false
|
11
11
|
col :submitted_at, label: 'Submitted', as: :date
|
12
|
+
col :period, visible: false
|
12
13
|
|
13
|
-
col :orders
|
14
|
+
col :orders, action: :show
|
14
15
|
|
15
|
-
actions_col(
|
16
|
-
if fee_payment.draft?
|
17
|
-
dropdown_link_to('Continue', effective_memberships.fee_payment_build_path(fee_payment, fee_payment.next_step), 'data-turbolinks' => false)
|
18
|
-
dropdown_link_to('Delete', effective_memberships.fee_payment_path(fee_payment), 'data-confirm': "Really delete #{fee_payment}?", 'data-method': :delete)
|
19
|
-
else
|
20
|
-
dropdown_link_to('Show', effective_memberships.fee_payment_path(fee_payment))
|
21
|
-
end
|
22
|
-
end
|
16
|
+
actions_col(new: false)
|
23
17
|
end
|
24
18
|
|
25
19
|
collection do
|
26
|
-
EffectiveMemberships.FeePayment.deep.
|
20
|
+
EffectiveMemberships.FeePayment.deep.done
|
21
|
+
.where(owner: current_user.effective_memberships_owners)
|
27
22
|
end
|
28
23
|
|
29
24
|
end
|
@@ -46,7 +46,23 @@ module EffectiveMembershipsOwner
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def effective_memberships_owner
|
49
|
-
|
49
|
+
raise('expected singular usage but there are more than one owner') if effective_memberships_owners.length > 1
|
50
|
+
effective_memberships_owners.first
|
51
|
+
end
|
52
|
+
|
53
|
+
def effective_memberships_owners
|
54
|
+
owners = users if respond_to?(:users) && users.any? { |user| user.class.respond_to?(:effective_memberships_owner?) }
|
55
|
+
owners = organizations if respond_to?(:organizations) && organizations.any? { |organization| organization.class.respond_to?(:effective_memberships_owner?) }
|
56
|
+
|
57
|
+
owners || [self]
|
58
|
+
end
|
59
|
+
|
60
|
+
def outstanding_fee_payment_owners
|
61
|
+
effective_memberships_owners.select { |owner| !owner.membership_fees_paid? }
|
62
|
+
end
|
63
|
+
|
64
|
+
def current_fee_payment_owner
|
65
|
+
outstanding_fee_payment_owners.first || self
|
50
66
|
end
|
51
67
|
|
52
68
|
def owner_label
|
@@ -1,6 +1,4 @@
|
|
1
|
-
-
|
2
|
-
- datatable = EffectiveResources.best('EffectiveFeePaymentsDatatable').new(self)
|
3
|
-
- in_progress = current_user.effective_memberships_owner.fee_payments.in_progress
|
1
|
+
- datatable = EffectiveResources.best('EffectiveFeePaymentsDatatable').new(self, namespace: :effective)
|
4
2
|
|
5
3
|
%h2 Fee Payments
|
6
4
|
|
@@ -2,19 +2,33 @@
|
|
2
2
|
|
3
3
|
.card
|
4
4
|
.card-body
|
5
|
-
|
5
|
+
- current_owner = current_user.current_fee_payment_owner
|
6
|
+
|
7
|
+
%p Welcome #{current_owner}!
|
6
8
|
|
7
9
|
= render 'effective/fee_payments/content', resource: resource
|
8
10
|
|
9
|
-
- if
|
11
|
+
- if current_owner.membership_fees_paid?
|
10
12
|
%p You have no fees due at this time.
|
11
13
|
= link_to 'Home', root_path, class: 'btn btn-primary'
|
12
14
|
|
13
|
-
-
|
14
|
-
|
15
|
+
- else
|
16
|
+
- if resource.outstanding_fees.present?
|
17
|
+
%p You have the following fees due at this time:
|
18
|
+
= render_purchasables(resource.outstanding_fees)
|
19
|
+
- else
|
20
|
+
%p You have fees due. Please continue.
|
15
21
|
|
16
|
-
|
22
|
+
- resource.user = current_user
|
23
|
+
- resource.owner = current_owner
|
17
24
|
|
18
25
|
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
19
26
|
= f.hidden_field :id
|
27
|
+
|
28
|
+
= f.hidden_field :owner_type
|
29
|
+
= f.hidden_field :owner_id
|
30
|
+
|
31
|
+
= f.hidden_field :user_type
|
32
|
+
= f.hidden_field :user_id
|
33
|
+
|
20
34
|
= f.save 'Save and Continue'
|
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.1.
|
4
|
+
version: 0.1.6
|
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: 2021-12-
|
11
|
+
date: 2021-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|