service_man/api/repositories/repository.py

24 lines
572 B
Python

from abc import ABC, abstractmethod
class AbstractRepository(ABC):
@abstractmethod
async def add_one(self, data: dict):
raise NotImplementedError()
@abstractmethod
async def find_all(self):
raise NotImplementedError()
@abstractmethod
async def find_one(self, filter: dict):
raise NotImplementedError()
@abstractmethod
async def update_one(self, filter: dict, data: dict):
raise NotImplementedError()
@abstractmethod
async def delete_one(self, filter: dict):
raise NotImplementedError()