start
This commit is contained in:
40
backend/app/schemas/box.py
Normal file
40
backend/app/schemas/box.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from app.schemas.object import ObjectSummary
|
||||
|
||||
|
||||
class BoxSummary(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: uuid.UUID
|
||||
name: str
|
||||
|
||||
|
||||
class BoxCreate(BaseModel):
|
||||
name: str
|
||||
description: str | None = None
|
||||
parent_box_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class BoxUpdate(BaseModel):
|
||||
name: str | None = None
|
||||
description: str | None = None
|
||||
parent_box_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class BoxRead(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: uuid.UUID
|
||||
name: str
|
||||
description: str | None
|
||||
parent_box_id: uuid.UUID | None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
qr_code_url: str
|
||||
ancestors: list[BoxSummary]
|
||||
children: list[BoxSummary]
|
||||
objects: list[ObjectSummary]
|
||||
Reference in New Issue
Block a user