Closed herra closed 5 years ago
Merging #39 into master will increase coverage by
1.04%
. The diff coverage is96.36%
.
@@ Coverage Diff @@
## master #39 +/- ##
==========================================
+ Coverage 87.95% 88.99% +1.04%
==========================================
Files 77 83 +6
Lines 1328 1499 +171
Branches 180 201 +21
==========================================
+ Hits 1168 1334 +166
- Misses 138 142 +4
- Partials 22 23 +1
Impacted Files | Coverage Δ | |
---|---|---|
test/matchers/index.js | 100% <ø> (ø) |
:arrow_up: |
models/member.js | 88.46% <ø> (-1.29%) |
:arrow_down: |
test/ah-setup.js | 66.66% <100%> (ø) |
:arrow_up: |
tasks/ExpirationReminder.js | 100% <100%> (ø) |
|
classes/MembershipExpirationProcessor.js | 100% <100%> (ø) |
|
initializers/expirationReminder.js | 100% <100%> (ø) |
|
config/expirationReminder.js | 100% <100%> (ø) |
|
...s/20181022223444-add-notified-for-expiring-date.js | 66.66% <66.66%> (ø) |
|
test/matchers/toBeSameDay.js | 83.33% <83.33%> (ø) |
|
... and 10 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 5a2205e...99adb53. Read the comment docs.
@herra I did rebase from master instead of merging it, so you need to rebase your local branch
@herra i refactor the task so it just starts the operation and the logic is within MembershipExpirationProcessor
. I think this is enough for now, but for #40 there should be some more refactoring. I think if the processMemberships
is split into two methods - one to gather all members with expiring membership within certain period, and another that filters members who are paying (essentially the first and second part of the method), would make it more reusable.
Another refactor for #40 should be to merge MembershipExpirationProcessor
and Membersip
classes as essentially both are handling logic with membership.
Define a task that is scheduled once a day and send email to members with expiring membership within the next month.
Emails are sent only to members that have paid personally their last membership - i.e. family members and group payment members will not receive emails.
A user will receive only once email for a particular expiration date.
Environment configuration:
CHECK_FOR_EXPIRING_MEMBERSHIPS_PERIOD
- interval in days between task run. 0 or undefined to disable automatic run.CHECK_FOR_EXPIRING_MEMBERSHIPS_DAYS_BEFORE
- number of days until membership expiration to consider for sending email. Defaults to 30.CHECK_FOR_EXPIRING_MEMBERSHIPS_MIN_DAYS_BEFORE
- if membership expires in less than this number of days an email will not be sent. Defaults to 5.Email template is aboutToExpire