refactor: use CountryAlpha2 instead of CountryCode for country codes (#904)

This commit is contained in:
Pa1NarK
2023-05-03 13:46:41 +05:30
committed by GitHub
parent c9e8a9b4b7
commit 2cff019a1b
39 changed files with 1952 additions and 2427 deletions

View File

@ -254,7 +254,7 @@ pub enum RoutingAlgorithm {
#[derive(Clone, Debug, Deserialize, ToSchema, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrimaryBusinessDetails {
pub country: api_enums::CountryCode,
pub country: api_enums::CountryAlpha2,
pub business: String,
}
@ -385,11 +385,11 @@ pub struct MerchantConnectorCreate {
pub frm_configs: Option<FrmConfigs>,
/// Business Country of the connector
#[schema(example = "US")]
#[schema(value_type = CountryAlpha2, example = "US")]
#[cfg(feature = "multiple_mca")]
pub business_country: api_enums::CountryCode,
pub business_country: api_enums::CountryAlpha2,
#[cfg(not(feature = "multiple_mca"))]
pub business_country: Option<api_enums::CountryCode>,
pub business_country: Option<api_enums::CountryAlpha2>,
///Business Type of the merchant
#[schema(example = "travel")]
@ -466,8 +466,8 @@ pub struct MerchantConnectorResponse {
pub metadata: Option<pii::SecretSerdeValue>,
/// Business Country of the connector
#[schema(example = "US")]
pub business_country: api_enums::CountryCode,
#[schema(value_type = CountryAlpha2, example = "US")]
pub business_country: api_enums::CountryAlpha2,
///Business Type of the merchant
#[schema(example = "travel")]
@ -603,8 +603,8 @@ pub enum AcceptedCurrencies {
rename_all = "snake_case"
)]
pub enum AcceptedCountries {
EnableOnly(Vec<api_enums::CountryCode>),
DisableOnly(Vec<api_enums::CountryCode>),
EnableOnly(Vec<api_enums::CountryAlpha2>),
DisableOnly(Vec<api_enums::CountryAlpha2>),
AllAccepted,
}