Files
inventory/backend/app/schemas/object.py
jze9 d6a7ac0a68 Replace box picker with free-text location in audit scan
"Where found" during inventory audit is now a plain text field
(e.g. "каб. 305") stored on the object instead of assigning it to a
box, since audit walks often use room/office labels that don't map
to the box/shelf hierarchy used elsewhere. Box assignment via the
regular object form is unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 15:41:30 +05:00

57 lines
1.1 KiB
Python

import uuid
from datetime import datetime
from pydantic import BaseModel, ConfigDict
from app.schemas.photo import PhotoRead
class ObjectSummary(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
inventory_number: str
name: str
class BoxRef(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
name: str
class ObjectCreate(BaseModel):
inventory_number: str
name: str
description: str | None = None
box_id: uuid.UUID | None = None
class ObjectUpdate(BaseModel):
inventory_number: str | None = None
name: str | None = None
description: str | None = None
box_id: uuid.UUID | None = None
class ObjectScan(BaseModel):
location: str | None = None
class ObjectRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
inventory_number: str
name: str
description: str | None
box_id: uuid.UUID | None
box: BoxRef | None
created_at: datetime
updated_at: datetime
last_seen_at: datetime | None
last_seen_location: str | None
qr_code_url: str
photos: list[PhotoRead]