mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-20 05:37:43 +00:00
Update the remove all backup plans command.
Refactor the commands names. Add the service to remove all plans. Add tests for remove all command.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from injector import singleton, Module, provider
|
||||
|
||||
from tui_rsync.core.components.backup_plan.application.commands import RemoveAllBackupBackupPlansCommand
|
||||
from tui_rsync.core.components.backup_plan.application.commands import RemoveAllBackupPlansCommand
|
||||
from tui_rsync.core.components.backup_plan.application.queries import GetAllBackupPlansQuery, GetBackupPlanCountQuery
|
||||
from tui_rsync.core.components.backup_plan.application.repository import BackupPlanRepositoryPort, BackupPlanRepository
|
||||
from tui_rsync.core.components.backup_plan.application.services import GetBackupPlanCountService, \
|
||||
GetAllBackupPlansService
|
||||
GetAllBackupPlansService, RemoveAllBackupPlansService
|
||||
from tui_rsync.core.components.backup_plan.application.services.backup_plan_service import BackupPlanService
|
||||
from tui_rsync.core.ports.configuration import UserDataPathsPort
|
||||
from tui_rsync.core.ports.orm import DatabaseManagerPort
|
||||
@@ -39,8 +39,13 @@ class Configuration(Module):
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
def provide_remove_all_backup_plans_command(self, database_manager: DatabaseManagerPort) -> RemoveAllBackupBackupPlansCommand:
|
||||
return RemoveAllBackupBackupPlansCommand(database_manager)
|
||||
def provide_remove_all_backup_plans_command(self, database_manager: DatabaseManagerPort) -> RemoveAllBackupPlansCommand:
|
||||
return RemoveAllBackupPlansCommand(database_manager)
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
def provide_remove_all_backup_plans_service(self, command: RemoveAllBackupPlansCommand) -> RemoveAllBackupPlansService:
|
||||
return RemoveAllBackupPlansService(command)
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from injector import singleton, Module, provider
|
||||
|
||||
from tui_rsync.core.components.backup_plan.application.commands import RemoveAllBackupBackupPlansCommand
|
||||
from tui_rsync.core.components.backup_plan.application.commands import RemoveAllBackupPlansCommand
|
||||
from tui_rsync.core.components.backup_plan.application.queries import GetAllBackupPlansQuery, GetBackupPlanCountQuery
|
||||
from tui_rsync.core.components.backup_plan.application.repository import BackupPlanRepositoryPort, BackupPlanRepository
|
||||
from tui_rsync.core.components.backup_plan.application.services import GetBackupPlanCountService, \
|
||||
GetAllBackupPlansService
|
||||
GetAllBackupPlansService, RemoveAllBackupPlansService
|
||||
from tui_rsync.core.components.backup_plan.application.services.backup_plan_service import BackupPlanService
|
||||
from tui_rsync.core.ports.configuration import UserDataPathsPort
|
||||
from tui_rsync.core.ports.orm import DatabaseManagerPort
|
||||
@@ -39,8 +39,13 @@ class TestingConfiguration(Module):
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
def provide_remove_all_backup_plans_command(self, database_manager: DatabaseManagerPort) -> RemoveAllBackupBackupPlansCommand:
|
||||
return RemoveAllBackupBackupPlansCommand(database_manager)
|
||||
def provide_remove_all_backup_plans_command(self, database_manager: DatabaseManagerPort) -> RemoveAllBackupPlansCommand:
|
||||
return RemoveAllBackupPlansCommand(database_manager)
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
def provide_remove_all_backup_plans_service(self, command: RemoveAllBackupPlansCommand) -> RemoveAllBackupPlansService:
|
||||
return RemoveAllBackupPlansService(command)
|
||||
|
||||
@provider
|
||||
@singleton
|
||||
|
||||
Reference in New Issue
Block a user