bot_fam / python_backend /app /schemas.py
JairoDanielMT's picture
Add receipt image registration with category expiry rules
9218640
raw
history blame contribute delete
732 Bytes
from __future__ import annotations
from pydantic import BaseModel, Field
class ProductCreate(BaseModel):
producto: str
precio: float = Field(ge=0)
cantidad: float = Field(gt=0)
unidad: str = "unidad"
fechaCaducidad: str
fechaIngreso: str
fechaProduccion: str
categoria: str = ""
caducidadEstimada: bool = False
notas: str = ""
fuente: str = "web"
class ConsumptionCreate(BaseModel):
producto: str
cantidad: float = Field(gt=0)
unidad: str = "unidad"
notas: str = ""
fuente: str = "telegram-consumo"
class SearchRequest(BaseModel):
question: str
class DiagramRequest(BaseModel):
instruction: str
class TextExtractionRequest(BaseModel):
text: str