Allow renewing and adding new users by number of terms #75

Closed
opened 2022-09-23 19:41:06 -04:00 by snedadah · 6 comments
Member

In the CEO API, currently you have to specify exactly what terms to add in /<username>/renew and /members/.

It would be better, if there was an extra option (similar to the GUI), where in addition to "terms" and "non_member_terms", there also is "number_of_terms" and possibly "number_of_non_member" terms. These options would be integers and would renew/create member for that many number of terms.

It should be straightforward, since get_terms_for_new_user, get_terms_for_renewal already exist in https://git.csclub.uwaterloo.ca/public/pyceo/src/branch/master/ceo/term_utils.py#L11, and the API would have to modified here to use them https://git.csclub.uwaterloo.ca/public/pyceo/src/branch/master/ceod/api/members.py

In the CEO API, currently you have to specify exactly what terms to add in `/<username>/renew` and `/members/`. It would be better, if there was an extra option (similar to the GUI), where in addition to "terms" and "non_member_terms", there also is "number_of_terms" and possibly "number_of_non_member" terms. These options would be integers and would renew/create member for that many number of terms. It should be straightforward, since get_terms_for_new_user, get_terms_for_renewal already exist in https://git.csclub.uwaterloo.ca/public/pyceo/src/branch/master/ceo/term_utils.py#L11, and the API would have to modified here to use them https://git.csclub.uwaterloo.ca/public/pyceo/src/branch/master/ceod/api/members.py
r345liu was assigned by r389li 2022-10-01 02:37:44 -04:00
Owner

Say if a user has terms

f2020
w2021

and current term is f2022

should adding 1 term add w2023 or s2021?

Say if a user has terms ``` f2020 w2021 ``` and current term is `f2022` should adding 1 term add `w2023` or `s2021`?
r345liu added reference number-renewal 2022-10-06 10:18:49 -04:00
Owner

behaviuor of get_terms_for_renewal would be w2023 so I'll make it do that.

side note: get_terms_for_renewal function is written for client so is not suitable for server side use

behaviuor of `get_terms_for_renewal` would be `w2023` so I'll make it do that. side note: `get_terms_for_renewal` function is written for client so is not suitable for server side use
Owner

behaviuor of get_terms_for_renewal would be w2023 so I'll make it do that.

No, it would be f2022. See https://git.csclub.uwaterloo.ca/public/pyceo/src/branch/master/ceo/term_utils.py#L35.

> behaviuor of `get_terms_for_renewal` would be `w2023` so I'll make it do that. No, it would be `f2022`. See https://git.csclub.uwaterloo.ca/public/pyceo/src/branch/master/ceo/term_utils.py#L35.
Owner

@r345liu thanks for taking this.

@snedadah can you confirm this removes one of the blockers on the membership webpage?

@r345liu thanks for taking this. @snedadah can you confirm this removes one of the blockers on the membership webpage?
Author
Member

@r389li, Yep, once this is deployed, it will remove that blocker for the membership webpage.

@r389li, Yep, once this is deployed, it will remove that blocker for the membership webpage.
Owner

Great! @r345liu can you package and deploy it?

Great! @r345liu can you package and deploy it?
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: public/pyceo#75
No description provided.