Skip to content

Commit 7f44ce1

Browse files
committed
Add team management abstract methods to DatabaseBase
Introduces abstract methods for adding, updating, retrieving, and deleting team configurations in the DatabaseBase class. Also adds a convenience alias for getting steps by plan for compatibility.
1 parent 0c10816 commit 7f44ce1

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

src/backend/common/database/database_base.py

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,46 @@ async def get_step(self, step_id: str, session_id: str) -> Optional[Step]:
126126
"""Retrieve a step by step_id and session_id."""
127127
pass
128128

129-
# Data Management Operations
129+
# Team Operations
130130
@abstractmethod
131-
async def get_data_by_type(self, data_type: str) -> List[BaseDataModel]:
132-
"""Retrieve all data of a specific type."""
131+
async def add_team(self, team: TeamConfiguration) -> None:
132+
"""Add a team configuration to the database."""
133+
pass
134+
135+
@abstractmethod
136+
async def update_team(self, team: TeamConfiguration) -> None:
137+
"""Update a team configuration in the database."""
138+
pass
139+
140+
@abstractmethod
141+
async def get_team(self, team_id: str) -> Optional[TeamConfiguration]:
142+
"""Retrieve a team configuration by team_id."""
143+
pass
144+
145+
@abstractmethod
146+
async def get_team_by_id(self, id: str) -> Optional[TeamConfiguration]:
147+
"""Retrieve a team configuration by internal id."""
148+
pass
149+
150+
@abstractmethod
151+
async def get_all_teams_by_user(self, user_id: str) -> List[TeamConfiguration]:
152+
"""Retrieve all team configurations for the given user."""
133153
pass
134154

135155
@abstractmethod
136-
async def get_all_messages(self) -> List[Dict[str, Any]]:
137-
"""Retrieve all messages as dictionaries."""
156+
async def delete_team(self, team_id: str) -> bool:
157+
"""Delete a team configuration by team_id and return True if deleted."""
158+
pass
159+
160+
@abstractmethod
161+
async def delete_team_by_id(self, id: str) -> bool:
162+
"""Delete a team configuration by internal id and return True if deleted."""
163+
pass
164+
165+
# Data Management Operations
166+
@abstractmethod
167+
async def get_data_by_type(self, data_type: str) -> List[BaseDataModel]:
168+
"""Retrieve all data of a specific type."""
138169
pass
139170

140171
@abstractmethod
@@ -151,3 +182,8 @@ async def __aenter__(self):
151182
async def __aexit__(self, exc_type, exc, tb):
152183
"""Async context manager exit."""
153184
await self.close()
185+
186+
# Convenience aliases
187+
async def get_steps_for_plan(self, plan_id: str) -> List[Step]:
188+
"""Convenience method aliasing get_steps_by_plan for compatibility."""
189+
pass

0 commit comments

Comments
 (0)