Skip to content

Commit 13a852d

Browse files
author
Sergio García Prado
committed
ISSUE #99
* Add docstring.
1 parent f656e92 commit 13a852d

File tree

5 files changed

+38
-12
lines changed

5 files changed

+38
-12
lines changed

packages/core/minos-microservice-saga/minos/saga/executions/repositories/abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
class SagaExecutionRepository(SetupMixin, ABC):
22-
"""TODO"""
22+
"""Saga Execution Repository class."""
2323

2424
async def store(self, execution: SagaExecution) -> None:
2525
"""Store an execution.

packages/core/minos-microservice-saga/minos/saga/executions/repositories/database/factories.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,32 @@
1313

1414

1515
class SagaExecutionDatabaseOperationFactory(DatabaseOperationFactory, ABC):
16-
"""TODO"""
16+
"""Saga Execution Database Operation Factory class."""
1717

1818
@abstractmethod
1919
def build_store(self, uuid: UUID, **kwargs) -> DatabaseOperation:
20-
"""TODO"""
20+
"""Build the database operation to store a saga execution.
21+
22+
:param uuid: The identifier of the saga execution.
23+
:param kwargs: The attributes of the saga execution.
24+
:return: A ``DatabaseOperation`` instance.
25+
"""
2126
raise NotImplementedError
2227

2328
@abstractmethod
2429
def build_load(self, uuid: UUID) -> DatabaseOperation:
25-
"""TODO"""
30+
"""Build the database operation to load a saga execution.
31+
32+
:param uuid: The identifier of the saga execution.
33+
:return: A ``DatabaseOperation`` instance.
34+
"""
2635
raise NotImplementedError
2736

2837
@abstractmethod
2938
def build_delete(self, uuid: UUID) -> DatabaseOperation:
30-
"""TODO"""
39+
"""Build the database operation to delete a saga execution.
40+
41+
:param uuid: The identifier of the saga execution.
42+
:return: A ``DatabaseOperation`` instance.
43+
"""
3144
raise NotImplementedError

packages/plugins/minos-database-lmdb/minos/plugins/lmdb/clients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
class LmdbDatabaseClient(DatabaseClient):
32-
"""TODO"""
32+
"""Lmdb Database Client class."""
3333

3434
_environment: Optional[Environment]
3535

packages/plugins/minos-database-lmdb/minos/plugins/lmdb/factories/saga/executions.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
class LmdbSagaExecutionDatabaseOperationFactory(SagaExecutionDatabaseOperationFactory):
22-
"""TODO"""
22+
"""Lmdb Saga Execution Database Operation Factory class."""
2323

2424
# noinspection PyMethodMayBeStatic
2525
def build_table_name(self) -> str:
@@ -30,19 +30,32 @@ def build_table_name(self) -> str:
3030
return "LocalState"
3131

3232
def build_store(self, uuid: UUID, **kwargs) -> DatabaseOperation:
33-
"""TODO"""
33+
"""Build the database operation to store a saga execution.
34+
35+
:param uuid: The identifier of the saga execution.
36+
:param kwargs: The attributes of the saga execution.
37+
:return: A ``DatabaseOperation`` instance.
38+
"""
3439
key = str(uuid)
3540
value = kwargs | {"uuid": str(uuid)}
3641

3742
return LmdbDatabaseOperation(LmdbDatabaseOperationType.CREATE, self.build_table_name(), key, value)
3843

3944
def build_load(self, uuid: UUID) -> DatabaseOperation:
40-
"""TODO"""
45+
"""Build the database operation to load a saga execution.
46+
47+
:param uuid: The identifier of the saga execution.
48+
:return: A ``DatabaseOperation`` instance.
49+
"""
4150
key = str(uuid)
4251
return LmdbDatabaseOperation(LmdbDatabaseOperationType.READ, self.build_table_name(), key)
4352

4453
def build_delete(self, uuid: UUID) -> DatabaseOperation:
45-
"""TODO"""
54+
"""Build the database operation to delete a saga execution.
55+
56+
:param uuid: The identifier of the saga execution.
57+
:return: A ``DatabaseOperation`` instance.
58+
"""
4659
key = str(uuid)
4760
return LmdbDatabaseOperation(LmdbDatabaseOperationType.DELETE, self.build_table_name(), key)
4861

packages/plugins/minos-database-lmdb/minos/plugins/lmdb/operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class LmdbDatabaseOperationType(str, Enum):
15-
"""TODO"""
15+
"""Lmdb Database Operation Type class."""
1616

1717
CREATE = "create"
1818
READ = "read"
@@ -21,7 +21,7 @@ class LmdbDatabaseOperationType(str, Enum):
2121

2222

2323
class LmdbDatabaseOperation(DatabaseOperation):
24-
"""TODO"""
24+
"""Lmdb Database Operation class."""
2525

2626
def __init__(
2727
self, type_: LmdbDatabaseOperationType, table: str, key: str, value: Optional[Any] = None, *args, **kwargs

0 commit comments

Comments
 (0)