Automated Action 700da98f88 Implement small business inventory management system with FastAPI and SQLite
- Created complete RESTful API for inventory management
- Set up database models for items, categories, suppliers, and transactions
- Implemented user authentication with JWT tokens
- Added transaction tracking for inventory movements
- Created comprehensive API endpoints for all CRUD operations
- Set up Alembic for database migrations
- Added input validation and error handling
- Created detailed documentation in README
2025-06-08 10:00:50 +00:00

16 lines
570 B
Python

from sqlalchemy import Column, String, DateTime, Text
from sqlalchemy.sql import func
from sqlalchemy.orm import relationship
from app.db.base_class import Base
class Category(Base):
id = Column(String, primary_key=True, index=True)
name = Column(String, index=True, nullable=False)
description = Column(Text, nullable=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
# Relationships
items = relationship("Item", back_populates="category")