juspay/hyperswitch

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

Open

#5,967 opened on Sep 19, 2024

View on GitHub
 (27 comments) (0 reactions) (1 assignee)Rust (4,676 forks)batch import
A-usersC-refactorgood first issuehacktoberfest

Repository metrics

Stars
 (42,690 stars)
PR merge metrics
 (Avg merge 6d 22h) (213 merged PRs in 30d)

Description

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.

Contributor guide