Skip to content

Commit 84cbd39

Browse files
SpliiTgithub-actions[bot]
authored andcommitted
Apply prepare changes
1 parent ad9c5f0 commit 84cbd39

File tree

6 files changed

+77
-55
lines changed

6 files changed

+77
-55
lines changed

opengeodeweb_back_schemas.json

Lines changed: 57 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,63 @@
11
{
22
"opengeodeweb_back": {
33
"create": {
4+
"create_voi": {
5+
"$id": "opengeodeweb_back/create/create_voi",
6+
"route": "/create_voi",
7+
"methods": [
8+
"POST"
9+
],
10+
"type": "object",
11+
"properties": {
12+
"name": {
13+
"type": "string",
14+
"description": "Name of the VOI"
15+
},
16+
"aoi_id": {
17+
"type": "string",
18+
"description": "ID of the corresponding AOI"
19+
},
20+
"min_x": {
21+
"type": "number",
22+
"description": "Minimum X coordinate from AOI"
23+
},
24+
"min_y": {
25+
"type": "number",
26+
"description": "Minimum Y coordinate from AOI"
27+
},
28+
"max_x": {
29+
"type": "number",
30+
"description": "Maximum X coordinate from AOI"
31+
},
32+
"max_y": {
33+
"type": "number",
34+
"description": "Maximum Y coordinate from AOI"
35+
},
36+
"z_min": {
37+
"type": "number",
38+
"description": "Minimum Z coordinate"
39+
},
40+
"z_max": {
41+
"type": "number",
42+
"description": "Maximum Z coordinate"
43+
},
44+
"id": {
45+
"type": "string",
46+
"description": "Optional ID for updating existing VOI"
47+
}
48+
},
49+
"required": [
50+
"name",
51+
"aoi_id",
52+
"min_x",
53+
"min_y",
54+
"max_x",
55+
"max_y",
56+
"z_min",
57+
"z_max"
58+
],
59+
"additionalProperties": false
60+
},
461
"create_point": {
562
"$id": "opengeodeweb_back/create/create_point",
663
"route": "/create_point",
@@ -77,42 +134,6 @@
77134
"z"
78135
],
79136
"additionalProperties": false
80-
},
81-
"create_voi": {
82-
"$id": "opengeodeweb_back/create/create_voi",
83-
"route": "/create_voi",
84-
"methods": [
85-
"POST"
86-
],
87-
"type": "object",
88-
"properties": {
89-
"name": {
90-
"type": "string",
91-
"description": "Name of the VOI"
92-
},
93-
"aoi_id": {
94-
"type": "string",
95-
"description": "ID of the corresponding AOI from which to take X and Y coordinates"
96-
},
97-
"z_min": {
98-
"type": "number",
99-
"description": "Minimum Z coordinate for the VOI"
100-
},
101-
"z_max": {
102-
"type": "number",
103-
"description": "Maximum Z coordinate for the VOI"
104-
},
105-
"id": {
106-
"type": "string"
107-
}
108-
},
109-
"required": [
110-
"name",
111-
"aoi_id",
112-
"z_min",
113-
"z_max"
114-
],
115-
"additionalProperties": false
116137
}
117138
},
118139
"models": {

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ werkzeug==3.1.2
6060
# flask
6161
# flask-cors
6262

63-
opengeodeweb-microservice==1.*,>=1.0.6rc1

src/opengeodeweb_back/routes/create/blueprint_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ def create_voi() -> flask.Response:
131131
geode_object="EdgedCurve3D",
132132
data=edged_curve,
133133
)
134-
return flask.make_response(result, 200)
134+
return flask.make_response(result, 200)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
from .create_voi import *
12
from .create_point import *
23
from .create_aoi import *
3-
from .create_voi import *

src/opengeodeweb_back/routes/create/schemas/create_voi.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
from dataclasses import dataclass
33
from typing import Optional
44

5+
56
@dataclass
67
class CreateVoi(DataClassJsonMixin):
7-
name: str
8-
"""Name of the VOI"""
9-
108
aoi_id: str
119
"""ID of the corresponding AOI"""
1210

11+
max_x: float
12+
"""Maximum X coordinate from AOI"""
13+
14+
max_y: float
15+
"""Maximum Y coordinate from AOI"""
16+
1317
min_x: float
1418
"""Minimum X coordinate from AOI"""
1519

1620
min_y: float
1721
"""Minimum Y coordinate from AOI"""
1822

19-
max_x: float
20-
"""Maximum X coordinate from AOI"""
23+
name: str
24+
"""Name of the VOI"""
2125

22-
max_y: float
23-
"""Maximum Y coordinate from AOI"""
26+
z_max: float
27+
"""Maximum Z coordinate"""
2428

2529
z_min: float
26-
"""Minimum Z coordinate for the VOI"""
27-
28-
z_max: float
29-
"""Maximum Z coordinate for the VOI"""
30+
"""Minimum Z coordinate"""
3031

3132
id: Optional[str] = None
33+
"""Optional ID for updating existing VOI"""

tests/test_create_routes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ def aoi_data() -> Dict[str, Any]:
2929
"z": 0.0,
3030
}
3131

32+
3233
@pytest.fixture
3334
def voi_data() -> Dict[str, Any]:
3435
"""Fixture for Volume of Interest (VOI) test data."""
3536
return {
3637
"name": "test_voi",
37-
"aoi_id": str(uuid.uuid4()),
38+
"aoi_id": str(uuid.uuid4()),
3839
"z_min": -50.0,
3940
"z_max": 100.0,
40-
"id": str(uuid.uuid4()),
41+
"id": str(uuid.uuid4()),
4142
}
4243

4344

@@ -113,9 +114,8 @@ def test_create_voi(client: FlaskClient, voi_data: Dict[str, Any]) -> None:
113114

114115
voi_data_required_only = voi_data.copy()
115116
del voi_data_required_only["id"]
116-
117-
test_utils.test_route_wrong_params(client, route, lambda: voi_data_required_only.copy()) # type: ignore
118117

118+
test_utils.test_route_wrong_params(client, route, lambda: voi_data_required_only.copy()) # type: ignore
119119

120120

121121
def test_create_point_with_invalid_data(client: FlaskClient) -> None:
@@ -183,7 +183,7 @@ def test_create_voi_with_invalid_data(
183183
invalid_data = {**voi_data, "z_max": "not_a_number"}
184184
response = client.post(route, json=invalid_data)
185185
assert response.status_code == 400
186-
186+
187187
# Test with invalid aoi_id format (e.g., not a string/uuid)
188188
invalid_data = {**voi_data, "aoi_id": 12345}
189189
response = client.post(route, json=invalid_data)

0 commit comments

Comments
 (0)