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: Pass country and currency as json format in MCA #656

Merged
merged 1 commit into from
Feb 26, 2023

Conversation

manoj-juspay
Copy link
Contributor

Type of Change

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

Description

Supported country and currency , the size exceed the allowed request size, refactoring how these field are passed in the MCA and in the List PM api

Additional Changes

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

Motivation and Context

How did you test it?

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

@manoj-juspay manoj-juspay added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed A-payment-methods Area: Payment Methods C-refactor Category: Refactor labels Feb 26, 2023
@manoj-juspay manoj-juspay self-assigned this Feb 26, 2023
@manoj-juspay manoj-juspay requested review from a team as code owners February 26, 2023 08:15
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.

Other than the disable all, LGTM.

crates/api_models/src/admin.rs Show resolved Hide resolved
crates/api_models/src/admin.rs Show resolved Hide resolved
Copy link
Member

@lsampras lsampras left a comment

Choose a reason for hiding this comment

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

Minor nit,
Looks good to merge

pub enable_only: Option<Vec<String>>,
/// Type of accepted countries (disable_only, enable_only)
#[serde(rename = "type")]
pub accept_type: String,
Copy link
Member

Choose a reason for hiding this comment

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

this could be an enum

#[serde(rename = "type")]
pub accept_type: String,
/// List of countries of the provided type
pub list: Option<Vec<String>>,
Copy link
Member

Choose a reason for hiding this comment

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

are these 2 letter country codes?
these could probably be enum as well

@@ -472,19 +472,25 @@ fn filter_pm_country_based(
) -> (Option<admin::AcceptedCountries>, Option<Vec<String>>, bool) {
match (accepted_countries, req_country_list) {
(None, None) => (None, None, true),
(None, Some(ref r)) => (None, Some(r.to_vec()), false),
(None, Some(ref r)) => (
Copy link
Member

Choose a reason for hiding this comment

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

do we need ref seems you should be able to consume the value instead of ref + to_owned

@jarnura jarnura added this pull request to the merge queue Feb 26, 2023
@jarnura jarnura removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Feb 26, 2023
Merged via the queue into main with commit 301736f Feb 26, 2023
@jarnura jarnura deleted the mca_accepted_country_currency_json_change branch February 26, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-payment-methods Area: Payment Methods C-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants