Automated Action 5935f302dc Create Small Business Inventory Management System with FastAPI and SQLite
- Set up project structure and FastAPI application
- Create database models with SQLAlchemy
- Implement authentication with JWT
- Add CRUD operations for products, inventory, categories
- Implement purchase order and sales functionality
- Create reporting endpoints
- Set up Alembic for database migrations
- Add comprehensive documentation in README.md
2025-05-16 08:53:15 +00:00

31 lines
600 B
Python

from typing import Optional
from pydantic import BaseModel, Field
# Shared properties
class CategoryBase(BaseModel):
name: str
description: Optional[str] = None
# Properties to receive on category creation
class CategoryCreate(CategoryBase):
pass
# Properties to receive on category update
class CategoryUpdate(CategoryBase):
name: Optional[str] = None
# Properties shared by models returned from API
class CategoryInDBBase(CategoryBase):
id: int
class Config:
from_attributes = True
# Properties to return via API
class Category(CategoryInDBBase):
pass