Restructure into full project layout
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel
|
||||
from app.models.deck import DeckMode, CardSlot
|
||||
|
||||
|
||||
class DeckConstraints(BaseModel):
|
||||
prefer_owned: bool = False
|
||||
budget_enabled: bool = False
|
||||
budget_amount: float | None = None
|
||||
budget_scope: str = "purchase"
|
||||
|
||||
|
||||
class ExistingCard(BaseModel):
|
||||
card_name: str
|
||||
slot: str | None = None
|
||||
quantity: int = 1
|
||||
|
||||
|
||||
class GenerateRequest(BaseModel):
|
||||
commander: str
|
||||
playstyle: str | None = None
|
||||
name: str | None = None
|
||||
description: str | None = None
|
||||
constraints: DeckConstraints = DeckConstraints()
|
||||
|
||||
|
||||
class CompleteRequest(BaseModel):
|
||||
commander: str
|
||||
playstyle: str | None = None
|
||||
name: str | None = None
|
||||
existing_cards: list[ExistingCard]
|
||||
constraints: DeckConstraints = DeckConstraints()
|
||||
|
||||
|
||||
class CullRequest(BaseModel):
|
||||
commander: str
|
||||
name: str | None = None
|
||||
existing_cards: list[ExistingCard]
|
||||
target_count: int = 99
|
||||
constraints: DeckConstraints = DeckConstraints()
|
||||
|
||||
|
||||
class DeckCardOut(BaseModel):
|
||||
id: int
|
||||
deck_id: int
|
||||
card_name: str
|
||||
slot: CardSlot
|
||||
quantity: int
|
||||
is_owned: bool
|
||||
is_commander: bool
|
||||
ai_reasoning: str | None
|
||||
scryfall_id: str
|
||||
scryfall_data: dict | None
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class DeckOut(BaseModel):
|
||||
id: int
|
||||
owner_id: int
|
||||
name: str
|
||||
commander: str
|
||||
description: str | None
|
||||
mode: DeckMode
|
||||
playstyle: str | None
|
||||
prefer_owned: bool
|
||||
budget_enabled: bool
|
||||
budget_amount: float | None
|
||||
budget_scope: str
|
||||
ai_reasoning: dict | None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
cards: list[DeckCardOut] = []
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class DeckSummaryOut(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
commander: str
|
||||
mode: DeckMode
|
||||
playstyle: str | None
|
||||
created_at: datetime
|
||||
card_count: int | None = None
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
Reference in New Issue
Block a user