
- 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
16 lines
480 B
Python
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 |