
- Set up project structure with FastAPI and SQLite - Create database models for inventory management - Set up SQLAlchemy and Alembic for database migrations - Create initial database migrations - Implement CRUD operations for products, categories, suppliers - Implement stock movement tracking and inventory management - Add authentication and user management - Add API endpoints for all entities - Add health check endpoint - Update README with project information and usage instructions
33 lines
634 B
Python
33 lines
634 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: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
# Additional properties to return via API
|
|
class Category(CategoryInDBBase):
|
|
pass |