Initial commit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 22:27:27 -08:00
parent 4387f6df92
commit 492e1fd68f
32 changed files with 2608 additions and 0 deletions

35
backend/models.py Normal file
View File

@@ -0,0 +1,35 @@
from datetime import date, datetime
from sqlalchemy import Integer, Date, DateTime, Text, Numeric, func
from sqlalchemy.orm import Mapped, mapped_column
from database import Base
class EggCollection(Base):
__tablename__ = "egg_collections"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
date: Mapped[date] = mapped_column(Date, nullable=False, index=True)
eggs: Mapped[int] = mapped_column(Integer, nullable=False)
notes: Mapped[str] = mapped_column(Text, nullable=True)
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
class FlockHistory(Base):
__tablename__ = "flock_history"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
date: Mapped[date] = mapped_column(Date, nullable=False, index=True)
chicken_count: Mapped[int] = mapped_column(Integer, nullable=False)
notes: Mapped[str] = mapped_column(Text, nullable=True)
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
class FeedPurchase(Base):
__tablename__ = "feed_purchases"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
date: Mapped[date] = mapped_column(Date, nullable=False, index=True)
bags: Mapped[float] = mapped_column(Numeric(5, 2), nullable=False)
price_per_bag: Mapped[float] = mapped_column(Numeric(10, 2), nullable=False)
notes: Mapped[str] = mapped_column(Text, nullable=True)
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())