Coverage for app/ddd/domain/repository/group_repository.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-15 01:44 +0000

1from abc import ABCMeta, abstractmethod 

2 

3from sqlmodel import Session 

4 

5from app.ddd.domain.model import ( 

6 Group, 

7 GroupId, 

8) 

9 

10 

11class GroupRepository(metaclass=ABCMeta): 

12 @abstractmethod 

13 def __init__(self, db: Session) -> None: 

14 pass 

15 

16 @abstractmethod 

17 def find_by_id(self, _id: GroupId) -> Group: 

18 raise NotImplementedError 

19 

20 @abstractmethod 

21 def insert(self, user: Group) -> None: 

22 raise NotImplementedError 

23 

24 # @abstractmethod 

25 # def insert_user_report(self, user: Group) -> None: 

26 # raise NotImplementedError 

27 

28 

29 # @abstractmethod 

30 # def update(self, user: Group) -> None: 

31 # raise NotImplementedError 

32 

33 @abstractmethod 

34 def delete(self, _id: GroupId) -> None: 

35 raise NotImplementedError 

36 

37 @abstractmethod 

38 def query(self) -> list[Group]: 

39 """ 

40 TODO(nonomura): リポジトリでのメソッドかどうか要検討. 

41 

42 多分クエリモデル文脈になるから分けたほうが良いかも 

43 """ 

44 raise NotImplementedError