start
This commit is contained in:
50
backend/app/schemas/object.py
Normal file
50
backend/app/schemas/object.py
Normal file
@@ -0,0 +1,50 @@
|
||||
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]
|
||||
Reference in New Issue
Block a user