Skip to content
This repository was archived by the owner on Jul 16, 2020. It is now read-only.

Users: record membership start and end #11

Open
jvanloov opened this issue Jun 15, 2015 · 2 comments
Open

Users: record membership start and end #11

jvanloov opened this issue Jun 15, 2015 · 2 comments

Comments

@jvanloov
Copy link
Contributor

Find start/end dates based on payment of membership fees. Possible implementation:

  • Keep a "Membership period" table that has user_id, start and end date, and a "closed" field
  • When the first membership payment is received, create a record with startdate as the current month. The end date is set to startdate + (amount/monthly_fee) months
  • When a new payment is received, bump the enddate with (amount/monthly_fee) months
  • Every month (?), run a job to check the current month with the end dates of all users. If the current month is past the end date for a user, set the "closed" field, indicating that the user is not a member any more. New payments will create a new record in this table, for that user.
@biertie
Copy link
Contributor

biertie commented Jun 15, 2015

that is something that is implemented in the reporting part of the database.
The procedure is based on a type 2 slowly changing table.

@jvanloov
Copy link
Contributor Author

What do we need in the transaction DB to support this? is the "member" boolean field enough? Should we update this field every beginning of the month against membership payments? More often?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants