Migrate remaining legacy schemas to their respective modules: Marketplace module (app/modules/marketplace/schemas/): - letzshop.py: Letzshop credentials, orders, fulfillment, sync - onboarding.py: Vendor onboarding wizard schemas Catalog module (app/modules/catalog/schemas/): - product.py: ProductCreate, ProductUpdate, ProductResponse Payments module (app/modules/payments/schemas/): - payment.py: PaymentConfig, Stripe, transactions, balance Delete legacy files: - models/schema/letzshop.py - models/schema/onboarding.py - models/schema/product.py - models/schema/payment.py - models/schema/marketplace_product.py (re-export) - models/schema/marketplace_import_job.py (re-export) - models/schema/search.py (empty) Update imports across 19 files to use canonical locations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
57 lines
1.4 KiB
Python
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 vendor product management, see the products module.
|
|
"""
|
|
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
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
|
|
vendor_id: int
|
|
marketplace_product: MarketplaceProductResponse
|
|
vendor_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
|