mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-04 22:19:10 +08:00
feat(payouts): extend routing capabilities to payout operation (#3531)
Co-authored-by: Kashif <mohammed.kashif@juspay.in>
This commit is contained in:
@ -48,6 +48,14 @@ pub trait RoutingAlgorithmInterface {
|
||||
limit: i64,
|
||||
offset: i64,
|
||||
) -> StorageResult<Vec<routing_storage::RoutingProfileMetadata>>;
|
||||
|
||||
async fn list_routing_algorithm_metadata_by_merchant_id_transaction_type(
|
||||
&self,
|
||||
merchant_id: &str,
|
||||
transaction_type: &common_enums::TransactionType,
|
||||
limit: i64,
|
||||
offset: i64,
|
||||
) -> StorageResult<Vec<routing_storage::RoutingProfileMetadata>>;
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@ -144,6 +152,26 @@ impl RoutingAlgorithmInterface for Store {
|
||||
.map_err(Into::into)
|
||||
.into_report()
|
||||
}
|
||||
|
||||
async fn list_routing_algorithm_metadata_by_merchant_id_transaction_type(
|
||||
&self,
|
||||
merchant_id: &str,
|
||||
transaction_type: &common_enums::TransactionType,
|
||||
limit: i64,
|
||||
offset: i64,
|
||||
) -> StorageResult<Vec<routing_storage::RoutingProfileMetadata>> {
|
||||
let conn = connection::pg_connection_write(self).await?;
|
||||
routing_storage::RoutingAlgorithm::list_metadata_by_merchant_id_transaction_type(
|
||||
&conn,
|
||||
merchant_id,
|
||||
transaction_type,
|
||||
limit,
|
||||
offset,
|
||||
)
|
||||
.await
|
||||
.map_err(Into::into)
|
||||
.into_report()
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@ -196,4 +224,14 @@ impl RoutingAlgorithmInterface for MockDb {
|
||||
) -> StorageResult<Vec<routing_storage::RoutingProfileMetadata>> {
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn list_routing_algorithm_metadata_by_merchant_id_transaction_type(
|
||||
&self,
|
||||
_merchant_id: &str,
|
||||
_transaction_type: &common_enums::TransactionType,
|
||||
_limit: i64,
|
||||
_offset: i64,
|
||||
) -> StorageResult<Vec<routing_storage::RoutingProfileMetadata>> {
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user