implement account and account category services with CRUD operations
This commit is contained in:
23
src-tauri/src/services/mod.rs
Normal file
23
src-tauri/src/services/mod.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use sea_orm::DatabaseConnection;
|
||||
|
||||
pub mod accounts;
|
||||
|
||||
pub struct Services {
|
||||
pub account_category: Arc<dyn accounts::category::AccountCategoryService>,
|
||||
pub accounts: Arc<dyn accounts::AccountsService>,
|
||||
}
|
||||
|
||||
pub fn create_services(db: DatabaseConnection) -> Services {
|
||||
let account_category_service = Arc::new(accounts::category::AccountCategoryServiceImpl::new(
|
||||
db.clone(),
|
||||
));
|
||||
Services {
|
||||
account_category: account_category_service.clone(),
|
||||
accounts: Arc::new(accounts::AccountsServiceImpl::new(
|
||||
db,
|
||||
account_category_service,
|
||||
)),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user