Add the application service for backup plans.

dev
KKlochko 4 months ago
parent c8d2b84cfc
commit 4bfdcf066b

@ -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)
Loading…
Cancel
Save