1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

Testing workable

This commit is contained in:
MoonTestUse1
2025-02-07 00:43:33 +06:00
parent 8543d7fe88
commit 6db95a5eb0
37 changed files with 911 additions and 454 deletions

View File

@@ -1,18 +1,32 @@
"""Authentication schemas"""
from pydantic import BaseModel
from typing import Optional
from pydantic import BaseModel, ConfigDict
class AdminLogin(BaseModel):
username: str
password: str
model_config = ConfigDict(from_attributes=True)
class EmployeeLogin(BaseModel):
last_name: str
password: str
model_config = ConfigDict(from_attributes=True)
class EmployeeResponse(BaseModel):
id: int
first_name: str
last_name: str
department: str
office: str
access_token: str
class Token(BaseModel):
"""Token schema"""
access_token: str
token_type: str
class TokenData(BaseModel):
"""Token data schema"""
employee_id: Optional[int] = None
employee_id: int | None = None
is_admin: bool = False
class LoginCredentials(BaseModel):
"""Login credentials schema"""
username: str # В формате "Имя Фамилия"
password: str
model_config = ConfigDict(from_attributes=True)