25 lines
453 B
Python
25 lines
453 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
from pydantic import BaseModel, ConfigDict, EmailStr
|
||
|
|
|
||
|
|
|
||
|
|
class EmployeeCreate(BaseModel):
|
||
|
|
employee_no: str
|
||
|
|
name: str
|
||
|
|
department: str
|
||
|
|
email: EmailStr
|
||
|
|
|
||
|
|
|
||
|
|
class EmployeeRead(BaseModel):
|
||
|
|
model_config = ConfigDict(from_attributes=True)
|
||
|
|
|
||
|
|
id: str
|
||
|
|
employee_no: str
|
||
|
|
name: str
|
||
|
|
department: str
|
||
|
|
email: EmailStr
|
||
|
|
created_at: datetime
|
||
|
|
updated_at: datetime
|