Automated Action 4aac37bc90 Implement inventory management system with FastAPI and SQLite
- Setup project structure with FastAPI application
- Create database models with SQLAlchemy
- Configure Alembic for database migrations
- Implement CRUD operations for products, categories, suppliers
- Add inventory transaction functionality
- Implement user authentication with JWT
- Add health check endpoint
- Create comprehensive documentation
2025-06-05 11:43:07 +00:00

33 lines
668 B
Python

from pydantic import BaseModel
from typing import Optional
from datetime import datetime
# Shared properties
class CategoryBase(BaseModel):
name: str
description: Optional[str] = None
# Properties to receive via API on creation
class CategoryCreate(CategoryBase):
pass
# Properties to receive via API on update
class CategoryUpdate(CategoryBase):
name: Optional[str] = None
class CategoryInDBBase(CategoryBase):
id: int
created_at: Optional[datetime] = None
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
# Additional properties to return via API
class Category(CategoryInDBBase):
pass