refactor(router): move db models into separate crate and refactoring around it (#125)

This commit is contained in:
ItsMeShashank
2022-12-13 12:00:27 +05:30
committed by GitHub
parent fc670ea0da
commit eb4fe6f46b
106 changed files with 4013 additions and 3387 deletions

View File

@ -18,6 +18,7 @@ use crate::{
types::{
api,
storage::{self, enums},
transformers::{ForeignInto, ForeignTryInto},
},
utils::{generate_id, Encode, OptionExt, ValueExt},
};
@ -66,7 +67,7 @@ async fn payments_incoming_webhook_flow(
let event_type: enums::EventType = payments_response
.status
.try_into()
.foreign_try_into()
.into_report()
.change_context(errors::WebhooksFlowError::PaymentsCoreFailed)?;
@ -123,7 +124,7 @@ async fn create_event_and_trigger_outgoing_webhook(
let outgoing_webhook = api::OutgoingWebhook {
merchant_id: merchant_account.merchant_id.clone(),
event_id: event.event_id,
event_type: event.event_type.into(),
event_type: event.event_type.foreign_into(),
content,
timestamp: event.created_at,
};