Skip to content

Commit

Permalink
handle WalletGetWithAvailableCredits
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis committed Dec 4, 2024
1 parent b7616e9 commit 050e585
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion services/api-server/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7052,7 +7052,8 @@
"title": "Modified"
},
"availableCredits": {
"type": "string",
"type": "number",
"minimum": 0.0,
"title": "Availablecredits"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from fastapi.responses import RedirectResponse
from fastapi_pagination.api import create_page
from models_library.api_schemas_webserver.projects import ProjectGet
from models_library.api_schemas_webserver.wallets import WalletGetWithAvailableCredits
from models_library.projects_nodes_io import BaseFileLink
from models_library.users import UserID
from models_library.wallets import ZERO_CREDITS
Expand All @@ -24,7 +23,10 @@
from ...exceptions.service_errors_utils import DEFAULT_BACKEND_SERVICE_STATUS_CODES
from ...models.basic_types import LogStreamingResponse, VersionStr
from ...models.pagination import Page, PaginationParams
from ...models.schemas.backwards_compatibility import PricingUnitGet
from ...models.schemas.backwards_compatibility import (
PricingUnitGet,
WalletGetWithAvailableCredits,
)
from ...models.schemas.errors import ErrorGet
from ...models.schemas.files import File
from ...models.schemas.jobs import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from typing import Annotated, Any

from fastapi import APIRouter, Depends, status
from models_library.api_schemas_webserver.wallets import WalletGetWithAvailableCredits

from ...exceptions.service_errors_utils import DEFAULT_BACKEND_SERVICE_STATUS_CODES
from ...models.schemas.backwards_compatibility import WalletGetWithAvailableCredits
from ...models.schemas.errors import ErrorGet
from ..dependencies.webserver import AuthSession, get_webserver_session
from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
ProjectInputUpdate,
)
from models_library.api_schemas_webserver.resource_usage import PricingPlanGet
from models_library.api_schemas_webserver.wallets import (
WalletGet,
WalletGetWithAvailableCredits,
)
from models_library.api_schemas_webserver.wallets import WalletGet
from models_library.generics import Envelope
from models_library.projects import ProjectID
from models_library.projects_nodes_io import NodeID
Expand Down Expand Up @@ -77,7 +74,10 @@
)
from ..models.basic_types import VersionStr
from ..models.pagination import MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE
from ..models.schemas.backwards_compatibility import PricingUnitGet
from ..models.schemas.backwards_compatibility import (
PricingUnitGet,
WalletGetWithAvailableCredits,
)
from ..models.schemas.jobs import MetaValueType
from ..models.schemas.profiles import Profile, ProfileUpdate
from ..models.schemas.solvers import SolverKeyId
Expand Down
4 changes: 3 additions & 1 deletion services/api-server/tests/unit/_with_db/test_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
from fastapi import status
from fastapi.encoders import jsonable_encoder
from models_library.api_schemas_api_server.api_keys import ApiKeyInDB
from models_library.api_schemas_webserver.wallets import WalletGetWithAvailableCredits
from models_library.generics import Envelope
from models_library.users import UserID
from models_library.wallets import WalletStatus
from pydantic import PositiveInt
from simcore_service_api_server._meta import API_VTAG
from simcore_service_api_server.models.schemas.backwards_compatibility import (
WalletGetWithAvailableCredits,
)


async def test_product_webserver(
Expand Down
2 changes: 1 addition & 1 deletion services/api-server/tests/unit/test_api_solver_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from fastapi import status
from fastapi.encoders import jsonable_encoder
from httpx import AsyncClient
from models_library.api_schemas_webserver.wallets import WalletGetWithAvailableCredits
from models_library.generics import Envelope
from pydantic import TypeAdapter
from pytest_simcore.helpers.httpx_calls_capture_models import (
Expand All @@ -25,6 +24,7 @@
from simcore_service_api_server._meta import API_VTAG
from simcore_service_api_server.models.schemas.backwards_compatibility import (
PricingUnitGet,
WalletGetWithAvailableCredits,
)
from simcore_service_api_server.models.schemas.jobs import Job, JobStatus
from simcore_service_api_server.models.schemas.solvers import Solver
Expand Down
4 changes: 3 additions & 1 deletion services/api-server/tests/unit/test_api_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import pytest
from fastapi import status
from httpx import AsyncClient
from models_library.api_schemas_webserver.wallets import WalletGetWithAvailableCredits
from pytest_simcore.helpers.httpx_calls_capture_models import (
CreateRespxMockCallback,
HttpApiCallCaptureModel,
)
from simcore_service_api_server._meta import API_VTAG
from simcore_service_api_server.models.schemas.backwards_compatibility import (
WalletGetWithAvailableCredits,
)


@pytest.mark.parametrize(
Expand Down

0 comments on commit 050e585

Please sign in to comment.