juspay/hyperswitch

[REFACTOR] Move Hardcoded Value to Constant for Max Invitations

Open

#5938 aperta il 18 set 2024

Vedi su GitHub
 (4 commenti) (0 reazioni) (1 assegnatario)Rust (4676 fork)batch import
A-usersC-refactorgood first issuehacktoberfest

Metriche repository

Star
 (42.690 star)
Metriche merge PR
 (Merge medio 6g 22h) (213 PR mergiate in 30 g)

Descrizione

Feature Description

Here: https://github.com/juspay/hyperswitch/blob/407be56ed368d543b440bfffa6704518e487dced/crates/router/src/core/user.rs#L643

In the current implementation, the value 10 is hardcoded when checking the number of invite requests in the code. To improve maintainability and avoid magic numbers, this value should be moved to a constant in crates/router/src/consts/user.rs.

Possible Implementation

  • Create a new constant in crates/router/src/consts/user.rs to represent the maximum number of allowed invite requests.
  • Refactor the code to replace the hardcoded value 10 with this new constant.

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.

Guida contributor