Update code in endpoints/login.post.py
This commit is contained in:
parent
e9d79b2cc8
commit
c43506b901
@ -1,7 +1,6 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from core.database import fake_users_db
|
||||
import uuid
|
||||
from typing import Optional
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@ -10,8 +9,7 @@ async def create_employee(
|
||||
name: str,
|
||||
position: str,
|
||||
email: str,
|
||||
department: Optional[str] = None,
|
||||
salary: Optional[float] = None
|
||||
department: str = "General"
|
||||
):
|
||||
"""Create new employee record"""
|
||||
employee_id = str(uuid.uuid4())
|
||||
@ -25,26 +23,22 @@ async def create_employee(
|
||||
"position": position,
|
||||
"email": email,
|
||||
"department": department,
|
||||
"salary": salary,
|
||||
"active": True
|
||||
"active": True,
|
||||
"created_at": "2024-01-01T00:00:00Z" # Demo date
|
||||
}
|
||||
|
||||
fake_users_db[employee_id] = employee_data
|
||||
|
||||
return {
|
||||
"message": "Employee created successfully",
|
||||
"data": {
|
||||
"employee_id": employee_id,
|
||||
"name": name,
|
||||
"email": email
|
||||
},
|
||||
"data": employee_data,
|
||||
"metadata": {
|
||||
"created_at": "demo_timestamp",
|
||||
"department": department
|
||||
},
|
||||
"next_steps": [
|
||||
"Complete employee onboarding",
|
||||
"Assign access credentials",
|
||||
"Schedule orientation"
|
||||
]
|
||||
"created_id": employee_id,
|
||||
"department": department,
|
||||
"next_steps": [
|
||||
"Complete employee onboarding",
|
||||
"Assign workspace",
|
||||
"Schedule orientation"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user