
- Set up project structure with FastAPI and SQLite - Create models for products and cart items - Implement schemas for API request/response validation - Add database migrations with Alembic - Create service layer for business logic - Implement API endpoints for cart operations - Add health endpoint for monitoring - Update documentation - Fix linting issues
15 lines
523 B
Python
15 lines
523 B
Python
from sqlalchemy import Column, String, Float, Integer, Text, Boolean
|
|
from app.models.base_model import BaseModel
|
|
|
|
|
|
class Product(BaseModel):
|
|
"""Model for product items."""
|
|
|
|
__tablename__ = "products"
|
|
|
|
name = Column(String(255), nullable=False, index=True)
|
|
description = Column(Text, nullable=True)
|
|
price = Column(Float, nullable=False)
|
|
stock = Column(Integer, nullable=False, default=0)
|
|
image_url = Column(String(512), nullable=True)
|
|
is_active = Column(Boolean, default=True, nullable=False) |