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

Refactor the User Class #136

Open
k-allagbe opened this issue Aug 31, 2024 · 5 comments · May be fixed by #227
Open

Refactor the User Class #136

k-allagbe opened this issue Aug 31, 2024 · 5 comments · May be fixed by #227
Assignees

Comments

@k-allagbe
Copy link
Member

k-allagbe commented Aug 31, 2024

Description

The User class, currently located in the datastore module, needs to be refactored. Specifically, the method get_user_container_client is not being called with the correct parameters.

Tasks

  • Correct the parameters passed to the get_user_container_client method in the get_container_client function.
  • Write tests for it's methods.
  • Ensure all tests, including the newly added ones, pass successfully.
@k-allagbe k-allagbe changed the title Move User Class to Pydantic Models Directory Refactor the User Class Aug 31, 2024
@k-allagbe k-allagbe moved this to Todo in FertiScan Sep 5, 2024
@Francois-Werbrouck
Copy link
Contributor

What are the gains of making the User class into a pydantic model? (I'm not super familiar with pydantic)

@k-allagbe
Copy link
Member Author

What are the gains of making the User class into a pydantic model? (I'm not super familiar with pydantic)

Doesn't have to be a pydantic model. I think its data is not even coming from db json so never mind that.

@Francois-Werbrouck
Copy link
Contributor

Some of the data is coming from the DB.

However, we use a user class to make it easier for the BE to perform certain task based on the User's object/data.

We primarily use it to fetch the container_client of a specific user. This way, the BE doesn't need to know what is the implementation of this specific container. However, it is not always the user's container which is the destination of the upload (see this comment for more explanation)

The class could be expanded in the future to enable for more actions (ex: #172)

@k-allagbe
Copy link
Member Author

k-allagbe commented Oct 10, 2024

Understood. Fixing the functions is enough in this case, strictly in the context of the present issue. Issue updated.

@Francois-Werbrouck Francois-Werbrouck moved this from Todo to Paused in FertiScan Nov 27, 2024
@Francois-Werbrouck
Copy link
Contributor

Based on recent Discussion, this was mostly through the #224 Epic. I suggest to review the needs of this issue once the Epic finished

@Francois-Werbrouck Francois-Werbrouck linked a pull request Jan 13, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Paused
2 participants