Files
flow-manager/backend/app/schemas/ingredient.py
2026-01-27 17:40:37 +01:00

28 lines
726 B
Python

from typing import Optional, Dict, Any
from uuid import UUID
from datetime import datetime
from app.models.ingredient import AssetType
from pydantic import BaseModel, ConfigDict, Field
class IngredientBase(BaseModel):
name: str
type: AssetType
metadata: Optional[Dict[str, Any]] = Field(default={}, validation_alias="metadata_")
class IngredientCreate(IngredientBase):
project_id: UUID
class Ingredient(IngredientBase):
id: UUID
project_id: UUID
s3_key: str
s3_bucket: str
thumbnail_key: Optional[str] = None
created_at: datetime
# Computed fields or properties can be added here
presigned_url: Optional[str] = None
model_config = ConfigDict(from_attributes=True)