This repository has been archived on 2023-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
2023-01-10 00:48:55 +00:00
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
2023-01-14 19:03:56 +00:00
|
|
|
from ..models.matrix_room import MatrixRoom
|
|
|
|
from ..models.user import User
|
|
|
|
|
2023-01-10 00:48:55 +00:00
|
|
|
|
|
|
|
class AbstractDatabaseRepository(ABC):
|
|
|
|
@abstractmethod
|
|
|
|
def create_tables(self) -> None:
|
|
|
|
"""Init tables in database"""
|
2023-01-14 19:03:56 +00:00
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
def create_user(self, user: User) -> User:
|
|
|
|
""""""
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
def get_user_by_id(self) -> User:
|
|
|
|
""""""
|
|
|
|
|
2023-01-14 23:01:04 +00:00
|
|
|
@abstractmethod
|
|
|
|
def update_user_by_id(self) -> User:
|
|
|
|
""""""
|
|
|
|
|
2023-01-14 19:03:56 +00:00
|
|
|
@abstractmethod
|
|
|
|
def delete_user(self) -> None:
|
|
|
|
""""""
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
def create_matrix_room(self) -> MatrixRoom:
|
|
|
|
""""""
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
def get_matrix_room(self) -> MatrixRoom:
|
|
|
|
""""""
|
|
|
|
|
2023-01-14 23:01:04 +00:00
|
|
|
@abstractmethod
|
|
|
|
def update_matrix_room(self) -> MatrixRoom:
|
|
|
|
""""""
|
|
|
|
|
2023-01-14 19:03:56 +00:00
|
|
|
@abstractmethod
|
|
|
|
def delete_matrix_room(self) -> None:
|
|
|
|
""""""
|