mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Создание чата5
This commit is contained in:
@@ -1,29 +1,22 @@
|
||||
"""Request schemas"""
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
from ..models.request import RequestStatus, RequestPriority
|
||||
from typing import Optional
|
||||
|
||||
class RequestBase(BaseModel):
|
||||
request_type: str
|
||||
description: str
|
||||
priority: RequestPriority
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
priority: str
|
||||
|
||||
class RequestCreate(RequestBase):
|
||||
pass
|
||||
|
||||
class RequestUpdate(BaseModel):
|
||||
status: RequestStatus
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
class Request(RequestBase):
|
||||
id: int
|
||||
status: RequestStatus
|
||||
employee_id: int
|
||||
department: str
|
||||
status: str
|
||||
created_at: datetime
|
||||
updated_at: Optional[datetime] = None
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
class Config:
|
||||
from_attributes = True
|
16
backend/app/schemas/user.py
Normal file
16
backend/app/schemas/user.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from pydantic import BaseModel, EmailStr
|
||||
|
||||
class UserBase(BaseModel):
|
||||
email: EmailStr
|
||||
full_name: str
|
||||
|
||||
class UserCreate(UserBase):
|
||||
password: str
|
||||
|
||||
class User(UserBase):
|
||||
id: int
|
||||
is_active: bool
|
||||
is_admin: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
Reference in New Issue
Block a user