Files
inventory/backend/app/schemas/object.py
jze9 f99949559c Add inventory audit mode with camera QR scanning
Lets an employee walk the premises, scan each object's QR to confirm
it's present and record where it was found (defaulting to the last
picked location), and track found/not-found progress for the walk.
Scanning a box's QR shows its contents read-only without affecting
the found/not-found counts.

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

56 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):
box_id: uuid.UUID | 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
qr_code_url: str
photos: list[PhotoRead]