juspay/hyperswitch
View on GitHub[REFACTOR] Consolidate `UserStatus` Enum into `common_enums` File
Open
#5,967 opened on Sep 19, 2024
A-usersC-refactorgood first issuehacktoberfest
Description
Feature Description
We currently have duplicate UserStatus enum types defined in multiple locations:
crates/api_models/src/user_role.rscrates/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
UserStatusenum from bothcrates/api_models/src/user_role.rsandcrates/diesel_models/src/enums.rstocrates/common_enums/src/enums.rs. - Update all references to
UserStatusin the codebase to point to the new location in the common enums file.
Steps to Complete
- Open the
crates/api_models/src/user_role.rsfile and locate theUserStatusenum. - Open the
crates/diesel_models/src/enums.rsfile and locate the otherUserStatusenum. - Move the definition of
UserStatusfromdiesel_modelsfile intocrates/common_enums/src/enums.rs. - Update all imports or references to
UserStatusin bothapi_modelsanddiesel_modelsto use the centralized definition fromcommon_enums. - 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.