- Saved recipes: save/unsave, star rating, notes, tags, collections (migrations 018-020) - Recipe browser: domain/category browsing with pantry match badges, pagination - Recipe detail panel: full directions, ingredient checklist, swap candidates, prep notes - Grocery links: affiliate links for missing ingredients - Nutrition filters and display chips on recipe cards - Bookmark toggle persisted to saved_recipes table - Tier gates on saved recipes (paid) and collections (premium) - Browser telemetry for domain/category click tracking - Cloud compose: CLOUD_DATA_ROOT volume mount for per-user SQLite trees - manage.sh: cf-orch agent sidecar in local stack - README: updated feature list and stack description
44 lines
970 B
Python
44 lines
970 B
Python
"""Pydantic schemas for saved recipes and collections."""
|
|
from __future__ import annotations
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class SaveRecipeRequest(BaseModel):
|
|
recipe_id: int
|
|
notes: str | None = None
|
|
rating: int | None = Field(None, ge=0, le=5)
|
|
|
|
|
|
class UpdateSavedRecipeRequest(BaseModel):
|
|
notes: str | None = None
|
|
rating: int | None = Field(None, ge=0, le=5)
|
|
style_tags: list[str] = Field(default_factory=list)
|
|
|
|
|
|
class SavedRecipeSummary(BaseModel):
|
|
id: int
|
|
recipe_id: int
|
|
title: str
|
|
saved_at: str
|
|
notes: str | None
|
|
rating: int | None
|
|
style_tags: list[str]
|
|
collection_ids: list[int] = Field(default_factory=list)
|
|
|
|
|
|
class CollectionSummary(BaseModel):
|
|
id: int
|
|
name: str
|
|
description: str | None
|
|
member_count: int
|
|
created_at: str
|
|
|
|
|
|
class CollectionRequest(BaseModel):
|
|
name: str
|
|
description: str | None = None
|
|
|
|
|
|
class CollectionMemberRequest(BaseModel):
|
|
saved_recipe_id: int
|