51 lines
1021 B
Python
51 lines
1021 B
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 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
|
|
qr_code_url: str
|
|
photos: list[PhotoRead]
|