Automated Action a28e115e4f Implement simple cart system with FastAPI and SQLite
- 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
2025-05-18 23:36:40 +00:00

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)