Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix current membership is inactive future membership #3777

Merged
merged 7 commits into from
Aug 17, 2024

Conversation

DeD1rk
Copy link
Member

@DeD1rk DeD1rk commented Aug 16, 2024

Closes #3776.

Summary

Before this, two things were done in an ugly/inaccurate way:

  1. Member.current_membership returned the latest membership, even if it hadn't begun yet.
  2. Memberships created in august started on the 1st of september (so technically, sjaars were no members during intro).

But before 0f6488a, we did not check for the membership.since date when checking if a membership is active. This meant that the above 2 things together gave the expected behaviour. So adding that check broke the expected but hacky behaviour.

In this PR, I got rid of both weird things. Memberships normally start at the date they're completed (typically i.e. paid). For memberships completed in august, that means that the last few days/weeks of august are given 'for free' as they were before, but just also stored that way. And the current_membership property and friends now do what one would expect: return only current memberships.

How to test

  1. At least simulate introduction registrations as they will happen in a few days.

…leted

This means that sometimes, memberships are slightly longer than a year,
now officially making sjaars members from intro up to sept 1, instead of
abusing the lack of checks on membership.since when checking for an active
membership.
@DeD1rk DeD1rk added app:members Issues regarding the members-app app:registrations Issues regarding registrations bug Something that should be fixed labels Aug 16, 2024
@T8902
Copy link
Contributor

T8902 commented Aug 16, 2024

image

when trying to pay for a registration using cash

@T8902
Copy link
Contributor

T8902 commented Aug 16, 2024

image

when trying to pay for a registration using cash

correction, any payment

@DeD1rk
Copy link
Member Author

DeD1rk commented Aug 16, 2024

when trying to pay for a registration using cash

correction, any payment

Looks like you're running on a database from your study-long branch

@T8902
Copy link
Contributor

T8902 commented Aug 16, 2024

when trying to pay for a registration using cash

correction, any payment

Looks like you're running on a database from your study-long branch

Yes I am just stupid

@DeD1rk DeD1rk merged commit e26a9cb into master Aug 17, 2024
10 checks passed
@DeD1rk DeD1rk deleted the fix-current-membership-is-inactive-future-membership branch August 17, 2024 07:00
DeD1rk added a commit that referenced this pull request Aug 17, 2024
* Refactor uses of current_membership that only need has_active_membership

* Make current_membership actually return the current and not latest membership

* Fix members app test discovery

* Add tests for current- and latest_membership properties

* Make memberships start on the day the registration or renewal is completed

This means that sometimes, memberships are slightly longer than a year,
now officially making sjaars members from intro up to sept 1, instead of
abusing the lack of checks on membership.since when checking for an active
membership.

* Fix tests

* Add coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:members Issues regarding the members-app app:registrations Issues regarding registrations bug Something that should be fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Renew membership" notification even after renewing/extending membership and still being member
2 participants