chore: baseline before agreements
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
from sqlalchemy import Column, Date, DateTime, ForeignKey, Integer, Numeric, Text
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
from app.database.database import Base
|
||||
|
||||
|
||||
class DailyReport(Base):
|
||||
__tablename__ = "daily_reports"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
project_id = Column(Integer, ForeignKey("projects.id"), nullable=False, index=True)
|
||||
system_id = Column(Integer, ForeignKey("systems.id"), nullable=False, index=True)
|
||||
report_date = Column(Date, nullable=False, index=True)
|
||||
notes = Column(Text)
|
||||
created_at = Column(DateTime, nullable=False, server_default=func.now())
|
||||
updated_at = Column(DateTime, nullable=False, server_default=func.now(), onupdate=func.now())
|
||||
|
||||
project = relationship("Project")
|
||||
system = relationship("System")
|
||||
items = relationship("DailyReportItem", back_populates="report", cascade="all, delete-orphan")
|
||||
|
||||
|
||||
class DailyReportItem(Base):
|
||||
__tablename__ = "daily_report_items"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
daily_report_id = Column(Integer, ForeignKey("daily_reports.id"), nullable=False, index=True)
|
||||
work_item_id = Column(Integer, ForeignKey("work_items.id"), nullable=False, index=True)
|
||||
completed_quantity = Column(Numeric(15, 4), nullable=False)
|
||||
|
||||
report = relationship("DailyReport", back_populates="items")
|
||||
work_item = relationship("WorkItem")
|
||||
Reference in New Issue
Block a user