mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
Update the configuration to use queries and commands.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from .user_data_paths import UserDataPaths
|
||||
from .current_configuration import CurrentConfiguration
|
||||
from .configuration import Configuration
|
||||
|
||||
__all__ = ['UserDataPaths']
|
||||
__all__ = ['UserDataPaths', 'CurrentConfiguration', 'Configuration']
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from injector import singleton, inject, Injector, Module, provider
|
||||
|
||||
from tui_rsync.core.components.backup_plan.application.commands import RemoveAllBackupBackupPlansCommand
|
||||
from tui_rsync.core.components.backup_plan.application.queries import GetAllBackupBackupPlansQuery
|
||||
from tui_rsync.core.components.backup_plan.application.repository import BackupPlanRepositoryPort
|
||||
from tui_rsync.core.components.backup_plan.application.repository.backup_plan_repository import BackupPlanRepository
|
||||
from tui_rsync.core.components.backup_plan.application.services.backup_plan_service import BackupPlanService
|
||||
@@ -29,3 +31,13 @@ class Configuration(Module):
|
||||
@singleton
|
||||
def provide_backup_plan_service(self, backup_plan_repository: BackupPlanRepositoryPort) -> BackupPlanService:
|
||||
return BackupPlanService(backup_plan_repository)
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
def provide_remove_all_backup_backup_plans_command(self, database_manager: DatabaseManagerPort) -> RemoveAllBackupBackupPlansCommand:
|
||||
return RemoveAllBackupBackupPlansCommand(database_manager)
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
def provide_get_all_backup_backup_plans_query(self, database_manager: DatabaseManagerPort) -> GetAllBackupBackupPlansQuery:
|
||||
return GetAllBackupBackupPlansQuery(database_manager)
|
||||
|
||||
Reference in New Issue
Block a user