mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-20 05:37:43 +00:00
Add the application service for backup plans.
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
from .backup_plan_repository_port import BackupPlanRepositoryPort
|
||||||
|
|
||||||
|
__all__ = ['BackupPlanRepositoryPort']
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
from tui_rsync.core.components.backup_plan.application.repository import BackupPlanRepositoryPort
|
||||||
|
|
||||||
|
from tui_rsync.core.components.backup_plan.domain import BackupPlan
|
||||||
|
from tui_rsync.core.shared_kernel.components.common import UUID
|
||||||
|
|
||||||
|
|
||||||
|
class BackupPlanService:
|
||||||
|
def __init__(self, backup_plan_repository: BackupPlanRepositoryPort):
|
||||||
|
self.backup_plan_repository = backup_plan_repository
|
||||||
|
|
||||||
|
def add(self, backup_plan: BackupPlan):
|
||||||
|
self.backup_plan_repository.add(backup_plan)
|
||||||
|
|
||||||
|
def get_by_id(self, uuid: UUID) -> Optional[BackupPlan]:
|
||||||
|
return self.backup_plan_repository.get_by_id(uuid)
|
||||||
|
|
||||||
|
def update(self, backup_plan: BackupPlan):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def delete(self, uuid: UUID) -> bool:
|
||||||
|
return self.backup_plan_repository.delete(uuid)
|
||||||
Reference in New Issue
Block a user