feat(core): introduce accounts schema for accounts related tables (#7113)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2025-02-14 18:11:06 +05:30
committed by GitHub
parent 0b972e38ab
commit 0ba4ccfc8b
26 changed files with 308 additions and 56 deletions

View File

@ -126,7 +126,6 @@ pub trait StorageInterface:
+ RedisConnInterface
+ RequestIdStore
+ business_profile::ProfileInterface
+ OrganizationInterface
+ routing_algorithm::RoutingAlgorithmInterface
+ gsm::GsmInterface
+ unified_translations::UnifiedTranslationsInterface
@ -159,9 +158,18 @@ pub trait GlobalStorageInterface:
{
}
pub trait CommonStorageInterface: StorageInterface + GlobalStorageInterface {
#[async_trait::async_trait]
pub trait AccountsStorageInterface:
Send + Sync + dyn_clone::DynClone + OrganizationInterface + 'static
{
}
pub trait CommonStorageInterface:
StorageInterface + GlobalStorageInterface + AccountsStorageInterface
{
fn get_storage_interface(&self) -> Box<dyn StorageInterface>;
fn get_global_storage_interface(&self) -> Box<dyn GlobalStorageInterface>;
fn get_accounts_storage_interface(&self) -> Box<dyn AccountsStorageInterface>;
}
pub trait MasterKeyInterface {
@ -198,6 +206,8 @@ impl StorageInterface for Store {
#[async_trait::async_trait]
impl GlobalStorageInterface for Store {}
impl AccountsStorageInterface for Store {}
#[async_trait::async_trait]
impl StorageInterface for MockDb {
fn get_scheduler_db(&self) -> Box<dyn scheduler::SchedulerInterface> {
@ -212,6 +222,8 @@ impl StorageInterface for MockDb {
#[async_trait::async_trait]
impl GlobalStorageInterface for MockDb {}
impl AccountsStorageInterface for MockDb {}
impl CommonStorageInterface for MockDb {
fn get_global_storage_interface(&self) -> Box<dyn GlobalStorageInterface> {
Box::new(self.clone())
@ -219,6 +231,10 @@ impl CommonStorageInterface for MockDb {
fn get_storage_interface(&self) -> Box<dyn StorageInterface> {
Box::new(self.clone())
}
fn get_accounts_storage_interface(&self) -> Box<dyn AccountsStorageInterface> {
Box::new(self.clone())
}
}
impl CommonStorageInterface for Store {
@ -228,6 +244,9 @@ impl CommonStorageInterface for Store {
fn get_storage_interface(&self) -> Box<dyn StorageInterface> {
Box::new(self.clone())
}
fn get_accounts_storage_interface(&self) -> Box<dyn AccountsStorageInterface> {
Box::new(self.clone())
}
}
pub trait RequestIdStore {
@ -267,6 +286,7 @@ where
dyn_clone::clone_trait_object!(StorageInterface);
dyn_clone::clone_trait_object!(GlobalStorageInterface);
dyn_clone::clone_trait_object!(AccountsStorageInterface);
impl RequestIdStore for KafkaStore {
fn add_request_id(&mut self, request_id: String) {