
- 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
31 lines
600 B
Python
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 |