Automated Action d2b80dacc4 Implement Shopping Cart and Checkout API
- Set up FastAPI application structure
- Create database models for User, Product, Cart, CartItem, Order, and OrderItem
- Set up Alembic for database migrations
- Create Pydantic schemas for request/response models
- Implement API endpoints for products, cart operations, and checkout process
- Add health endpoint
- Update README with project details and documentation
2025-05-18 00:00:02 +00:00

16 lines
480 B
Python

from datetime import datetime
from pydantic import BaseModel, ConfigDict
class BaseSchema(BaseModel):
"""Base Pydantic schema with common configurations."""
model_config = ConfigDict(
from_attributes=True, # Allow ORM model -> Pydantic model
populate_by_name=True # Allow populating by attribute name
)
class TimestampSchema(BaseSchema):
"""Mixin for schemas that include timestamp fields."""
created_at: datetime
updated_at: datetime