Skip to content

Commit 0264f7c

Browse files
author
Sergio García Prado
committed
ISSUE #51
* Add minimum required attributes.
1 parent c5bf9c6 commit 0264f7c

File tree

2 files changed

+36
-1
lines changed
  • packages/core/minos-microservice-saga/minos/saga/executions

2 files changed

+36
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
ABC,
33
abstractmethod,
44
)
5+
from typing import (
6+
Any,
7+
Optional,
8+
)
59
from uuid import (
610
UUID,
711
)
@@ -23,10 +27,28 @@ def build_create(self) -> DatabaseOperation:
2327
"""
2428

2529
@abstractmethod
26-
def build_store(self, uuid: UUID, **kwargs) -> DatabaseOperation:
30+
def build_store(
31+
self,
32+
uuid: UUID,
33+
definition: dict[str, Any],
34+
status: str,
35+
executed_steps: list[dict[str, Any]],
36+
paused_step: Optional[dict[str, Any]],
37+
context: str,
38+
already_rollback: bool,
39+
user: Optional[UUID],
40+
**kwargs
41+
) -> DatabaseOperation:
2742
"""Build the database operation to store a saga execution.
2843
2944
:param uuid: The identifier of the saga execution.
45+
:param definition: The ``Saga`` definition.
46+
:param context: The execution context.
47+
:param status: The status of the execution.
48+
:param executed_steps: The executed steps of the execution.
49+
:param paused_step: The paused step of the execution.
50+
:param already_rollback: ``True`` if already rollback of ``False`` otherwise.
51+
:param user: The user that launched the execution.
3052
:param kwargs: The attributes of the saga execution.
3153
:return: A ``DatabaseOperation`` instance.
3254
"""

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ def __init__(
7171
*args,
7272
**kwargs,
7373
):
74+
"""Initialize a Saga Execution.
75+
76+
:param definition: The ``Saga`` definition.
77+
:param uuid: The identifier of the execution.
78+
:param context: The execution context.
79+
:param status: The status of the execution.
80+
:param steps: The executed steps of the execution.
81+
:param paused_step: The paused step of the execution.
82+
:param already_rollback: ``True`` if already rollback of ``False`` otherwise.
83+
:param user: The user that launched the execution.
84+
:param args: Additional positional arguments.
85+
:param kwargs: Additional named arguments.
86+
"""
7487
definition.validate() # If not valid, raises an exception.
7588

7689
if steps is None:

0 commit comments

Comments
 (0)