This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
decisions: added to endpoint to resolve
- Loading branch information
Showing
4 changed files
with
52 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
workflows/plugins/hooks/backoffice/decision_management_hook.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from hooks.backoffice.base import BackofficeHook | ||
from requests import Response | ||
|
||
|
||
class WorkflowTicketManagementHook(BackofficeHook): | ||
""" | ||
A hook to update the status of a workflow in the backoffice system. | ||
:param method: The HTTP method to use for the request (default: "GET"). | ||
:type method: str | ||
:param http_conn_id: The ID of the HTTP connection to use ( | ||
default: "backoffice_conn"). | ||
:type http_conn_id: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
method: str = "GET", | ||
http_conn_id: str = "backoffice_conn", | ||
headers: dict = None, | ||
) -> None: | ||
super().__init__(method, http_conn_id, headers) | ||
self.endpoint = "api/decision/" | ||
|
||
def create_decision_entry( | ||
self, workflow_id: str, user_id: str, action: str | ||
) -> Response: | ||
data = { | ||
"user_id": user_id, | ||
"action": action, | ||
"workflow_id": workflow_id, | ||
} | ||
return self.run_with_advanced_retry( | ||
_retry_args=self.tenacity_retry_kwargs, | ||
method="POST", | ||
data=data, | ||
endpoint=self.endpoint, | ||
) |
Empty file.
This file was deleted.
Oops, something went wrong.