feat(submissions): crop management

This commit is contained in:
2026-05-25 02:34:23 +02:00
parent a769d1a0b3
commit 0fc1fb255f
6 changed files with 518 additions and 78 deletions
+24 -4
View File
@@ -1,23 +1,43 @@
from typing import Optional
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: Optional[str] = None
file_url: str | None = None
ocr_status: str
ocr_raw_data: str
crops: list[ImageCropOut] = []
class SubmissionOut(Schema):
id: UUID
game_id: Optional[int] = None
notes: Optional[str] = None
game_id: int | None = None
notes: str | None = None
files: list[SubmissionFileOut] = []
created_at: datetime
updated_at: datetime