chore: save session state – feature/phase-1 ready to implement

- Update session-context.md with exact resume point for next session
- Update settings.local.json with broader git permissions
- feature/grundstruktur merged to develop
- PAT authentication configured

Version: 0.2.3
This commit is contained in:
Faultier314
2026-04-05 23:24:21 +02:00
parent 5d9d517d18
commit b58edfc6eb
23 changed files with 838 additions and 14 deletions

View File

@@ -0,0 +1,40 @@
import uuid
from datetime import date, datetime, timezone
from sqlalchemy import Date, DateTime, ForeignKey, Integer, Numeric, Text, func
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.db.base import Base
class BedPlanting(Base):
__tablename__ = "bed_plantings"
id: Mapped[uuid.UUID] = mapped_column(
primary_key=True, default=uuid.uuid4, index=True
)
bed_id: Mapped[uuid.UUID] = mapped_column(
ForeignKey("beds.id", ondelete="CASCADE"),
nullable=False,
index=True,
)
plant_id: Mapped[uuid.UUID] = mapped_column(
ForeignKey("plants.id", ondelete="RESTRICT"),
nullable=False,
index=True,
)
area_m2: Mapped[float | None] = mapped_column(Numeric(5, 2), nullable=True)
count: Mapped[int | None] = mapped_column(Integer, nullable=True)
planted_date: Mapped[date | None] = mapped_column(Date, nullable=True)
removed_date: Mapped[date | None] = mapped_column(Date, nullable=True)
notes: Mapped[str | None] = mapped_column(Text, nullable=True)
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
server_default=func.now(),
nullable=False,
)
# Relationships
bed: Mapped["Bed"] = relationship("Bed", back_populates="plantings") # noqa: F821
plant: Mapped["Plant"] = relationship("Plant", back_populates="plantings") # noqa: F821