diff --git a/ara/domain/board/board_domain.py b/ara/domain/board/board_domain.py new file mode 100644 index 00000000..0d42a58a --- /dev/null +++ b/ara/domain/board/board_domain.py @@ -0,0 +1,10 @@ +from ara.domain.board.type import BoardInfo +from ara.infra.board.board_infra import BoardInfra + + +class BoardDomain: + def __init__(self) -> None: + self.board_infra = BoardInfra() + + def get_all_boards(self) -> list[BoardInfo]: + return self.board_infra.get_all_boards() diff --git a/ara/infra/board/board_infra.py b/ara/infra/board/board_infra.py index 32394940..cd59ac12 100644 --- a/ara/infra/board/board_infra.py +++ b/ara/infra/board/board_infra.py @@ -16,7 +16,7 @@ def __init__(self) -> None: super().__init__(Board) self.board_group_infra = BoardGroupInfra() - def get_all(self) -> list[BoardInfo]: + def get_all_boards(self) -> list[BoardInfo]: queryset = Board.objects.select_related("group").extra( select={ "topic_id": "topic.id", diff --git a/ara/service/board/__init__.py b/ara/service/board/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ara/service/board/board_service.py b/ara/service/board/board_service.py new file mode 100644 index 00000000..bf8baf01 --- /dev/null +++ b/ara/service/board/board_service.py @@ -0,0 +1,10 @@ +from ara.domain.board.board_domain import BoardDomain +from ara.domain.board.type import BoardInfo + + +class BadgeApplication: + def __init__(self) -> None: + self.board_domain = BoardDomain() + + def get_all_boards(self) -> list[BoardInfo]: + return self.board_domain.get_all_boards()