Skip to content

Commit

Permalink
add gsm in storage
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-harsha-vardhan committed Nov 7, 2023
1 parent d7ed4c5 commit 8093656
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 68 deletions.
64 changes: 0 additions & 64 deletions crates/router/src/db/gsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,67 +178,3 @@ impl GsmInterface for MockDb {
Err(errors::StorageError::MockDbError)?
}
}

#[cfg(feature = "kafka_events")]
#[async_trait::async_trait]
impl GsmInterface for super::KafkaStore {
async fn add_gsm_rule(
&self,
rule: storage::GatewayStatusMappingNew,
) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> {
self.diesel_store.add_gsm_rule(rule).await
}

async fn find_gsm_decision(
&self,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> CustomResult<String, errors::StorageError> {
self.diesel_store
.find_gsm_decision(connector, flow, sub_flow, code, message)
.await
}

async fn find_gsm_rule(
&self,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> {
self.diesel_store
.find_gsm_rule(connector, flow, sub_flow, code, message)
.await
}

async fn update_gsm_rule(
&self,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
data: storage::GatewayStatusMappingUpdate,
) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> {
self.diesel_store
.update_gsm_rule(connector, flow, sub_flow, code, message, data)
.await
}

async fn delete_gsm_rule(
&self,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> CustomResult<bool, errors::StorageError> {
self.diesel_store
.delete_gsm_rule(connector, flow, sub_flow, code, message)
.await
}
}
9 changes: 5 additions & 4 deletions crates/router/src/types/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub mod enums;
pub mod ephemeral_key;
pub mod events;
pub mod file;
pub mod gsm;
#[cfg(feature = "kv_store")]
pub mod kv;
pub mod locker_mock_up;
Expand Down Expand Up @@ -41,10 +42,10 @@ pub use data_models::payments::{

pub use self::{
address::*, api_keys::*, capture::*, cards_info::*, configs::*, connector_response::*,
customers::*, dispute::*, ephemeral_key::*, events::*, file::*, locker_mock_up::*, mandate::*,
merchant_account::*, merchant_connector_account::*, merchant_key_store::*, payment_link::*,
payment_method::*, payout_attempt::*, payouts::*, process_tracker::*, refund::*,
reverse_lookup::*, routing_algorithm::*,
customers::*, dispute::*, ephemeral_key::*, events::*, file::*, gsm::*, locker_mock_up::*,
mandate::*, merchant_account::*, merchant_connector_account::*, merchant_key_store::*,
payment_link::*, payment_method::*, payout_attempt::*, payouts::*, process_tracker::*,
refund::*, reverse_lookup::*, routing_algorithm::*,
};
use crate::types::api::routing;

Expand Down
4 changes: 4 additions & 0 deletions crates/router/src/types/storage/gsm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub use diesel_models::gsm::{
GatewayStatusMap, GatewayStatusMapperUpdateInternal, GatewayStatusMappingNew,
GatewayStatusMappingUpdate,
};

0 comments on commit 8093656

Please sign in to comment.