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] Consolidate UserStatus Enum into common_enums File #5967

Open
1 task done
ThisIsMani opened this issue Sep 19, 2024 · 14 comments · May be fixed by #6444
Open
1 task done

[REFACTOR] Consolidate UserStatus Enum into common_enums File #5967

ThisIsMani opened this issue Sep 19, 2024 · 14 comments · May be fixed by #6444
Assignees
Labels
A-users Area: Users C-refactor Category: Refactor good first issue Good for newcomers hacktoberfest Issues that are up for grabs for Hacktoberfest participants

Comments

@ThisIsMani
Copy link
Contributor

ThisIsMani commented Sep 19, 2024

Feature Description

We currently have duplicate UserStatus enum types defined in multiple locations:

  1. crates/api_models/src/user_role.rs
  2. crates/diesel_models/src/enums.rs

To avoid redundancy and ensure consistency, these types should be centralized in the common enums file: crates/common_enums/src/enums.rs. This will make it easier to manage and maintain the UserStatus enum across the codebase.

Possible Implementation

Task

  • Move the UserStatus enum from both crates/api_models/src/user_role.rs and crates/diesel_models/src/enums.rs to crates/common_enums/src/enums.rs.
  • Update all references to UserStatus in the codebase to point to the new location in the common enums file.

Steps to Complete

  1. Open the crates/api_models/src/user_role.rs file and locate the UserStatus enum.
  2. Open the crates/diesel_models/src/enums.rs file and locate the other UserStatus enum.
  3. Move the definition of UserStatus from diesel_models file into crates/common_enums/src/enums.rs.
  4. Update all imports or references to UserStatus in both api_models and diesel_models to use the centralized definition from common_enums.
  5. Ensure all code compiles correctly after the changes.

Have you spent some time checking if this feature request has been raised before?

  • I checked and didn't find a similar issue

Submission Process:

  • Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself.
  • Once assigned, submit a pull request (PR).
  • Maintainers will review and provide feedback, if any.
  • Maintainers can unassign issues due to inactivity, read more here.

Refer here for Terms and conditions for the contest.

@ThisIsMani ThisIsMani added C-feature Category: Feature request or enhancement C-refactor Category: Refactor good first issue Good for newcomers hacktoberfest Issues that are up for grabs for Hacktoberfest participants A-users Area: Users and removed C-feature Category: Feature request or enhancement labels Sep 19, 2024
@KekmaTime
Copy link

@ThisIsMani i can help with this issue

@ThisIsMani
Copy link
Contributor Author

Hey @KekmaTime,
Thanks for showing interest in contributing to Hyperswitch! This issue is open for contributions, and you can work on it. It's also part of Hacktoberfest 2024, If you work on resolving it during Hacktoberfest, you'll be eligible to claim a goodie as a reward.
Let us know if you need any help getting started!

@MridulY
Copy link

MridulY commented Sep 26, 2024

@ThisIsMani I want to work on this
Can you assign it to me

@ThisIsMani
Copy link
Contributor Author

Hey @KekmaTime, will you pick this up? If not I will assign this to @MridulY.

@KekmaTime
Copy link

Hey 👋 yes im working on this . I've been a bit busy so yes ill merge this today itself

@ThisIsMani
Copy link
Contributor Author

ThisIsMani commented Sep 26, 2024

@KekmaTime, did you raise a PR for this? If yes, can you link this issue to that PR.

@aniketh-varma
Copy link

Hi @ThisIsMani @gorakhnathy7, can I pick this issue as a part of my Hacktoberfest contributions?

@gorakhnathy7
Copy link
Collaborator

Hey @KekmaTime Are you still working on this?

Kindly inform if you won't be able to pick this up, so we can assign it to someone else.

@aniketh-varma meanwhile, you can checkout other issues in the repo.

@ThisIsMani
Copy link
Contributor Author

@KekmaTime, are you still working on this? I don't see any activity related to this issue.

@gorakhnathy7
Copy link
Collaborator

Hey @aniketh-varma Let me know, if you are interested in this?
As we haven't heard from @KekmaTime, We can assign this to you!
thanks!

@aniketh-varma
Copy link

Hi @gorakhnathy7, sure, I can pick this

@gorakhnathy7
Copy link
Collaborator

gorakhnathy7 commented Oct 24, 2024

Hey @aniketh-varma,

Kindly let us know, if you're still working on the issue? If you have any questions or need assistance, feel free to reach out in the community.

@aniketh-varma
Copy link

Hey @gorakhnathy7, yep, I am working on this issue. Apologies for the delay, I am new to Rust, so I was a bit sceptical about the coding practices. I will be raising the PR for this soon. Thanks!

@aniketh-varma
Copy link

Hey @gorakhnathy7, I have raised the PR for this issue. Please have a look at the same whenever you get time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-users Area: Users C-refactor Category: Refactor good first issue Good for newcomers hacktoberfest Issues that are up for grabs for Hacktoberfest participants
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants