Skip to content

Commit 856146d

Browse files
committed
updates fakes in api-server
1 parent c88e650 commit 856146d

File tree

13 files changed

+21
-15
lines changed

13 files changed

+21
-15
lines changed

packages/models-library/src/models_library/api_schemas_webserver/workspaces.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
from datetime import datetime
2-
from typing import Self
2+
from typing import Annotated, Self
33

4-
from pydantic import ConfigDict
4+
from pydantic import ConfigDict, Field
55

66
from ..access_rights import AccessRights
77
from ..basic_types import IDStr
88
from ..groups import GroupID
9-
from ..users import UserID
109
from ..workspaces import UserWorkspaceWithAccessRights, WorkspaceID
1110
from ._base import InputSchema, OutputSchema
1211

@@ -19,7 +18,9 @@ class WorkspaceGet(OutputSchema):
1918
created_at: datetime
2019
modified_at: datetime
2120
trashed_at: datetime | None
22-
trashed_by: UserID | None
21+
trashed_by: Annotated[
22+
GroupID | None, Field(description="The primary gid of the user who trashed")
23+
]
2324
my_access_rights: AccessRights
2425
access_rights: dict[GroupID, AccessRights]
2526

@@ -33,7 +34,7 @@ def from_domain_model(cls, wks: UserWorkspaceWithAccessRights) -> Self:
3334
created_at=wks.created,
3435
modified_at=wks.modified,
3536
trashed_at=wks.trashed,
36-
trashed_by=wks.trashed_by if wks.trashed else None,
37+
trashed_by=wks.trashed_by_primary_gid if wks.trashed else None,
3738
my_access_rights=wks.my_access_rights,
3839
access_rights=wks.access_rights,
3940
)

services/api-server/tests/mocks/create_study_job.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"workspaceId": 23,
8686
"folderId": 4,
8787
"trashedAt": "2024-05-14T09:55:20.099Z",
88+
"trashedBy": 2,
8889
"accessRights": {
8990
"3": {
9091
"read": true,

services/api-server/tests/mocks/for_test_api_routes_studies.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"workspaceId": 278,
9393
"folderId": 123,
9494
"trashedAt": "2023-07-20T20:02:55.535Z",
95+
"trashedBy": 2,
9596
"workbench": {
9697
"deea006c-a223-4103-b46e-7b677428de9f": {
9798
"key": "simcore/services/frontend/file-picker",
@@ -314,6 +315,7 @@
314315
"workspaceId": 278,
315316
"folderId": 123,
316317
"trashedAt": "2023-07-20T20:04:10.607Z",
318+
"trashedBy": 2,
317319
"workbench": {
318320
"deea006c-a223-4103-b46e-7b677428de9f": {
319321
"key": "simcore/services/frontend/file-picker",

services/api-server/tests/mocks/get_job_pricing_unit_invalid_solver.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"workspaceId": 3,
4040
"folderId": 31,
4141
"trashedAt": null,
42+
"trashedBy": null,
4243
"workbench": {
4344
"4b03863d-107a-5c77-a3ca-c5ba1d7048c0": {
4445
"key": "simcore/services/comp/isolve",

services/api-server/tests/mocks/get_job_pricing_unit_success.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"workspaceId": 3,
4040
"folderId": 1,
4141
"trashedAt": null,
42+
"trashedBy": null,
4243
"workbench": {
4344
"4b03863d-107a-5c77-a3ca-c5ba1d7048c0": {
4445
"key": "simcore/services/comp/isolve",

services/api-server/tests/mocks/get_solver_outputs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"workspaceId": 2,
4040
"folderId": 2,
4141
"trashedAt": null,
42+
"trashedBy": null,
4243
"workbench": {
4344
"df42d273-b6f0-509c-bfb5-4abbc5bb0581": {
4445
"key": "simcore/services/comp/itis/sleeper",

services/api-server/tests/mocks/on_list_jobs.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
"workspaceId": 7,
105105
"folderId": 1,
106106
"trashedAt": "2023-06-22T18:42:36.506Z",
107+
"trashedBy": 2,
107108
"workbench": {
108109
"05c7ed3b-0be1-5077-8065-fb55f5e59ff3": {
109110
"key": "simcore/services/comp/itis/sleeper",
@@ -177,6 +178,7 @@
177178
"workspaceId": 4,
178179
"folderId": 8,
179180
"trashedAt": "2023-06-22T18:42:33.201Z",
181+
"trashedBy": 2,
180182
"workbench": {
181183
"34805d7e-c2d0-561f-831f-c74a28fc9bd1": {
182184
"key": "simcore/services/comp/itis/sleeper",

services/api-server/tests/mocks/run_study_workflow.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@
304304
"workspaceId": 3,
305305
"folderId": 3,
306306
"trashedAt": null,
307+
"trashedBy": null,
307308
"workbench": {
308309
"ab014072-a95f-5775-bb34-5582a13245a6": {
309310
"key": "simcore/services/frontend/iterator-consumer/probe/file",

services/api-server/tests/mocks/start_job_not_enough_credit.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"workspaceId": 3,
4040
"folderId": 2,
4141
"trashedAt": null,
42+
"trashedBy": null,
4243
"workbench": {
4344
"3b0b20e0-c860-51d9-9f82-d6b4bc5c2f24": {
4445
"key": "simcore/services/comp/itis/sleeper",

services/api-server/tests/mocks/start_job_with_payment.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"workspaceId": 12,
4040
"folderId": 2,
4141
"trashedAt": null,
42+
"trashedBy": null,
4243
"workbench": {
4344
"657b124c-0697-5166-b820-a2ea2704ae84": {
4445
"key": "simcore/services/comp/itis/sleeper",

0 commit comments

Comments
 (0)