1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00
Files
AdministrationItDepartmens/backend/app/schemas/employee.py
MoonTestUse1 2f7bf9c28c testing pipe
2025-01-06 05:24:29 +06:00

32 lines
793 B
Python

"""Employee schemas"""
from pydantic import BaseModel, ConfigDict
from datetime import datetime
from typing import Optional
class EmployeeBase(BaseModel):
email: str
full_name: str
department: str
is_active: bool = True
is_admin: bool = False
model_config = ConfigDict(from_attributes=True)
class EmployeeCreate(EmployeeBase):
password: str
class EmployeeUpdate(BaseModel):
email: Optional[str] = None
full_name: Optional[str] = None
department: Optional[str] = None
password: Optional[str] = None
is_active: Optional[bool] = None
is_admin: Optional[bool] = None
model_config = ConfigDict(from_attributes=True)
class Employee(EmployeeBase):
id: int
created_at: datetime
model_config = ConfigDict(from_attributes=True)