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