@@ -6,9 +6,11 @@ use bcr_ebill_persistence::{
66 SurrealIdentityStore , SurrealNostrEventOffsetStore , SurrealNotificationStore ,
77 bill:: { BillChainStoreApi , BillStoreApi } ,
88 company:: { CompanyChainStoreApi , CompanyStoreApi } ,
9+ db:: nostr_send_queue:: SurrealNostrEventQueueStore ,
910 file_upload:: FileUploadStoreApi ,
1011 get_surreal_db,
1112 identity:: { IdentityChainStoreApi , IdentityStoreApi } ,
13+ nostr:: NostrQueuedMessageStoreApi ,
1214} ;
1315use log:: error;
1416use std:: sync:: Arc ;
@@ -39,6 +41,7 @@ pub struct DbContext {
3941 pub nostr_event_offset_store : Arc < dyn NostrEventOffsetStoreApi > ,
4042 pub notification_store : Arc < dyn NotificationStoreApi > ,
4143 pub backup_store : Arc < dyn BackupStoreApi > ,
44+ pub queued_message_store : Arc < dyn NostrQueuedMessageStoreApi > ,
4245}
4346
4447/// Creates a new instance of the DbContext with the given SurrealDB configuration.
@@ -77,6 +80,7 @@ pub async fn get_db_context(conf: &Config) -> bcr_ebill_persistence::Result<DbCo
7780 let nostr_event_offset_store = Arc :: new ( SurrealNostrEventOffsetStore :: new ( db. clone ( ) ) ) ;
7881 let notification_store = Arc :: new ( SurrealNotificationStore :: new ( db. clone ( ) ) ) ;
7982 let backup_store = Arc :: new ( SurrealBackupStore :: new ( db. clone ( ) ) ) ;
83+ let queued_message_store = Arc :: new ( SurrealNostrEventQueueStore :: new ( db. clone ( ) ) ) ;
8084
8185 Ok ( DbContext {
8286 contact_store,
@@ -90,5 +94,6 @@ pub async fn get_db_context(conf: &Config) -> bcr_ebill_persistence::Result<DbCo
9094 nostr_event_offset_store,
9195 notification_store,
9296 backup_store,
97+ queued_message_store,
9398 } )
9499}
0 commit comments