Files
orion/app/modules/catalog/schemas/catalog.py
Samir Boulahtit f20266167d
Some checks failed
CI / ruff (push) Failing after 7s
CI / pytest (push) Failing after 1s
CI / architecture (push) Failing after 9s
CI / dependency-scanning (push) Successful in 27s
CI / audit (push) Successful in 8s
CI / docs (push) Has been skipped
fix(lint): auto-fix ruff violations and tune lint rules
- Auto-fixed 4,496 lint issues (import sorting, modern syntax, etc.)
- Added ignore rules for patterns intentional in this codebase:
  E402 (late imports), E712 (SQLAlchemy filters), B904 (raise from),
  SIM108/SIM105/SIM117 (readability preferences)
- Added per-file ignores for tests and scripts
- Excluded broken scripts/rename_terminology.py (has curly quotes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:10:42 +01:00

57 lines
1.4 KiB
Python

# app/modules/catalog/schemas/catalog.py
"""
Pydantic schemas for catalog browsing operations.
These schemas are for the public storefront catalog API.
For store product management, see the products module.
"""
from datetime import datetime
from pydantic import BaseModel, ConfigDict
from app.modules.inventory.schemas import InventoryLocationResponse
from app.modules.marketplace.schemas import MarketplaceProductResponse
class ProductResponse(BaseModel):
"""Response model for a product in the catalog."""
model_config = ConfigDict(from_attributes=True)
id: int
store_id: int
marketplace_product: MarketplaceProductResponse
store_sku: str | None
price: float | None
sale_price: float | None
currency: str | None
availability: str | None
condition: str | None
is_featured: bool
is_active: bool
display_order: int
min_quantity: int
max_quantity: int | None
created_at: datetime
updated_at: datetime
# Include inventory summary
total_inventory: int | None = None
available_inventory: int | None = None
class ProductDetailResponse(ProductResponse):
"""Product with full inventory details."""
inventory_locations: list[InventoryLocationResponse] = []
class ProductListResponse(BaseModel):
"""Paginated list of products."""
products: list[ProductResponse]
total: int
skip: int
limit: int