34 lines
926 B
Python
34 lines
926 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])
|
|
}
|
|
|