feat(opus): add coef subcards

This commit is contained in:
2026-05-15 03:24:07 +02:00
parent 779393106d
commit f774ff3340
4 changed files with 123 additions and 74 deletions
+19
View File
@@ -132,10 +132,19 @@ class ValidationIn(Schema):
# Collection Schemas
class PuzzlePointsFactorOut(Schema):
"""Schema for puzzle points factor output"""
cost: int
cycles: int
area: int
class SteamCollectionItemOut(ModelSchema):
"""Schema for Steam collection item output"""
steam_url: str
points_factor: Optional[PuzzlePointsFactorOut] = None
class Meta:
model = SteamCollectionItem
@@ -151,6 +160,16 @@ class SteamCollectionItemOut(ModelSchema):
"updated_at",
]
@staticmethod
def resolve_points_factor(obj) -> Optional[PuzzlePointsFactorOut]:
if obj.points_factor:
return PuzzlePointsFactorOut(
cost=obj.points_factor.cost,
cycles=obj.points_factor.cycles,
area=obj.points_factor.area,
)
return None
# Error Schemas
class ErrorOut(Schema):