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
|
2023-01-14 23:47:09 +00:00
|
|
|
def get_user_by_id(self, user_id: str) -> User:
|
2023-01-14 19:03:56 +00:00
|
|
|
""""""
|
|
|
|
|
2023-01-14 23:01:04 +00:00
|
|
|
@abstractmethod
|
2023-01-14 23:47:09 +00:00
|
|
|
def update_user(self, user: User) -> User:
|
2023-01-14 23:01:04 +00:00
|
|
|
""""""
|
|
|
|
|
2023-01-14 19:03:56 +00:00
|
|
|
@abstractmethod
|
2023-01-14 23:47:09 +00:00
|
|
|
def delete_user(self, user_id: str) -> None:
|
2023-01-14 19:03:56 +00:00
|
|
|
""""""
|
|
|
|
|
|
|
|
@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:
|
|
|
|
""""""
|