1+
12"""Database base class for managing database operations."""
23
4+ # pylint: disable=unnecessary-pass
5+
36from abc import ABC , abstractmethod
47from typing import Any , Dict , List , Optional , Type
58
@@ -21,25 +24,30 @@ class DatabaseBase(ABC):
2124 @abstractmethod
2225 async def initialize (self ) -> None :
2326 """Initialize the database client and create containers if needed."""
27+ pass
2428
2529 @abstractmethod
2630 async def close (self ) -> None :
2731 """Close database connection."""
32+ pass
2833
2934 # Core CRUD Operations
3035 @abstractmethod
3136 async def add_item (self , item : BaseDataModel ) -> None :
3237 """Add an item to the database."""
38+ pass
3339
3440 @abstractmethod
3541 async def update_item (self , item : BaseDataModel ) -> None :
3642 """Update an item in the database."""
43+ pass
3744
3845 @abstractmethod
3946 async def get_item_by_id (
4047 self , item_id : str , partition_key : str , model_class : Type [BaseDataModel ]
4148 ) -> Optional [BaseDataModel ]:
4249 """Retrieve an item by its ID and partition key."""
50+ pass
4351
4452 @abstractmethod
4553 async def query_items (
@@ -49,92 +57,113 @@ async def query_items(
4957 model_class : Type [BaseDataModel ],
5058 ) -> List [BaseDataModel ]:
5159 """Query items from the database and return a list of model instances."""
60+ pass
5261
5362 @abstractmethod
5463 async def delete_item (self , item_id : str , partition_key : str ) -> None :
5564 """Delete an item from the database."""
65+ pass
5666
5767 # Plan Operations
5868 @abstractmethod
5969 async def add_plan (self , plan : Plan ) -> None :
6070 """Add a plan to the database."""
71+ pass
6172
6273 @abstractmethod
6374 async def update_plan (self , plan : Plan ) -> None :
6475 """Update a plan in the database."""
76+ pass
6577
6678 @abstractmethod
6779 async def get_plan_by_plan_id (self , plan_id : str ) -> Optional [Plan ]:
6880 """Retrieve a plan by plan_id."""
81+ pass
6982
7083 @abstractmethod
7184 async def get_plan (self , plan_id : str ) -> Optional [Plan ]:
7285 """Retrieve a plan by plan_id."""
86+ pass
7387
7488 @abstractmethod
7589 async def get_all_plans (self ) -> List [Plan ]:
7690 """Retrieve all plans for the user."""
91+ pass
7792
7893 @abstractmethod
7994 async def get_all_plans_by_team_id (self , team_id : str ) -> List [Plan ]:
8095 """Retrieve all plans for a specific team."""
96+ pass
8197
8298 @abstractmethod
8399 async def get_all_plans_by_team_id_status (
84100 self , user_id : str , team_id : str , status : str
85101 ) -> List [Plan ]:
86102 """Retrieve all plans for a specific team."""
103+ pass
87104
88105 # Step Operations
89106 @abstractmethod
90107 async def add_step (self , step : Step ) -> None :
91108 """Add a step to the database."""
109+ pass
92110
93111 @abstractmethod
94112 async def update_step (self , step : Step ) -> None :
95113 """Update a step in the database."""
114+ pass
96115
97116 @abstractmethod
98117 async def get_steps_by_plan (self , plan_id : str ) -> List [Step ]:
99118 """Retrieve all steps for a plan."""
119+ pass
100120
101121 @abstractmethod
102122 async def get_step (self , step_id : str , session_id : str ) -> Optional [Step ]:
103123 """Retrieve a step by step_id and session_id."""
124+ pass
104125
105126 # Team Operations
106127 @abstractmethod
107128 async def add_team (self , team : TeamConfiguration ) -> None :
108129 """Add a team configuration to the database."""
130+ pass
109131
110132 @abstractmethod
111133 async def update_team (self , team : TeamConfiguration ) -> None :
112134 """Update a team configuration in the database."""
135+ pass
113136
114137 @abstractmethod
115138 async def get_team (self , team_id : str ) -> Optional [TeamConfiguration ]:
116139 """Retrieve a team configuration by team_id."""
140+ pass
117141
118142 @abstractmethod
119143 async def get_team_by_id (self , team_id : str ) -> Optional [TeamConfiguration ]:
120144 """Retrieve a team configuration by internal id."""
145+ pass
121146
122147 @abstractmethod
123148 async def get_all_teams (self ) -> List [TeamConfiguration ]:
124149 """Retrieve all team configurations for the given user."""
150+ pass
125151
126152 @abstractmethod
127153 async def delete_team (self , team_id : str ) -> bool :
128154 """Delete a team configuration by team_id and return True if deleted."""
155+ pass
129156
130157 # Data Management Operations
131158 @abstractmethod
132159 async def get_data_by_type (self , data_type : str ) -> List [BaseDataModel ]:
133160 """Retrieve all data of a specific type."""
161+ pass
134162
135163 @abstractmethod
136164 async def get_all_items (self ) -> List [Dict [str , Any ]]:
137165 """Retrieve all items as dictionaries."""
166+ pass
138167
139168 # Context Manager Support
140169 async def __aenter__ (self ):
@@ -149,14 +178,17 @@ async def __aexit__(self, exc_type, exc, tb):
149178 @abstractmethod
150179 async def get_steps_for_plan (self , plan_id : str ) -> List [Step ]:
151180 """Convenience method aliasing get_steps_by_plan for compatibility."""
181+ pass
152182
153183 @abstractmethod
154184 async def get_current_team (self , user_id : str ) -> Optional [UserCurrentTeam ]:
155185 """Retrieve the current team for a user."""
186+ pass
156187
157188 @abstractmethod
158189 async def delete_current_team (self , user_id : str ) -> Optional [UserCurrentTeam ]:
159190 """Retrieve the current team for a user."""
191+ pass
160192
161193 @abstractmethod
162194 async def set_current_team (self , current_team : UserCurrentTeam ) -> None :
@@ -165,22 +197,27 @@ async def set_current_team(self, current_team: UserCurrentTeam) -> None:
165197 @abstractmethod
166198 async def update_current_team (self , current_team : UserCurrentTeam ) -> None :
167199 """Update the current team for a user."""
200+ pass
168201
169202 @abstractmethod
170203 async def delete_plan_by_plan_id (self , plan_id : str ) -> bool :
171204 """Retrieve the current team for a user."""
205+ pass
172206
173207 @abstractmethod
174208 async def add_mplan (self , mplan : messages .MPlan ) -> None :
175209 """Add a team configuration to the database."""
210+ pass
176211
177212 @abstractmethod
178213 async def update_mplan (self , mplan : messages .MPlan ) -> None :
179214 """Update a team configuration in the database."""
215+ pass
180216
181217 @abstractmethod
182218 async def get_mplan (self , plan_id : str ) -> Optional [messages .MPlan ]:
183219 """Retrieve a mplan configuration by plan_id."""
220+ pass
184221
185222 @abstractmethod
186223 async def add_agent_message (self , message : AgentMessageData ) -> None :
@@ -189,7 +226,9 @@ async def add_agent_message(self, message: AgentMessageData) -> None:
189226 @abstractmethod
190227 async def update_agent_message (self , message : AgentMessageData ) -> None :
191228 """Update an agent message in the database."""
229+ pass
192230
193231 @abstractmethod
194232 async def get_agent_messages (self , plan_id : str ) -> Optional [AgentMessageData ]:
195233 """Retrieve an agent message by message_id."""
234+ pass
0 commit comments