
- Created complete RESTful API for inventory management - Set up database models for items, categories, suppliers, and transactions - Implemented user authentication with JWT tokens - Added transaction tracking for inventory movements - Created comprehensive API endpoints for all CRUD operations - Set up Alembic for database migrations - Added input validation and error handling - Created detailed documentation in README
34 lines
645 B
Python
34 lines
645 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
# 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: Optional[datetime] = None
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
# Additional properties to return via API
|
|
class Category(CategoryInDBBase):
|
|
pass |