29 lines
586 B
Python
29 lines
586 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from core.domain.worker.Worker import Worker
|
|
from core.domain.worker.WorkerType import WorkerType
|
|
from core.types.Id import Id
|
|
|
|
|
|
class WorkerRepo(ABC):
|
|
@abstractmethod
|
|
def getAll(self) -> list[Worker]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get(self, id: Id[Worker]) -> Optional[Worker]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def post(self, ip: str, type: WorkerType) -> Worker:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def getByIp(self, ip: str, type: WorkerType):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def deleteByIp(self, ip: str, type: WorkerType) -> int:
|
|
pass
|