mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
fix: remove and resolve FIXMEs and TODOs from db module (#174)
This commit is contained in:
@ -76,6 +76,8 @@ pub enum StorageError {
|
||||
DuplicateValue(String),
|
||||
#[error("KV error")]
|
||||
KVError,
|
||||
#[error("MockDb error")]
|
||||
MockDbError,
|
||||
}
|
||||
|
||||
impl From<error_stack::Report<storage_errors::DatabaseError>> for StorageError {
|
||||
|
||||
@ -95,7 +95,8 @@ impl AddressInterface for MockDb {
|
||||
&self,
|
||||
_address_id: &str,
|
||||
) -> CustomResult<storage::Address, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn update_address(
|
||||
@ -103,14 +104,16 @@ impl AddressInterface for MockDb {
|
||||
_address_id: String,
|
||||
_address: storage::AddressUpdate,
|
||||
) -> CustomResult<storage::Address, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn insert_address(
|
||||
&self,
|
||||
_address: storage::AddressNew,
|
||||
) -> CustomResult<storage::Address, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn update_address_by_merchant_id_customer_id(
|
||||
@ -119,6 +122,7 @@ impl AddressInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_address: storage::AddressUpdate,
|
||||
) -> CustomResult<Vec<storage::Address>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,14 +64,16 @@ impl ConfigInterface for MockDb {
|
||||
&self,
|
||||
_config: storage::ConfigNew,
|
||||
) -> CustomResult<storage::Config, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_config_by_key(
|
||||
&self,
|
||||
_key: &str,
|
||||
) -> CustomResult<storage::Config, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn update_config_by_key(
|
||||
@ -79,6 +81,7 @@ impl ConfigInterface for MockDb {
|
||||
_key: &str,
|
||||
_config_update: storage::ConfigUpdate,
|
||||
) -> CustomResult<storage::Config, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,9 +110,12 @@ impl ConnectorResponseInterface for MockDb {
|
||||
_txn_id: &str,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<storage::ConnectorResponse, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
// safety: interface only used for testing
|
||||
#[allow(clippy::unwrap_used)]
|
||||
async fn update_connector_response(
|
||||
&self,
|
||||
this: storage::ConnectorResponse,
|
||||
|
||||
@ -133,7 +133,8 @@ impl CustomerInterface for MockDb {
|
||||
_merchant_id: String,
|
||||
_customer: storage::CustomerUpdate,
|
||||
) -> CustomResult<storage::Customer, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_customer_by_customer_id_merchant_id(
|
||||
@ -141,7 +142,8 @@ impl CustomerInterface for MockDb {
|
||||
_customer_id: &str,
|
||||
_merchant_id: &str,
|
||||
) -> CustomResult<storage::Customer, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
#[allow(clippy::panic)]
|
||||
@ -171,6 +173,7 @@ impl CustomerInterface for MockDb {
|
||||
_customer_id: &str,
|
||||
_merchant_id: &str,
|
||||
) -> CustomResult<bool, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ impl EventInterface for MockDb {
|
||||
&self,
|
||||
_event: storage::EventNew,
|
||||
) -> CustomResult<storage::Event, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,20 +64,23 @@ impl LockerMockUpInterface for MockDb {
|
||||
&self,
|
||||
_card_id: &str,
|
||||
) -> CustomResult<storage::LockerMockUp, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn insert_locker_mock_up(
|
||||
&self,
|
||||
_new: storage::LockerMockUpNew,
|
||||
) -> CustomResult<storage::LockerMockUp, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn delete_locker_mock_up(
|
||||
&self,
|
||||
_card_id: &str,
|
||||
) -> CustomResult<storage::LockerMockUp, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +93,8 @@ impl MandateInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_mandate_id: &str,
|
||||
) -> CustomResult<storage::Mandate, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_mandate_by_merchant_id_customer_id(
|
||||
@ -101,7 +102,8 @@ impl MandateInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_customer_id: &str,
|
||||
) -> CustomResult<Vec<storage::Mandate>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn update_mandate_by_merchant_id_mandate_id(
|
||||
@ -110,13 +112,15 @@ impl MandateInterface for MockDb {
|
||||
_mandate_id: &str,
|
||||
_mandate: storage::MandateUpdate,
|
||||
) -> CustomResult<storage::Mandate, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn insert_mandate(
|
||||
&self,
|
||||
_mandate: storage::MandateNew,
|
||||
) -> CustomResult<storage::Mandate, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,7 +159,8 @@ impl MerchantAccountInterface for MockDb {
|
||||
|
||||
match account {
|
||||
Some(account) => Ok(account.clone()),
|
||||
None => todo!(),
|
||||
// [#172]: Implement function for `MockDb`
|
||||
None => Err(errors::StorageError::MockDbError)?,
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,7 +169,8 @@ impl MerchantAccountInterface for MockDb {
|
||||
_this: storage::MerchantAccount,
|
||||
_merchant_account: storage::MerchantAccountUpdate,
|
||||
) -> CustomResult<storage::MerchantAccount, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
#[allow(clippy::panic)]
|
||||
@ -190,13 +192,15 @@ impl MerchantAccountInterface for MockDb {
|
||||
&self,
|
||||
_publishable_key: &str,
|
||||
) -> CustomResult<storage::MerchantAccount, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn delete_merchant_account_by_merchant_id(
|
||||
&self,
|
||||
_merchant_id: &str,
|
||||
) -> CustomResult<bool, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,6 +129,8 @@ impl MerchantConnectorAccountInterface for Store {
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl MerchantConnectorAccountInterface for MockDb {
|
||||
// safety: only used for testing
|
||||
#[allow(clippy::unwrap_used)]
|
||||
async fn find_merchant_connector_account_by_merchant_id_connector(
|
||||
&self,
|
||||
merchant_id: &str,
|
||||
@ -150,7 +152,8 @@ impl MerchantConnectorAccountInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_merchant_connector_id: &i32,
|
||||
) -> CustomResult<storage::MerchantConnectorAccount, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
#[allow(clippy::panic)]
|
||||
@ -181,7 +184,8 @@ impl MerchantConnectorAccountInterface for MockDb {
|
||||
&self,
|
||||
_merchant_id: &str,
|
||||
) -> CustomResult<Vec<storage::MerchantConnectorAccount>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn update_merchant_connector_account(
|
||||
@ -189,7 +193,8 @@ impl MerchantConnectorAccountInterface for MockDb {
|
||||
_this: storage::MerchantConnectorAccount,
|
||||
_merchant_connector_account: storage::MerchantConnectorAccountUpdate,
|
||||
) -> CustomResult<storage::MerchantConnectorAccount, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn delete_merchant_connector_account_by_merchant_id_merchant_connector_id(
|
||||
@ -197,6 +202,7 @@ impl MerchantConnectorAccountInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_merchant_connector_id: &i32,
|
||||
) -> CustomResult<bool, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,8 +152,6 @@ mod storage {
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<PaymentAttempt, errors::StorageError> {
|
||||
let conn = pg_connection(&self.master_pool).await;
|
||||
// TODO: update logic to lookup all payment attempts for an intent
|
||||
// and apply filter logic on top of them to get the desired one.
|
||||
PaymentAttempt::find_by_merchant_id_connector_txn_id(
|
||||
&conn,
|
||||
merchant_id,
|
||||
@ -188,7 +186,8 @@ impl PaymentAttemptInterface for MockDb {
|
||||
_attempt_id: &str,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<types::PaymentAttempt, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_payment_attempt_by_merchant_id_connector_txn_id(
|
||||
@ -197,7 +196,8 @@ impl PaymentAttemptInterface for MockDb {
|
||||
_connector_txn_id: &str,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<types::PaymentAttempt, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
#[allow(clippy::panic)]
|
||||
@ -247,6 +247,8 @@ impl PaymentAttemptInterface for MockDb {
|
||||
Ok(payment_attempt)
|
||||
}
|
||||
|
||||
// safety: only used for testing
|
||||
#[allow(clippy::unwrap_used)]
|
||||
async fn update_payment_attempt(
|
||||
&self,
|
||||
this: types::PaymentAttempt,
|
||||
@ -271,7 +273,8 @@ impl PaymentAttemptInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<types::PaymentAttempt, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_payment_attempt_by_transaction_id_payment_id_merchant_id(
|
||||
@ -281,9 +284,12 @@ impl PaymentAttemptInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<types::PaymentAttempt, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
// safety: only used for testing
|
||||
#[allow(clippy::unwrap_used)]
|
||||
async fn find_payment_attempt_last_successful_attempt_by_payment_id_merchant_id(
|
||||
&self,
|
||||
payment_id: &str,
|
||||
@ -341,10 +347,9 @@ mod storage {
|
||||
"{}_{}",
|
||||
payment_attempt.merchant_id, payment_attempt.payment_id
|
||||
);
|
||||
// TODO: need to add an application generated payment attempt id to distinguish between multiple attempts for the same payment id
|
||||
// Check for database presence as well Maybe use a read replica here ?
|
||||
|
||||
let created_attempt = PaymentAttempt {
|
||||
id: 0i32,
|
||||
id: Default::default(),
|
||||
payment_id: payment_attempt.payment_id.clone(),
|
||||
merchant_id: payment_attempt.merchant_id.clone(),
|
||||
attempt_id: payment_attempt.attempt_id.clone(),
|
||||
@ -611,8 +616,6 @@ mod storage {
|
||||
match storage_scheme {
|
||||
enums::MerchantStorageScheme::PostgresOnly => {
|
||||
let conn = pg_connection(&self.master_pool).await;
|
||||
// TODO: update logic to lookup all payment attempts for an intent
|
||||
// and apply filter logic on top of them to get the desired one.
|
||||
PaymentAttempt::find_by_merchant_id_connector_txn_id(
|
||||
&conn,
|
||||
merchant_id,
|
||||
|
||||
@ -249,10 +249,7 @@ mod storage {
|
||||
.into_report()
|
||||
}
|
||||
|
||||
enums::MerchantStorageScheme::RedisKv => {
|
||||
//TODO: Implement this
|
||||
Err(errors::StorageError::KVError.into())
|
||||
}
|
||||
enums::MerchantStorageScheme::RedisKv => Err(errors::StorageError::KVError.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -333,7 +330,8 @@ impl PaymentIntentInterface for MockDb {
|
||||
_pc: &api::PaymentListConstraints,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<Vec<types::PaymentIntent>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
#[allow(clippy::panic)]
|
||||
@ -372,6 +370,8 @@ impl PaymentIntentInterface for MockDb {
|
||||
Ok(payment_intent)
|
||||
}
|
||||
|
||||
// safety: only used for testing
|
||||
#[allow(clippy::unwrap_used)]
|
||||
async fn update_payment_intent(
|
||||
&self,
|
||||
this: types::PaymentIntent,
|
||||
@ -387,6 +387,8 @@ impl PaymentIntentInterface for MockDb {
|
||||
Ok(payment_intent.clone())
|
||||
}
|
||||
|
||||
// safety: only used for testing
|
||||
#[allow(clippy::unwrap_used)]
|
||||
async fn find_payment_intent_by_payment_id_merchant_id(
|
||||
&self,
|
||||
payment_id: &str,
|
||||
|
||||
@ -88,14 +88,16 @@ impl PaymentMethodInterface for MockDb {
|
||||
&self,
|
||||
_payment_method_id: &str,
|
||||
) -> CustomResult<storage::PaymentMethod, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn insert_payment_method(
|
||||
&self,
|
||||
_m: storage::PaymentMethodNew,
|
||||
) -> CustomResult<storage::PaymentMethod, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_payment_method_by_customer_id_merchant_id_list(
|
||||
@ -103,7 +105,8 @@ impl PaymentMethodInterface for MockDb {
|
||||
_customer_id: &str,
|
||||
_merchant_id: &str,
|
||||
) -> CustomResult<Vec<storage::PaymentMethod>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn delete_payment_method_by_merchant_id_payment_method_id(
|
||||
@ -111,6 +114,7 @@ impl PaymentMethodInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_payment_method_id: &str,
|
||||
) -> CustomResult<storage::PaymentMethod, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +167,8 @@ impl ProcessTrackerInterface for MockDb {
|
||||
_ids: Vec<String>,
|
||||
_schedule_time: PrimitiveDateTime,
|
||||
) -> CustomResult<usize, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_processes_by_time_status(
|
||||
@ -177,7 +178,8 @@ impl ProcessTrackerInterface for MockDb {
|
||||
_status: enums::ProcessTrackerStatus,
|
||||
_limit: Option<i64>,
|
||||
) -> CustomResult<Vec<storage::ProcessTracker>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn insert_process(
|
||||
@ -209,7 +211,8 @@ impl ProcessTrackerInterface for MockDb {
|
||||
_this: storage::ProcessTracker,
|
||||
_process: storage::ProcessTrackerUpdate,
|
||||
) -> CustomResult<storage::ProcessTracker, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn update_process_tracker(
|
||||
@ -217,7 +220,8 @@ impl ProcessTrackerInterface for MockDb {
|
||||
_this: storage::ProcessTracker,
|
||||
_process: storage::ProcessTrackerUpdate,
|
||||
) -> CustomResult<storage::ProcessTracker, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn process_tracker_update_process_status_by_ids(
|
||||
@ -225,6 +229,7 @@ impl ProcessTrackerInterface for MockDb {
|
||||
_task_ids: Vec<String>,
|
||||
_task_update: storage::ProcessTrackerUpdate,
|
||||
) -> CustomResult<usize, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,7 +126,10 @@ impl QueueInterface for MockDb {
|
||||
_group_name: &str,
|
||||
_consumer_name: &str,
|
||||
) -> CustomResult<Vec<storage::ProcessTracker>, ProcessTrackerError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(ProcessTrackerError::ResourceFetchingFailed {
|
||||
resource_name: "consumer_tasks".to_string(),
|
||||
})?
|
||||
}
|
||||
|
||||
async fn consumer_group_create(
|
||||
@ -135,7 +138,8 @@ impl QueueInterface for MockDb {
|
||||
_group: &str,
|
||||
_id: &RedisEntryId,
|
||||
) -> CustomResult<(), RedisError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(RedisError::ConsumerGroupCreateFailed)?
|
||||
}
|
||||
|
||||
async fn acquire_pt_lock(
|
||||
@ -145,11 +149,13 @@ impl QueueInterface for MockDb {
|
||||
_lock_val: &str,
|
||||
_ttl: i64,
|
||||
) -> bool {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
false
|
||||
}
|
||||
|
||||
async fn release_pt_lock(&self, _tag: &str, _lock_key: &str) -> bool {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
false
|
||||
}
|
||||
|
||||
async fn stream_append_entry(
|
||||
@ -158,7 +164,8 @@ impl QueueInterface for MockDb {
|
||||
_entry_id: &RedisEntryId,
|
||||
_fields: Vec<(&str, String)>,
|
||||
) -> CustomResult<(), RedisError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(RedisError::StreamAppendFailed)?
|
||||
}
|
||||
|
||||
async fn get_key(&self, key: &str) -> CustomResult<Vec<u8>, RedisError> {
|
||||
|
||||
@ -553,7 +553,8 @@ impl RefundInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<storage_types::Refund, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn insert_refund(
|
||||
@ -614,7 +615,8 @@ impl RefundInterface for MockDb {
|
||||
_refund: storage_types::RefundUpdate,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<storage_types::Refund, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_refund_by_merchant_id_refund_id(
|
||||
@ -642,6 +644,7 @@ impl RefundInterface for MockDb {
|
||||
_merchant_id: &str,
|
||||
_storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> CustomResult<Vec<storage_types::Refund>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,20 +100,23 @@ impl TempCardInterface for MockDb {
|
||||
&self,
|
||||
_transaction_id: &str,
|
||||
) -> CustomResult<Option<storage::TempCard>, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn insert_tempcard_with_token(
|
||||
&self,
|
||||
_card: storage::TempCard,
|
||||
) -> CustomResult<storage::TempCard, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
|
||||
async fn find_tempcard_by_token(
|
||||
&self,
|
||||
_token: &i32,
|
||||
) -> CustomResult<storage::TempCard, errors::StorageError> {
|
||||
todo!()
|
||||
// [#172]: Implement function for `MockDb`
|
||||
Err(errors::StorageError::MockDbError)?
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,10 @@
|
||||
clippy::panic,
|
||||
clippy::panic_in_result_fn,
|
||||
clippy::panicking_unwrap,
|
||||
clippy::todo,
|
||||
clippy::unreachable,
|
||||
clippy::unwrap_in_result,
|
||||
clippy::unwrap_used
|
||||
)]
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
|
||||
@ -158,6 +158,7 @@ pub async fn payment_method_delete_api(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#![allow(clippy::unwrap_used)]
|
||||
use api_models::payment_methods::ListPaymentMethodRequest;
|
||||
|
||||
use super::*;
|
||||
|
||||
@ -76,6 +76,7 @@ pub trait ProcessTrackerWorkflow: Send + Sync {
|
||||
|
||||
#[cfg(test)]
|
||||
mod workflow_tests {
|
||||
#![allow(clippy::unwrap_used)]
|
||||
use super::PTRunner;
|
||||
use crate::utils::StringExt;
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@ pub trait Payment:
|
||||
|
||||
#[cfg(test)]
|
||||
mod payments_test {
|
||||
#![allow(clippy::expect_used)]
|
||||
#![allow(clippy::expect_used, clippy::unwrap_used)]
|
||||
|
||||
use super::*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user