44 lines
775 B
Python
44 lines
775 B
Python
from datetime import datetime
|
|
from uuid import UUID
|
|
from ninja import Schema
|
|
|
|
|
|
class ImageCropIn(Schema):
|
|
x1: int
|
|
y1: int
|
|
x2: int
|
|
y2: int
|
|
label: str | None = None
|
|
|
|
|
|
class ImageCropOut(Schema):
|
|
id: UUID
|
|
x1: int
|
|
y1: int
|
|
x2: int
|
|
y2: int
|
|
label: str
|
|
ocr_status: str
|
|
ocr_raw_data: str
|
|
created_at: datetime
|
|
|
|
|
|
class SubmissionFileOut(Schema):
|
|
id: UUID
|
|
original_filename: str
|
|
content_type: str
|
|
file_size: int
|
|
file_url: str | None = None
|
|
ocr_status: str
|
|
ocr_raw_data: str
|
|
crops: list[ImageCropOut] = []
|
|
|
|
|
|
class SubmissionOut(Schema):
|
|
id: UUID
|
|
game_id: int | None = None
|
|
notes: str | None = None
|
|
files: list[SubmissionFileOut] = []
|
|
created_at: datetime
|
|
updated_at: datetime
|