no fucking idea. was on the plane. project runs, tests pass.
This commit is contained in:
1 parent
9cc566c9d5
commit
fed675f4cb
14 files changed
+133
-40
No files matched your search
+16
-6
@@ -1,20 +1,30 @@
|
||||
use rusqlite::Connection;
|
||||
use crate::{CustomResult, Error};
|
||||
|
||||
use crate::services::_users::UserService;
|
||||
pub use crate::services::_users::UserService;
|
||||
pub use crate::services::_authentication::SessionService;
|
||||
|
||||
mod _transactions;
|
||||
mod _users;
|
||||
mod _authentication;
|
||||
mod _securities;
|
||||
|
||||
pub struct ServiceFactory<'a> {
|
||||
conn: &'a Connection,
|
||||
pub use crate::db::ledger_internal::LedgerInternal;
|
||||
|
||||
pub struct ReadOnlyServiceFactory<'a> {
|
||||
conn: &'a mut Connection,
|
||||
}
|
||||
|
||||
impl ServiceFactory<'_> {
|
||||
pub fn new(conn: &Connection) -> ServiceFactory {
|
||||
ServiceFactory { conn }
|
||||
impl ReadOnlyServiceFactory<'_> {
|
||||
pub fn new(conn: &mut Connection) -> ReadOnlyServiceFactory {
|
||||
ReadOnlyServiceFactory { conn }
|
||||
}
|
||||
|
||||
pub fn get_user_service(&self) -> UserService {
|
||||
UserService::new(self.conn)
|
||||
}
|
||||
|
||||
pub fn get_authentication_service(&mut self) -> CustomResult<SessionService> {
|
||||
SessionService::from_conn(self.conn)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user