Skip to content

Commit beae0ba

Browse files
Adds Fogbugz support fields to product model
Introduces new fields for assigning Fogbugz person and project IDs to products, enabling better tracking and integration of support cases. Updates database schema, model, repository, and API example accordingly.
1 parent 01ae1eb commit beae0ba

File tree

5 files changed

+56
-30
lines changed

5 files changed

+56
-30
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""add support fogbugz fields
2+
3+
Revision ID: ec4f62595e0c
4+
Revises: b566f1b29012
5+
Create Date: 2025-08-26 13:06:10.879081+00:00
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from alembic import op
11+
12+
# revision identifiers, used by Alembic.
13+
revision = "ec4f62595e0c"
14+
down_revision = "b566f1b29012"
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.add_column(
22+
"products",
23+
sa.Column("support_assigned_fogbugz_person_id", sa.BigInteger(), nullable=True),
24+
)
25+
op.add_column(
26+
"products",
27+
sa.Column(
28+
"support_assigned_fogbugz_project_id", sa.BigInteger(), nullable=True
29+
),
30+
)
31+
# ### end Alembic commands ###
32+
33+
34+
def downgrade():
35+
# ### commands auto generated by Alembic - please adjust! ###
36+
op.drop_column("products", "support_assigned_fogbugz_project_id")
37+
op.drop_column("products", "support_assigned_fogbugz_person_id")
38+
# ### end Alembic commands ###

packages/postgres-database/src/simcore_postgres_database/models/products.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,5 +282,19 @@ class ProductLoginSettingsDict(TypedDict, total=False):
282282
nullable=True,
283283
doc="Group associated to this product support",
284284
),
285+
sa.Column(
286+
"support_assigned_fogbugz_person_id",
287+
sa.BigInteger,
288+
unique=False,
289+
nullable=True,
290+
doc="Fogbugz person ID to assign support case",
291+
),
292+
sa.Column(
293+
"support_assigned_fogbugz_project_id",
294+
sa.BigInteger,
295+
unique=False,
296+
nullable=True,
297+
doc="Fogbugz project ID to assign support case",
298+
),
285299
sa.PrimaryKeyConstraint("name", name="products_pk"),
286300
)

services/web/server/src/simcore_service_webserver/products/_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
297297
},
298298
"group_id": 12345,
299299
"support_standard_group_id": 67890,
300+
"support_assigned_fogbugz_person_id": 112,
301+
"support_assigned_fogbugz_project_id": 72,
300302
"is_payment_enabled": False,
301303
},
302304
]

services/web/server/src/simcore_service_webserver/products/_repository.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
products.c.max_open_studies_per_user,
5555
products.c.group_id,
5656
products.c.support_standard_group_id,
57+
products.c.support_assigned_fogbugz_person_id,
58+
products.c.support_assigned_fogbugz_project_id,
5759
]
5860

5961
assert {column.name for column in _PRODUCTS_COLUMNS}.issubset( # nosec

services/web/server/tests/unit/with_dbs/04/test_fogbugz_client.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,17 @@
33
from pytest_mock import MockerFixture
44
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
55
from pytest_simcore.helpers.typing_env import EnvVarsDict
6-
from servicelib.aiohttp import status
76
from simcore_service_webserver.fogbugz._client import (
87
FogbugzCaseCreate,
98
get_fogbugz_rest_client,
109
)
1110
from simcore_service_webserver.fogbugz.settings import FogbugzSettings
1211

13-
# @pytest.fixture(scope="session")
14-
# def fake_api_base_url() -> str:
15-
# return "https://testserver-itis-vip.xyz"
16-
17-
18-
# @pytest.fixture
19-
# def mock_fogbugz_api(
20-
# faker: Faker, fake_api_base_url: str
21-
# ) -> Iterator[respx.MockRouter]:
22-
# response_data = {
23-
# "msg": 0,
24-
# "availableDownloads": [
25-
# random_itis_vip_available_download_item(
26-
# identifier=i,
27-
# features_functionality="Posable",
28-
# fake=faker,
29-
# )
30-
# for i in range(8)
31-
# ],
32-
# }
33-
34-
# with respx.mock(base_url=fake_api_base_url) as mock:
35-
# mock.post(path__regex=r"/getDownloadableItems/(?P<category>\w+)").respond(
36-
# status_code=200, json=response_data
37-
# )
38-
# yield mock
39-
4012

4113
@pytest.fixture
4214
def app_environment(
4315
monkeypatch: pytest.MonkeyPatch,
4416
app_environment: EnvVarsDict,
45-
# fake_api_base_url: str,
4617
mocker: MockerFixture,
4718
):
4819
return app_environment | setenvs_from_dict(
@@ -56,7 +27,6 @@ def app_environment(
5627

5728
async def test_testit(
5829
app_environment: EnvVarsDict,
59-
# mock_fogbugz_api: respx.MockRouter,
6030
client: TestClient,
6131
):
6232
assert client.app

0 commit comments

Comments
 (0)