effective_memberships 0.10.0 → 0.10.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09cdd3d71c709fdaacb54d4abd0d21217bd6e7e3a7395e687004eb124994b75b'
|
4
|
+
data.tar.gz: caebcbe36b5c113d715e47ef8df0d224f7ea825ae0fa3ea3f5efc59448bcc30f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50897b485cca843711185839c1e630b90211ac1559c7a956fd5d425d70a37ad7ef94b6a3863cd1055ac8efa226ef635a4b6186f32763e260c277cb198b4c7f3c
|
7
|
+
data.tar.gz: 0a53cc0947501e0f89c07d56e052b81f5b6a7f2c676698e5e45227f0c9ae460b8c674d90fd0bc521601eb5adef49ab07d1433ce6ccd5f80fcefb670b6c9845d6
|
@@ -267,8 +267,25 @@ module EffectiveMembershipsOwner
|
|
267
267
|
# Build the renewal fee
|
268
268
|
fee ||= fees.build()
|
269
269
|
|
270
|
-
|
271
|
-
|
270
|
+
# Late on this period's late date, or 60 days, whichever is later
|
271
|
+
late_on ||= if category.create_late_fees?
|
272
|
+
late_date = EffectiveMemberships.Registrar.late_fee_date(period: period)
|
273
|
+
|
274
|
+
duration = EffectiveMemberships.Registrar.min_late_duration
|
275
|
+
min_date = ((fee.created_at || Time.zone.now) + duration) if duration.present?
|
276
|
+
|
277
|
+
[late_date, min_date].compact.max
|
278
|
+
end
|
279
|
+
|
280
|
+
# NIGS on this period's late date, or 60 days, whichever is later
|
281
|
+
not_in_good_standing_on ||= if category.create_not_in_good_standing?
|
282
|
+
nigs_date = EffectiveMemberships.Registrar.not_in_good_standing_date(period: period)
|
283
|
+
|
284
|
+
duration = EffectiveMemberships.Registrar.min_not_in_good_standing_duration
|
285
|
+
min_date = ((fee.created_at || Time.zone.now) + duration) if duration.present?
|
286
|
+
|
287
|
+
[nigs_date, min_date].compact.max
|
288
|
+
end
|
272
289
|
|
273
290
|
fee.assign_attributes(
|
274
291
|
fee_type: 'Renewal',
|
@@ -33,6 +33,18 @@ module EffectiveMembershipsRegistrar
|
|
33
33
|
raise('to be implemented by app registrar')
|
34
34
|
end
|
35
35
|
|
36
|
+
# A renewal fee must be at least this old to be considered late?
|
37
|
+
# Must be less than (late_fee_date - renewal_fee_date) but this is not enforced
|
38
|
+
def min_late_duration
|
39
|
+
60.days
|
40
|
+
end
|
41
|
+
|
42
|
+
# A renewal fee must be at least this old to be considered nigs?
|
43
|
+
# Must be less than (nigs_date - renewal_fee_date) but this is not enforced
|
44
|
+
def min_not_in_good_standing_duration
|
45
|
+
60.days
|
46
|
+
end
|
47
|
+
|
36
48
|
# scope
|
37
49
|
def not_in_good_standing_status
|
38
50
|
EffectiveMemberships.Status.where(title: 'Not In Good Standing')
|
data/app/models/effective/fee.rb
CHANGED
@@ -87,14 +87,26 @@ module Effective
|
|
87
87
|
return false if late_on.blank?
|
88
88
|
return false if purchased?
|
89
89
|
|
90
|
-
|
90
|
+
now = Time.zone.now
|
91
|
+
|
92
|
+
if(duration = EffectiveMemberships.Registrar.min_late_duration).present?
|
93
|
+
return false if ((created_at || now) + duration > now)
|
94
|
+
end
|
95
|
+
|
96
|
+
late_on <= now.to_date
|
91
97
|
end
|
92
98
|
|
93
99
|
def not_in_good_standing?
|
94
100
|
return false if not_in_good_standing_on.blank?
|
95
101
|
return false if purchased?
|
96
102
|
|
97
|
-
|
103
|
+
now = Time.zone.now
|
104
|
+
|
105
|
+
if(duration = EffectiveMemberships.Registrar.min_not_in_good_standing_duration).present?
|
106
|
+
return false if ((created_at || now) + duration > now)
|
107
|
+
end
|
108
|
+
|
109
|
+
not_in_good_standing_on <= now.to_date
|
98
110
|
end
|
99
111
|
|
100
112
|
# Used by applicant.applicant_submit_fees
|
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.10.
|
4
|
+
version: 0.10.1
|
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-
|
11
|
+
date: 2023-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|