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: use CountryAlpha2 instead of CountryCode for country codes #904

Merged
merged 17 commits into from
May 3, 2023

Conversation

pixincreate
Copy link
Member

@pixincreate pixincreate commented Apr 18, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates

Description

Refactor countryCode for CountryAlpha2 and remove the existing enum CountryAlpha2 to reduce redundant code.

It is recommended to clean up the local database once merged by running cargo clean to avoid errors.

Additional Changes

  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Removes the redundant code to tidy the enums.rs

How did you test it?

crates/common_enums/src/transformers.rs
image

image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@pixincreate pixincreate requested review from a team, jarnura and ashokkjag as code owners April 18, 2023 06:29
@pixincreate pixincreate self-assigned this Apr 18, 2023
@pixincreate pixincreate added the C-refactor Category: Refactor label Apr 18, 2023
@pixincreate pixincreate marked this pull request as draft April 18, 2023 06:49
@pixincreate pixincreate marked this pull request as ready for review April 18, 2023 07:00
@pixincreate pixincreate changed the title Refactor country code refactor(CountryCode):Refactor country code to use CountryAlpha2 Apr 19, 2023
@pixincreate pixincreate marked this pull request as draft April 19, 2023 18:14
@pixincreate pixincreate marked this pull request as ready for review April 20, 2023 05:10
@pixincreate pixincreate added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Apr 20, 2023
Copy link
Member

@jarnura jarnura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add labels and all required reviewers

@jarnura jarnura added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 20, 2023
@pixincreate pixincreate added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Apr 20, 2023
Copy link
Member

@Narayanbhat166 Narayanbhat166 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In api_models wherever CountryAlpha2 is used, add

#[schema(value_type = ..example = "US")]

The value type can be either Option or Vec based on the usage.

crates/api_models/src/payment_methods.rs Outdated Show resolved Hide resolved
crates/api_models/src/payments.rs Outdated Show resolved Hide resolved
crates/api_models/src/payments.rs Outdated Show resolved Hide resolved
crates/api_models/src/payments.rs Outdated Show resolved Hide resolved
ArjunKarthik
ArjunKarthik previously approved these changes Apr 25, 2023
jarnura
jarnura previously approved these changes May 2, 2023
@jarnura jarnura added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels May 2, 2023
@jarnura jarnura added this pull request to the merge queue May 2, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 3, 2023
@SanchithHegde SanchithHegde added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L2 Review: Waiting on L2 reviewer R-L1-completed Review: L1 Review completed labels May 3, 2023
@jarnura jarnura removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L2 Review: Waiting on L2 reviewer labels May 3, 2023
@jarnura jarnura added this pull request to the merge queue May 3, 2023
Merged via the queue into main with commit 2cff019 May 3, 2023
@SanchithHegde SanchithHegde deleted the refactor_countryCode branch May 3, 2023 08:53
@SanchithHegde SanchithHegde removed S-ready-for-merge R-L1-completed Review: L1 Review completed labels May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants