Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(users): refactorProdIntent to support product-type context and merchant-scope#7638

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
likhinbopanna merged 20 commits intomainfromprod-intent-v2
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
cb78db0
feat(users): add v2 routes for dashboard_metadata
tsdk02Mar 26, 2025
07d3eb7
feat(users): add product_type context while populating table and whil…
tsdk02Mar 26, 2025
74bd790
fix clippy errors
tsdk02Mar 26, 2025
9353361
minor nits
tsdk02Mar 26, 2025
1df4975
feat(users): make prodIntent merchant-scoped
tsdk02Mar 26, 2025
9251a08
merged main
tsdk02Mar 26, 2025
8d9d3e2
chore: run formatter
hyperswitch-bot[bot]Mar 26, 2025
5d0d135
feat(users): extract product_type through merchant_account db call
tsdk02Mar 27, 2025
c198192
merged main
tsdk02Mar 27, 2025
dda8479
chore: run formatter
hyperswitch-bot[bot]Mar 27, 2025
e52026e
minor nits
tsdk02Mar 27, 2025
d2455bc
resolve comments
tsdk02Mar 27, 2025
b082834
feat(users): obtain product_type from the request body
tsdk02Apr 3, 2025
4d0b6ea
Merge branch 'main' into prod-intent-v2
tsdk02Apr 3, 2025
0186b99
default product_type if not included in request body
tsdk02Apr 3, 2025
64b75fe
resolved comments
tsdk02Apr 3, 2025
140bb03
fix errors due to Copy trait derived on MerchantProductType
tsdk02Apr 5, 2025
c184d34
Merge branch 'main' into prod-intent-v2
tsdk02Apr 8, 2025
5960f00
made product type to extract default value and avoided mutating the p…
tsdk02Apr 8, 2025
0bc3446
Merge branch 'main' into prod-intent-v2
tsdk02Apr 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
feat(users): add product_type context while populating table and whil…
…e sending email
  • Loading branch information
@tsdk02
tsdk02 committedMar 26, 2025
commit07d3eb725d78fd578d6b1839f072df4cec6a7fcf
3 changes: 2 additions & 1 deletioncrates/api_models/src/user/dashboard_metadata.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
use common_enums::CountryAlpha2;
use common_enums::{CountryAlpha2, MerchantProductType};
use common_utils::{id_type, pii};
use masking::Secret;
use strum::EnumString;
Expand DownExpand Up@@ -102,6 +102,7 @@ pub struct ProdIntent {
pub poc_contact: Option<String>,
pub comments: Option<String>,
pub is_completed: bool,
pub product_type: Option<MerchantProductType>,
}

#[derive(Debug, serde::Deserialize, EnumString, serde::Serialize)]
Expand Down
34 changes: 30 additions & 4 deletionscrates/router/src/core/user/dashboard_metadata.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,7 +38,6 @@ pub async fn set_metadata(
Ok(ApplicationResponse::StatusOk)
}

#[cfg(feature = "v1")]
pub async fn get_multiple_metadata(
state: SessionState,
user: UserFromToken,
Expand DownExpand Up@@ -632,7 +631,6 @@ async fn fetch_metadata(
Ok(dashboard_metadata)
}

#[cfg(feature = "v1")]
pub async fn backfill_metadata(
state: &SessionState,
user: &UserFromToken,
Expand DownExpand Up@@ -674,7 +672,7 @@ pub async fn backfill_metadata(
} else {
return Ok(None);
};

#[cfg(feature = "v1")]
Some(
insert_metadata(
state,
Expand All@@ -687,6 +685,20 @@ pub async fn backfill_metadata(
)
.await,
)
.transpose();
#[cfg(feature = "v2")]
Some(
insert_metadata(
state,
user.to_owned(),
DBEnum::StripeConnected,
types::MetaData::StripeConnected(api::ProcessorConnected {
processor_id: mca.get_id(),
processor_name: mca.connector_name.to_string(),
}),
)
.await,
)
.transpose()
}
DBEnum::PaypalConnected => {
Expand DownExpand Up@@ -714,7 +726,7 @@ pub async fn backfill_metadata(
} else {
return Ok(None);
};

#[cfg(feature = "v1")]
Some(
insert_metadata(
state,
Expand All@@ -727,6 +739,20 @@ pub async fn backfill_metadata(
)
.await,
)
.transpose();
#[cfg(feature = "v2")]
Some(
insert_metadata(
state,
user.to_owned(),
DBEnum::PaypalConnected,
types::MetaData::PaypalConnected(api::ProcessorConnected {
processor_id: mca.get_id(),
processor_name: mca.connector_name.to_string(),
}),
)
.await,
)
.transpose()
}
_ => Ok(None),
Expand Down
1 change: 0 additions & 1 deletioncrates/router/src/routes/user.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -197,7 +197,6 @@ pub async fn set_dashboard_metadata(
.await
}

#[cfg(feature = "v1")]
pub async fn get_multiple_dashboard_metadata(
state: web::Data<AppState>,
req: HttpRequest,
Expand Down
4 changes: 4 additions & 0 deletionscrates/router/src/services/email/assets/bizemailprod.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,6 +104,10 @@
<strong>Business Website:</strong>
{business_website}
</li>
<li>
<strong>Product Type:</strong>
{product_type}
</li>
</ol>
</td>
</tr>
Expand Down
6 changes: 6 additions & 0 deletionscrates/router/src/services/email/types.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,7 @@ pub enum EmailBody {
legal_business_name: String,
business_location: String,
business_website: String,
product_type: common_enums::MerchantProductType,
},
ReconActivation {
user_name: String,
Expand DownExpand Up@@ -106,6 +107,7 @@ pub mod html {
legal_business_name,
business_location,
business_website,
product_type,
} => {
format!(
include_str!("assets/bizemailprod.html"),
Expand All@@ -114,6 +116,7 @@ pub mod html {
business_location = business_location,
business_website = business_website,
username = user_name,
product_type = product_type
)
}
EmailBody::ProFeatureRequest {
Expand DownExpand Up@@ -438,6 +441,7 @@ pub struct BizEmailProd {
pub subject: &'static str,
pub theme_id: Option<String>,
pub theme_config: EmailThemeConfig,
pub product_type: common_enums::MerchantProductType,
}

impl BizEmailProd {
Expand All@@ -463,6 +467,7 @@ impl BizEmailProd {
business_website: data.business_website.unwrap_or_default(),
theme_id,
theme_config,
product_type: data.product_type.unwrap_or_default(),
})
}
}
Expand All@@ -476,6 +481,7 @@ impl EmailData for BizEmailProd {
legal_business_name: self.legal_business_name.clone(),
business_location: self.business_location.clone(),
business_website: self.business_website.clone(),
product_type: self.product_type.clone(),
});

Ok(EmailContents {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp