logistics-app-iqb0g9/endpoints/Outliners-Staffs.post.py
2025-03-20 21:11:33 +00:00

34 lines
927 B
Python

from fastapi import APIRouter, Depends, HTTPException
from core.database import fake_users_db
import uuid
router = APIRouter()
@router.post("/Outliners-Staffs")
async def outliners_staffs_handler(
name: str = "staff_name",
role: str = "staff_role",
department: str = "department"
):
"""Create new outliner staff entry"""
staff_id = str(uuid.uuid4())
staff_entry = {
"id": staff_id,
"name": name,
"role": role,
"department": department,
"status": "active"
}
fake_users_db[staff_id] = staff_entry
return {
"message": "Staff member created successfully",
"staff_id": staff_id,
"data": staff_entry,
"metadata": {
"created_at": "demo_timestamp",
"department_count": len([s for s in fake_users_db.values() if isinstance(s, dict) and s.get("department") == department])
}
}