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

Closed
opened 2 months ago by snedadah · 6 comments
Collaborator

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 2 months ago
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 2 months ago
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.
merenber closed this issue 2 months ago
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?
Poster
Collaborator

@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 Label
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: public/pyceo#75
Loading…
There is no content yet.