-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Check for zero credits (if pricing unit cost is greater than 0) (#5835
- Loading branch information
1 parent
4892c0d
commit 2f6ab0a
Showing
11 changed files
with
171 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
28 changes: 28 additions & 0 deletions
28
services/director-v2/src/simcore_service_director_v2/models/pricing.py
This file contains 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,28 @@ | ||
from decimal import Decimal | ||
from typing import Any, ClassVar | ||
|
||
from models_library.resource_tracker import ( | ||
PricingPlanId, | ||
PricingUnitCostId, | ||
PricingUnitId, | ||
) | ||
from pydantic import BaseModel | ||
|
||
|
||
class PricingInfo(BaseModel): | ||
pricing_plan_id: PricingPlanId | ||
pricing_unit_id: PricingUnitId | ||
pricing_unit_cost_id: PricingUnitCostId | ||
pricing_unit_cost: Decimal | ||
|
||
class Config: | ||
schema_extra: ClassVar[dict[str, Any]] = { | ||
"examples": [ | ||
{ | ||
"pricing_plan_id": 1, | ||
"pricing_unit_id": 1, | ||
"pricing_unit_cost_id": 1, | ||
"pricing_unit_cost": Decimal(10), | ||
} | ||
] | ||
} |
This file contains 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 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 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
Oops, something went wrong.