
- 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
33 lines
668 B
Python
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 |