Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(user): add integration_completed enum in metadata type (#3245)

Apoorv Dixit3ab71fbd5ac8
diff --git a/crates/router/src/utils/user/dashboard_metadata.rs b/crates/router/src/utils/user/dashboard_metadata.rs
index 40594a6e49..09fb5ccd24 100644
--- a/crates/router/src/utils/user/dashboard_metadata.rs
+++ b/crates/router/src/utils/user/dashboard_metadata.rs
@@ -91,21 +91,12 @@ pub async fn get_merchant_scoped_metadata_from_db(
org_id: String,
metadata_keys: Vec<DBEnum>,
) -> UserResult<Vec<DashboardMetadata>> {
- match state
+ state
.store
.find_merchant_scoped_dashboard_metadata(&merchant_id, &org_id, metadata_keys)
.await
- {
- Ok(data) => Ok(data),
- Err(e) => {
- if e.current_context().is_db_not_found() {
- return Ok(Vec::with_capacity(0));
- }
- Err(e
- .change_context(UserErrors::InternalServerError)
- .attach_printable("DB Error Fetching DashboardMetaData"))
- }
- }
+ .change_context(UserErrors::InternalServerError)
+ .attach_printable("DB Error Fetching DashboardMetaData")
}
pub async fn get_user_scoped_metadata_from_db(
state: &AppState,
diff --git a/migrations/2024-01-04-121733_add_dashboard_metadata_key_integration_completed/down.sql b/migrations/2024-01-04-121733_add_dashboard_metadata_key_integration_completed/down.sql
new file mode 100644
index 0000000000..c7c9cbeb40
--- /dev/null
+++ b/migrations/2024-01-04-121733_add_dashboard_metadata_key_integration_completed/down.sql
@@ -0,0 +1,2 @@
+-- This file should undo anything in `up.sql`
+SELECT 1;
\ No newline at end of file
diff --git a/migrations/2024-01-04-121733_add_dashboard_metadata_key_integration_completed/up.sql b/migrations/2024-01-04-121733_add_dashboard_metadata_key_integration_completed/up.sql
new file mode 100644
index 0000000000..bb703fde39
--- /dev/null
+++ b/migrations/2024-01-04-121733_add_dashboard_metadata_key_integration_completed/up.sql
@@ -0,0 +1,2 @@
+-- Your SQL goes here
+ALTER TYPE "DashboardMetadata" ADD VALUE IF NOT EXISTS 'integration_completed';
\ No newline at end of file