refactor(router): make error_type generic in domain_models inorder to avoid conversion of errors in storage_impl (#7537)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Jagan
2025-03-21 17:13:19 +05:30
committed by GitHub
parent aedf460c70
commit 80218d0f27
38 changed files with 380 additions and 428 deletions

View File

@ -6,17 +6,18 @@ use diesel_models::enums as storage_enums;
use hyperswitch_domain_models::merchant_key_store::MerchantKeyStore;
#[cfg(feature = "v1")]
use hyperswitch_domain_models::payments::payment_attempt::PaymentAttemptNew;
use hyperswitch_domain_models::{
errors::StorageError,
payments::payment_attempt::{PaymentAttempt, PaymentAttemptInterface, PaymentAttemptUpdate},
use hyperswitch_domain_models::payments::payment_attempt::{
PaymentAttempt, PaymentAttemptInterface, PaymentAttemptUpdate,
};
use super::MockDb;
use crate::errors::StorageError;
#[cfg(feature = "v1")]
use crate::DataModelExt;
#[async_trait::async_trait]
impl PaymentAttemptInterface for MockDb {
type Error = StorageError;
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_payment_id_merchant_id_attempt_id(
&self,

View File

@ -3,7 +3,6 @@ use diesel_models::enums as storage_enums;
use error_stack::ResultExt;
use hyperswitch_domain_models::{
behaviour::Conversion,
errors::StorageError,
merchant_key_store::MerchantKeyStore,
payments::{
payment_intent::{PaymentIntentInterface, PaymentIntentUpdate},
@ -12,9 +11,11 @@ use hyperswitch_domain_models::{
};
use super::MockDb;
use crate::errors::StorageError;
#[async_trait::async_trait]
impl PaymentIntentInterface for MockDb {
type Error = StorageError;
#[cfg(all(feature = "v1", feature = "olap"))]
async fn filter_payment_intent_by_constraints(
&self,

View File

@ -1,19 +1,18 @@
use common_utils::errors::CustomResult;
use diesel_models::enums as storage_enums;
use hyperswitch_domain_models::{
errors::StorageError,
payouts::{
payout_attempt::{
PayoutAttempt, PayoutAttemptInterface, PayoutAttemptNew, PayoutAttemptUpdate,
},
payouts::Payouts,
use hyperswitch_domain_models::payouts::{
payout_attempt::{
PayoutAttempt, PayoutAttemptInterface, PayoutAttemptNew, PayoutAttemptUpdate,
},
payouts::Payouts,
};
use super::MockDb;
use crate::errors::StorageError;
#[async_trait::async_trait]
impl PayoutAttemptInterface for MockDb {
type Error = StorageError;
async fn update_payout_attempt(
&self,
_this: &PayoutAttempt,

View File

@ -1,17 +1,15 @@
use common_utils::errors::CustomResult;
use diesel_models::enums as storage_enums;
use hyperswitch_domain_models::{
errors::StorageError,
payouts::{
payout_attempt::PayoutAttempt,
payouts::{Payouts, PayoutsInterface, PayoutsNew, PayoutsUpdate},
},
use hyperswitch_domain_models::payouts::{
payout_attempt::PayoutAttempt,
payouts::{Payouts, PayoutsInterface, PayoutsNew, PayoutsUpdate},
};
use super::MockDb;
use crate::{errors::StorageError, MockDb};
#[async_trait::async_trait]
impl PayoutsInterface for MockDb {
type Error = StorageError;
async fn find_payout_by_merchant_id_payout_id(
&self,
_merchant_id: &common_utils::id_type::MerchantId,