-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
#129: Promote User to Artist #331
#129: Promote User to Artist #331
Conversation
Hi @berkaykrc thanks for your work. Can we check the OpenAPI pipeline? It ensures OpenAPI.json is updated in the repo with the latest code. More on how to generate the updated OpenAPI schema here Let me know if you need anything :) |
Hi @AntonioMrtz. |
If you feel confident you can also generate frontend OpenAPI schema. The backend OpenAPI schema is only needed at the time to generate frontend boilerplate for requests. I would suggest doing it at the end of the PR when endpoints parameters/names are not going to change more. |
Roger that. I fixed things as you suggested, and marked as resolved comment. Generated both I'm still waiting things to discuss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but there's a few adjustments to do :)
…al, typos, linting | [AntonioMrtz#129]
…t configuration | [AntonioMrtz#129]
…ttp return code and some formating | [AntonioMrtz#129]
34ccfe1
to
ac73d66
Compare
Hi @berkaykrc I would try to review it ASAP :) |
Thank you, take your time! I just did rebase from main branch instead of merge (wanted to try it), so last two commit is what your last requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Just a few adjustments need to be done. After that I will merge it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The things pointed out in the comments
Okay I will check them out now. |
Hi @berkaykrc I did some changes to the way JWTBearer dependency is injected into the endpoints. Do you need help integrating that with your PR? |
Oh, yeah I checked it, on my promote_user_to_artist endpoint just type annotated like you did on your last commit and how it's on file on general. Do I need to make anything other than that? I just started looking into your requests. I run ruff and tests, looking fine for now. |
I suppose that only replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm :). Great job 🎉
Thanks much 🥳 |
Description
This pull request includes multiple changes across various files in the backend of the project. The most important changes introduce the ability to promote a user to an artist, enhance password handling, and add new fields to user and artist schemas.
User Promotion and Authorization:
promote_user_to_artist
inBackend/app/spotify_electron/user/base_user_controller.py
to promote a user to an artist.promote_user_to_artist
function inBackend/app/spotify_electron/user/user/user_service.py
to handle the promotion logic and validation.BaseUserRepositoryError
inBackend/app/spotify_electron/user/base_user_controller.py
to handle repository-related errors.Password Handling:
hash_password
andcreate_artist
functions inBackend/app/auth/auth_service.py
andBackend/app/spotify_electron/user/artist/artist_service.py
respectively, to accept bothstr
andbytes
types for passwords. [1] [2]hash_password
function to handle both string and byte inputs correctly.User and Artist Schema Changes:
_id
andid
toUserDAO
andUserDTO
classes inBackend/app/spotify_electron/user/user/user_schema.py
andArtistDAO
andArtistDTO
classes inBackend/app/spotify_electron/user/artist/artist_schema.py
. [1] [2]get_user_dao_from_document
andget_user_dto_from_dao
to include the new_id
andid
fields. [1] [2]Testing Enhancements:
test_promote_user_to_artist
inBackend/tests/test__base_users.py
to verify the promotion of a user to an artist.promote_user_to_artist
inBackend/tests/test_API/api_base_users.py
for testing the promotion endpoint.Minor Fixes and Improvements:
verify_password
inBackend/app/auth/auth_service.py
.Backend/tests/conftest.py
to log environment variables during test setup.Commit type
feat
: indicates the addition of a new feature or functionality to the project.Issue
#129
Solution
Ability to promote User to Artist with existing data.
Proposed Changes
Potential Impact
Additional Changes needed
Assigned
@AntonioMrtz