juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.46k stars 1.34k forks source link

[REFACTOR] Consolidate `UserStatus` Enum into `common_enums` File #5967

Open ThisIsMani opened 1 month ago

ThisIsMani commented 1 month ago

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

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?

Submission Process:

Refer here for Terms and conditions for the contest.

KekmaTime commented 1 month ago

@ThisIsMani i can help with this issue

ThisIsMani commented 1 month ago

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 commented 1 month ago

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

ThisIsMani commented 1 month ago

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

KekmaTime commented 1 month ago

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

ThisIsMani commented 1 month ago

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

aniketh-varma commented 1 month ago

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

gorakhnathy7 commented 1 month ago

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 commented 1 month ago

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

gorakhnathy7 commented 1 month ago

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 commented 1 month ago

Hi @gorakhnathy7, sure, I can pick this

gorakhnathy7 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 1 week ago

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