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

chore: refactor user model #3564

Merged
merged 8 commits into from
Feb 11, 2020
Merged

chore: refactor user model #3564

merged 8 commits into from
Feb 11, 2020

Conversation

djaiss
Copy link
Member

@djaiss djaiss commented Feb 7, 2020

The User model was huge, and contained a lot of logic that shouldn't belong to the model itself.

I've removed almost all of the methods that didn't belong there and created new services or new helpers for them.

The main goals are:

  • models should have the least amount of logic possible. They should mainly be used to have setters/getters. If there is a logic, it should be placed in a service instead.
  • a service should be used when the object is changed (create/edit/delete)
  • models should be as small as possible.
  • helpers should be used whenever there is a logic that we should know about but that doesn't change the object itself.

@djaiss djaiss requested a review from asbiin February 7, 2020 14:22
@djaiss djaiss changed the title chore: refactor User class chore: refactor user model Feb 8, 2020
asbiin
asbiin previously requested changes Feb 11, 2020
Copy link
Member

@asbiin asbiin left a comment

Choose a reason for hiding this comment

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

Just 2 questions, and it's ok !!

@djaiss djaiss dismissed asbiin’s stale review February 11, 2020 20:51

Can't do the changes.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 3 Code Smells

87.0% 87.0% Coverage
0.0% 0.0% Duplication

@djaiss djaiss merged commit 355f3b8 into master Feb 11, 2020
@djaiss djaiss deleted the 2020-02-06-export-csv branch February 11, 2020 21:01
@github-actions
Copy link

This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants