Backend (FastAPI): - REST API: auth, plants, beds, plantings - CRUD layer with CRUDBase - Pydantic v2 schemas for all entities - Alembic migration: complete schema + all enums - Seed data: 28 global plants + 15 compatibilities Frontend (Vue 3 + PrimeVue): - Axios client with JWT interceptor + auto-refresh - Pinia stores: auth, beds, plants - Views: Login, Beds, BedDetail, PlantLibrary - Components: AppLayout, BedForm, PlantingForm, PlantForm Docker: - docker-compose.yml (production) - docker-compose.dev.yml (development with hot-reload) - Nginx config with SPA fallback + API proxy - Multi-stage frontend Dockerfile - .env.example, .gitignore Version: 1.0.0-alpha
39 lines
828 B
Python
39 lines
828 B
Python
import uuid
|
|
from datetime import date, datetime
|
|
from decimal import Decimal
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from app.schemas.plant import PlantRead
|
|
|
|
|
|
class PlantingBase(BaseModel):
|
|
plant_id: uuid.UUID
|
|
area_m2: Decimal | None = None
|
|
count: int | None = None
|
|
planted_date: date | None = None
|
|
removed_date: date | None = None
|
|
notes: str | None = None
|
|
|
|
|
|
class PlantingCreate(PlantingBase):
|
|
pass
|
|
|
|
|
|
class PlantingUpdate(BaseModel):
|
|
plant_id: uuid.UUID | None = None
|
|
area_m2: Decimal | None = None
|
|
count: int | None = None
|
|
planted_date: date | None = None
|
|
removed_date: date | None = None
|
|
notes: str | None = None
|
|
|
|
|
|
class PlantingRead(PlantingBase):
|
|
model_config = {"from_attributes": True}
|
|
|
|
id: uuid.UUID
|
|
bed_id: uuid.UUID
|
|
plant: PlantRead
|
|
created_at: datetime
|