Files
orion/app/modules/catalog/schemas/catalog.py
Samir Boulahtit 481deaa67d refactor: fix all 177 architecture validator warnings
- Replace 153 broad `except Exception` with specific types (SQLAlchemyError,
  TemplateError, OSError, SMTPException, ClientError, etc.) across 37 services
- Break catalog↔inventory circular dependency (IMPORT-004)
- Create 19 skeleton test files for MOD-024 coverage
- Exclude aggregator services from MOD-024 (false positives)
- Update test mocks to match narrowed exception types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 11:59:44 +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 # noqa: IMPORT-002
from app.modules.marketplace.schemas import MarketplaceProductResponse # IMPORT-002
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