from typing import List, Optional from pydantic import BaseModel from datetime import datetime class CartItemCreate(BaseModel): product_id: str product_name: str price: float quantity: int class CartItemResponse(BaseModel): id: int product_id: str product_name: str price: float quantity: int class Config: from_attributes = True class CartCreate(BaseModel): user_id: str class CartResponse(BaseModel): id: int user_id: Optional[str] status: str created_at: datetime updated_at: datetime items: List[CartItemResponse] = [] total: Optional[float] = None class Config: from_attributes = True class CheckoutRequest(BaseModel): cart_id: int payment_method: str billing_address: dict class CheckoutResponse(BaseModel): success: bool order_id: Optional[str] = None total_amount: float message: str