diff --git a/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/documents.py b/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/documents.py index 62e2aa061..862b6e3a2 100644 --- a/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/documents.py +++ b/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/documents.py @@ -31,6 +31,14 @@ class WorkflowDocument(Document): ), } ) + + decisions = fields.NestedField( + properties={ + "action": fields.TextField(), + "user": fields.ObjectField(properties={"email": fields.TextField()}), + } + ) + status = fields.KeywordField() is_update = fields.BooleanField() diff --git a/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/tests/test_views.py b/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/tests/test_views.py index 319d6c94e..b80d8ce72 100644 --- a/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/tests/test_views.py +++ b/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/tests/test_views.py @@ -133,7 +133,7 @@ def test_delete(self): class TestWorkflowSearchViewSet(BaseTransactionTestCase): - endpoint = "/api/workflows/search/" + endpoint = reverse("search:workflow-list") reset_sequences = True fixtures = ["backoffice/fixtures/groups.json"] @@ -169,6 +169,12 @@ def test_list_anonymous(self): self.assertEqual(response.status_code, 403) + def test_contains_decisions(self): + self.api_client.force_authenticate(user=self.admin) + + response = self.api_client.get(self.endpoint) + self.assertIn("decisions", response.json()["results"][0]) + class TestAuthorWorkflowPartialUpdateViewSet(BaseTransactionTestCase): endpoint_base_url = "/api/workflow-update"