fix aud search on center
This commit is contained in:
@@ -16,7 +16,7 @@ class EquipmentTypeRead(EquipmentTypeBase):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# === Component ===
|
||||
@@ -31,7 +31,7 @@ class ComponentRead(ComponentBase):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# === Consumable ===
|
||||
@@ -46,7 +46,7 @@ class ConsumableRead(ConsumableBase):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# === Owner ===
|
||||
@@ -60,7 +60,7 @@ class OwnerRead(OwnerBase):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# === Oborud ===
|
||||
@@ -95,7 +95,7 @@ class OborudRead(OborudBase):
|
||||
consumables: List[ConsumableRead] = []
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# === Auditory ===
|
||||
@@ -109,7 +109,7 @@ class AuditoryRead(AuditoryBase):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# === Zametka ===
|
||||
@@ -125,7 +125,7 @@ class ZametkaRead(ZametkaBase):
|
||||
created_date: Optional[datetime] = None
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# === Auth/User ===
|
||||
@@ -151,8 +151,67 @@ class UserRead(UserBase):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class UserRoleUpdate(BaseModel):
|
||||
role: Role
|
||||
|
||||
|
||||
# === Inspection System ===
|
||||
|
||||
# InspectionSession
|
||||
class InspectionSessionBase(BaseModel):
|
||||
aud_id: Optional[int] = None
|
||||
|
||||
class InspectionSessionCreate(InspectionSessionBase):
|
||||
pass
|
||||
|
||||
class InspectionSessionRead(InspectionSessionBase):
|
||||
id: int
|
||||
user_id: int
|
||||
started_at: datetime
|
||||
completed_at: Optional[datetime] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
# InspectionRecord
|
||||
class InspectionRecordRead(BaseModel):
|
||||
id: int
|
||||
session_id: int
|
||||
oborud_id: int
|
||||
checked_at: datetime
|
||||
oborud: Optional[OborudRead] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
# UnknownBarcode
|
||||
class UnknownBarcodeRead(BaseModel):
|
||||
id: int
|
||||
session_id: int
|
||||
barcode: str
|
||||
scanned_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
# Ответ на сканирование
|
||||
class CheckBarcodeResponse(BaseModel):
|
||||
status: Literal["found", "not_found"]
|
||||
equipment: Optional[OborudRead] = None
|
||||
message: str
|
||||
|
||||
# Статистика сессии
|
||||
class InspectionSessionStats(BaseModel):
|
||||
session: InspectionSessionRead
|
||||
total_expected: int # всего оборудования (в аудитории или всего)
|
||||
total_checked: int # проверено уникальных позиций
|
||||
total_unknown: int # неизвестных штрихкодов
|
||||
progress_percent: float
|
||||
|
||||
# Детальный отчёт
|
||||
class InspectionDetailReport(BaseModel):
|
||||
records: List[InspectionRecordRead]
|
||||
unknown_barcodes: List[UnknownBarcodeRead]
|
||||
|
||||
Reference in New Issue
Block a user