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

feat: extract payments on club endpoint; feat: download attendance report; feat: update user's response to an event #107

Merged
merged 3 commits into from
May 31, 2024

Conversation

maiminhp
Copy link
Contributor

@maiminhp maiminhp commented Apr 20, 2024

This feature is needed for our club. However, this is a new major addition to the module as a whole (new API endpoint club).

Related to #70 as far as I can tell.

Therefore, this is just a draft to see how @Olen and @elliot-100 feel about this new feature and start a conversation around it!

I can add some example script/usage if interested

@Olen
Copy link
Owner

Olen commented Apr 20, 2024

In principle, I am all for extending the functionalty.
I have not tested the "club" functions, but if it is possible to unite the functions from the two endpoints without to many conflicting names I would prefer to keep it as one common class.
If not, using something like SpondClub or something is probably a good solution.

@elliot-100
Copy link
Collaborator

Very interesting! I keep meaning to look at Club functions for my own club.

For now - does this imply that other API endpoints (and the rest of the library) still work for you, but the club API endpoint provides additional functions?

I think that is what I was wondering in #70 ...

@maiminhp
Copy link
Contributor Author

For now - does this imply that other API endpoints (and the rest of the library) still work for you, but the club API endpoint provides additional functions?

Correct. The current library still works perfectly (i guess same functionality as provided in the front end spond.com/client). This new club endpoint is for the Spond Club functionality

@maiminhp
Copy link
Contributor Author

maiminhp commented Apr 20, 2024

I have not tested the "club" functions, but if it is possible to unite the functions from the two endpoints without to many conflicting names I would prefer to keep it as one common class.
If not, using something like SpondClub or something is probably a good solution.

Yeah of course i would prefer that too... but I think since the two front ends are different (spond.com/client vs. club.spond.com) i thought maybe having two classes might be a clearer separation of concern since the functionality covered in the two are also different but of course I'm open to suggestions! I'll continue to have a think on it... The different name is also not a bad idea either if we are ok with two separate classes.

@elliot-100
Copy link
Collaborator

I think since the two front ends are different (spond.com/client vs. club.spond.com) i thought maybe having two classes might be a clearer separation of concern

Agree, I think best to have them separate to start with, especially as it's not necessarily clear how they might functionally overlap or behave similarly-but-different (e.g. differing data structures). Seems safer to develop separately; common elements can always be refactored out to e.g. a base class.

@maiminhp
Copy link
Contributor Author

I took a stab... Having both of them in the same class is difficult since we'll need two separate tokens to authenticate! Therefore, I opted for 2 separate classes and refactor out a base class.

manual test script is going through! My downstream scripts seem to also work!

@maiminhp maiminhp force-pushed the feat/club branch 3 times, most recently from 672571a to 91209e3 Compare May 15, 2024 13:53
@maiminhp maiminhp marked this pull request as ready for review May 15, 2024 13:59
@maiminhp
Copy link
Contributor Author

This PR ended up containing more features than originally intended. :)

@elliot-100
Copy link
Collaborator

elliot-100 commented May 21, 2024

[Edited] Hi @ptmminh - many thanks for this. Could I ask you to run isort . after each commit and refresh with a force-push? This should reduce unnecessary diffs on merge later. It doesn't look like black . is needed. I will look into why isort GitHub action didn't seem to flag anything.

Edit 2: annoyingly GitHub actions don't appear to be completing right now, so I'll come back to that

@Olen
Copy link
Owner

Olen commented May 21, 2024

Thanks for the effort. When the actions work again, I'll try to look at it. The first impression is that it looks good, and I like the way it was implemented. But I don't have any clubs to work with, so I can't verify that it is working...

If anyone can chime in and confirm that it works, and the tests complete successfully, it is fine with me.

@maiminhp
Copy link
Contributor Author

@elliot-100 thanks for flagging the isort check. All done!

@maiminhp
Copy link
Contributor Author

maiminhp commented May 21, 2024

Just took a quick look at #114 too, do I also need to update README.md with additional features implemented in this PR (i.e. get_export, get_transactions and change_response)?

@Olen
Copy link
Owner

Olen commented May 22, 2024

Yes, please update the README.
Also, since the PR contains quite some refactoring of thr base class, I think we should look into merging a few of the other pending PRs first, so we only need to make any changes required for the refactoring once.

@maiminhp
Copy link
Contributor Author

Yes, please update the README.

Sure, done! ✔️

Also, since the PR contains quite some refactoring of thr base class, I think we should look into merging a few of the other pending PRs first, so we only need to make any changes required for the refactoring once.

Ok, feel free to merge other PRs first and then ping me and I'll rebase/refactor and we can merge it then.

@elliot-100
Copy link
Collaborator

Ok, feel free to merge other PRs first and then ping me and I'll rebase/refactor and we can merge it then.

Other PRs merged now @ptmminh . I think I would have a couple of review comments but have run out of time today.

@maiminhp
Copy link
Contributor Author

Done rebasing on top of current main

spond/club.py Outdated Show resolved Hide resolved
@elliot-100
Copy link
Collaborator

I don't have a Spond Club yet, but manual_test_functions works fine once I updated config.py with a dummy club_id - the attendance xlsx feature looks useful, didn't actually know that existed.

spond/club.py Outdated Show resolved Hide resolved
spond/club.py Outdated Show resolved Hide resolved
spond/club.py Outdated Show resolved Hide resolved
spond/base.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
manual_test_functions.py Outdated Show resolved Hide resolved
spond/spond.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@elliot-100 elliot-100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for edits, all resolved and OK to merge as far as I am concerned.

This feature is needed for our club. However, this is a new
major addition to the module as a whole (new API endpoint club).

a couple of major changes:

- base class to avoid redundant code
- manual tests added
- example usage script added

Related to Olen#70.
@maiminhp
Copy link
Contributor Author

maiminhp commented May 27, 2024

yep, all set, whoever has write access please rebase or merge onto main! 🚀

Thanks for the review @elliot-100 ! 💯

@elliot-100
Copy link
Collaborator

@Olen any comments/changes? I can merge if you'd like.

@Olen
Copy link
Owner

Olen commented May 30, 2024

Looks good to me

@elliot-100 elliot-100 changed the title feat: extract payments on club endpoint feat: extract payments on club endpoint; feat: download attendance report; feat: update user's response to an event May 31, 2024
@elliot-100 elliot-100 merged commit eb9a9bd into Olen:main May 31, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants