-
Notifications
You must be signed in to change notification settings - Fork 29
♻️✨ refactoring of pricing plans (🗃️) #4812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pcrespov
merged 20 commits into
ITISFoundation:master
from
matusdrobuliak66:is1133/create-api-for-creation-of-pricing-plan
Oct 2, 2023
Merged
Changes from 10 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
c234010
refactoring of pricing plans + extention of APIs
matusdrobuliak66 1618c75
removing comments
matusdrobuliak66 7bedc32
removing comments
matusdrobuliak66 54bf8e0
removing comments
matusdrobuliak66 6007541
fix typos
matusdrobuliak66 6f7be19
fix mypy
matusdrobuliak66 8b57d25
fix
matusdrobuliak66 8c2bf12
fix
matusdrobuliak66 d70ad30
fix path
matusdrobuliak66 486c53d
review @GitHK
matusdrobuliak66 cfff169
reverting changes in application.py
matusdrobuliak66 e87a1ec
review @prespov
matusdrobuliak66 b73dbef
Merge branch 'master' into is1133/create-api-for-creation-of-pricing-…
matusdrobuliak66 2adf0b6
final cleanup
matusdrobuliak66 1f0eb45
Merge branch 'master' into is1133/create-api-for-creation-of-pricing-…
matusdrobuliak66 0d70ebe
minor refactor
matusdrobuliak66 b5fed14
Merge branch 'is1133/create-api-for-creation-of-pricing-plan' of gith…
matusdrobuliak66 42e0574
Merge branch 'master' into is1133/create-api-for-creation-of-pricing-…
matusdrobuliak66 a2ddfdf
resolve merge conflicts
matusdrobuliak66 b4b78f0
Merge branch 'master' into is1133/create-api-for-creation-of-pricing-…
matusdrobuliak66 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ges/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from datetime import datetime | ||
from decimal import Decimal | ||
|
||
from models_library.resource_tracker import ( | ||
PricingPlanClassification, | ||
PricingPlanId, | ||
PricingUnitCostId, | ||
PricingUnitId, | ||
) | ||
from pydantic import BaseModel | ||
|
||
|
||
class PricingUnitGet(BaseModel): | ||
pricing_unit_id: PricingUnitId | ||
unit_name: str | ||
current_cost_per_unit: Decimal | ||
current_cost_per_unit_id: PricingUnitCostId | ||
default: bool | ||
specific_info: dict | ||
|
||
|
||
class ServicePricingPlanGet(BaseModel): | ||
pricing_plan_id: PricingPlanId | ||
display_name: str | ||
description: str | ||
classification: PricingPlanClassification | ||
created_at: datetime | ||
pricing_plan_key: str | ||
pricing_units: list[PricingUnitGet] |
35 changes: 35 additions & 0 deletions
35
...ages/models-library/src/models_library/api_schemas_resource_usage_tracker/service_runs.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from datetime import datetime | ||
from decimal import Decimal | ||
|
||
from models_library.projects import ProjectID | ||
from models_library.projects_nodes_io import NodeID | ||
from models_library.resource_tracker import ( | ||
CreditTransactionStatus, | ||
ServiceRunId, | ||
ServiceRunStatus, | ||
) | ||
from models_library.services import ServiceKey, ServiceVersion | ||
from models_library.users import UserID | ||
from models_library.wallets import WalletID | ||
from pydantic import BaseModel | ||
|
||
|
||
class ServiceRunGet(BaseModel): | ||
service_run_id: ServiceRunId | ||
wallet_id: WalletID | None | ||
wallet_name: str | None | ||
user_id: UserID | ||
project_id: ProjectID | ||
project_name: str | ||
node_id: NodeID | ||
node_name: str | ||
service_key: ServiceKey | ||
service_version: ServiceVersion | ||
service_type: str | ||
service_resources: dict | ||
started_at: datetime | ||
stopped_at: datetime | None | ||
service_run_status: ServiceRunStatus | ||
# Cost in credits | ||
credit_cost: Decimal | None | ||
transaction_status: CreditTransactionStatus | None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ class CreateServiceMetricsAdditionalParams(BaseModel): | |
wallet_id: WalletID | None | ||
wallet_name: str | None | ||
pricing_plan_id: int | None | ||
pricing_detail_id: int | None | ||
pricing_unit_id: int | None | ||
pricing_unit_cost_id: int | None | ||
product_name: str | ||
simcore_user_agent: str | ||
user_email: str | ||
|
@@ -28,7 +29,8 @@ class Config: | |
"wallet_id": 1, | ||
"wallet_name": "a private wallet for me", | ||
"pricing_plan_id": 1, | ||
"pricing_detail_id": 1, | ||
"pricing_unit_id": 1, | ||
"pricing_unit_detail_id": 1, | ||
"product_name": "osparc", | ||
"simcore_user_agent": "undefined", | ||
"user_email": "[email protected]", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.