refactor(router): add parent caller function for DB (#3838)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2024-02-29 13:25:49 +05:30
committed by GitHub
parent 6b078fa339
commit 0936b02ade
71 changed files with 266 additions and 174 deletions

View File

@ -1,5 +1,6 @@
use diesel_models::routing_algorithm as routing_storage;
use error_stack::IntoReport;
use router_env::{instrument, tracing};
use storage_impl::mock_db::MockDb;
use crate::{
@ -60,6 +61,7 @@ pub trait RoutingAlgorithmInterface {
#[async_trait::async_trait]
impl RoutingAlgorithmInterface for Store {
#[instrument(skip_all)]
async fn insert_routing_algorithm(
&self,
routing_algorithm: routing_storage::RoutingAlgorithm,
@ -72,6 +74,7 @@ impl RoutingAlgorithmInterface for Store {
.into_report()
}
#[instrument(skip_all)]
async fn find_routing_algorithm_by_profile_id_algorithm_id(
&self,
profile_id: &str,
@ -88,6 +91,7 @@ impl RoutingAlgorithmInterface for Store {
.into_report()
}
#[instrument(skip_all)]
async fn find_routing_algorithm_by_algorithm_id_merchant_id(
&self,
algorithm_id: &str,
@ -104,6 +108,7 @@ impl RoutingAlgorithmInterface for Store {
.into_report()
}
#[instrument(skip_all)]
async fn find_routing_algorithm_metadata_by_algorithm_id_profile_id(
&self,
algorithm_id: &str,
@ -120,6 +125,7 @@ impl RoutingAlgorithmInterface for Store {
.into_report()
}
#[instrument(skip_all)]
async fn list_routing_algorithm_metadata_by_profile_id(
&self,
profile_id: &str,
@ -135,6 +141,7 @@ impl RoutingAlgorithmInterface for Store {
.into_report()
}
#[instrument(skip_all)]
async fn list_routing_algorithm_metadata_by_merchant_id(
&self,
merchant_id: &str,