Plant registry, grow event calendar, and gardening knowledge base populated via cf-harvest ingest endpoint. All 23 tests passing. Stack: - FastAPI + SQLite (cf-core migrations) on port 8522 - Vue 3 + Vite + Pinia SPA on port 8521 - 5 SQL migrations: locations → plants → grow_events, knowledge_sources → knowledge_facts - Earthy green theme (--color-primary: #4a7c59) matching CF theme system Knowledge ingest contract: - POST /api/v1/knowledge/ingest — idempotent on fact_hash (sha256 of type+payload+video_path) - 8 fact types: companion_planting, soil_amendment, propagation, pest_diagnosis, harvest_timing, instruction, medicinal, history_context - Partial batch failure: malformed facts collected in rejected[], valid facts inserted - Re-ingesting same video batch: facts_skipped_duplicate > 0, no duplicates Wired views: RegistryView (plant CRUD), KnowledgeView (facts + type filter chips) Stub views: CalendarView, SettingsView
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
from __future__ import annotations
|
|
from typing import Optional
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class PlantCreate(BaseModel):
|
|
common_name: str
|
|
latin_binomial: Optional[str] = None
|
|
variety: Optional[str] = None
|
|
location_id: Optional[int] = None
|
|
planting_date: Optional[str] = None
|
|
rootstock: Optional[str] = None
|
|
scion_source: Optional[str] = None
|
|
graft_date: Optional[str] = None
|
|
days_to_maturity: Optional[int] = None
|
|
notes: Optional[str] = None
|
|
|
|
|
|
class PlantUpdate(BaseModel):
|
|
common_name: Optional[str] = None
|
|
latin_binomial: Optional[str] = None
|
|
variety: Optional[str] = None
|
|
location_id: Optional[int] = None
|
|
planting_date: Optional[str] = None
|
|
rootstock: Optional[str] = None
|
|
scion_source: Optional[str] = None
|
|
graft_date: Optional[str] = None
|
|
days_to_maturity: Optional[int] = None
|
|
notes: Optional[str] = None
|
|
|
|
|
|
class PlantOut(BaseModel):
|
|
id: int
|
|
common_name: str
|
|
latin_binomial: Optional[str]
|
|
variety: Optional[str]
|
|
location_id: Optional[int]
|
|
planting_date: Optional[str]
|
|
rootstock: Optional[str]
|
|
scion_source: Optional[str]
|
|
graft_date: Optional[str]
|
|
days_to_maturity: Optional[int]
|
|
notes: Optional[str]
|
|
created_at: str
|
|
updated_at: str
|