Backend: alle Chargen auflisten + Lagerort mehrerer Chargen auf einmal setzen

GET /lots/rows liefert alle Chargen mit Artikel-Infos (Name, Menge, Einheit,
Lagerort) fuer eine uebergreifende Chargenliste. POST /lots/bulk-location setzt
den Lagerort vieler Chargen in einem Rutsch (reine Ortsangabe, ohne Bewegung).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-29 13:48:19 +02:00
parent 227143d13f
commit 1c88206838
2 changed files with 78 additions and 3 deletions

View File

@@ -450,6 +450,30 @@ class LotUpdate(BaseModel):
location_id: str | None = None
class LotRow(BaseModel):
"""Eine Charge mit Artikel-Infos für die übergreifende Chargenliste."""
id: int
product_id: int
product_name: str
product_brand: str | None = None
quantity: float # in Basiseinheiten
base_unit: BaseUnit
package_size: float | None = None
package_label: str | None = None
unit_name: str = ""
unit_factor: float = 1.0
best_before: date | None = None
best_before_precision: DatePrecision = DatePrecision.day
location_id: str | None = None
created_at: datetime
class BulkLotLocation(BaseModel):
"""Lagerort für mehrere Chargen auf einmal setzen (oder leeren)."""
lot_ids: list[int]
location_id: str | None = None
class CheckInResponse(BaseModel):
lot: LotOut
product_stock: float