Backend: Verbrauchsgegenstand (Product.bulk) - Gegenstand wie ein Lebensmittel
Neues Flag bulk auf Product: Gegenstand als Charge mit Menge/Einheit/MHD/ Mindestbestand fuehren (z.B. Sonnencreme in ml), ohne eindeutigen Code. Migration (ADD COLUMN), Schemas und Anlege-Pfad ergaenzt. Kernlogik nutzt foodLike = kein Gegenstand ODER bulk; Bestand/Einkaufsliste unveraendert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -299,6 +299,8 @@ class ProductBase(BaseModel):
|
||||
product_url: str | None = Field(default=None, max_length=1024)
|
||||
# Gegenstände als Einzelstücke (Items mit UID/QR) statt als Menge führen.
|
||||
individual: bool = False
|
||||
# Gegenstand als Verbrauchsgegenstand wie ein Lebensmittel führen (Chargen).
|
||||
bulk: bool = False
|
||||
# Selbst definierte Feldwerte: {field_definition_id: Wert-als-Text}.
|
||||
field_values: dict[int, str | None] | None = None
|
||||
|
||||
@@ -325,6 +327,7 @@ class ProductUpdate(BaseModel):
|
||||
shop_id: int | None = None
|
||||
product_url: str | None = Field(default=None, max_length=1024)
|
||||
individual: bool | None = None
|
||||
bulk: bool | None = None
|
||||
field_values: dict[int, str | None] | None = None
|
||||
|
||||
|
||||
@@ -350,6 +353,7 @@ class ProductOut(BaseModel):
|
||||
shop_id: int | None = None
|
||||
product_url: str | None = None
|
||||
individual: bool = False
|
||||
bulk: bool = False
|
||||
created_at: datetime
|
||||
# angereichert:
|
||||
stock: float = 0.0
|
||||
|
||||
Reference in New Issue
Block a user