feat(core): diesel models, domain models and db interface changes for callback_mapper table (#6571)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prasunna Soppa
2025-01-15 15:26:14 +05:30
committed by GitHub
parent dbe0cd4d2c
commit 043cf8e0c1
18 changed files with 219 additions and 13 deletions

View File

@ -0,0 +1,28 @@
use diesel_models::callback_mapper::CallbackMapper as DieselCallbackMapper;
use hyperswitch_domain_models::callback_mapper::CallbackMapper;
use crate::DataModelExt;
impl DataModelExt for CallbackMapper {
type StorageModel = DieselCallbackMapper;
fn to_storage_model(self) -> Self::StorageModel {
DieselCallbackMapper {
id: self.id,
type_: self.type_,
data: self.data,
created_at: self.created_at,
last_modified_at: self.last_modified_at,
}
}
fn from_storage_model(storage_model: Self::StorageModel) -> Self {
Self {
id: storage_model.id,
type_: storage_model.type_,
data: storage_model.data,
created_at: storage_model.created_at,
last_modified_at: storage_model.last_modified_at,
}
}
}