
- Created FastAPI application with SQLite database - Implemented models for inventory items, categories, suppliers, and transactions - Added authentication system with JWT tokens - Implemented CRUD operations for all models - Set up Alembic for database migrations - Added comprehensive API documentation - Configured Ruff for code linting
18 lines
498 B
Python
18 lines
498 B
Python
from sqlalchemy import Column, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base import Base
|
|
|
|
|
|
class Category(Base):
|
|
"""
|
|
Category model for categorizing inventory items.
|
|
"""
|
|
__tablename__ = "categories"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, index=True, nullable=False, unique=True)
|
|
description = Column(String, nullable=True)
|
|
|
|
# Relationships
|
|
items = relationship("Item", back_populates="category") |