feat: add agreements foundation

This commit is contained in:
Александр Арсентьев
2026-09-25 18:41:08 +03:00
parent 2376778828
commit d0b5745f8f
14 changed files with 697 additions and 61 deletions
+2 -1
View File
@@ -10,7 +10,7 @@ class BoqDocument(Base):
id = Column(Integer, primary_key=True, index=True)
project_id = Column(Integer, ForeignKey("projects.id"), nullable=False)
agreement_id = Column(Integer) # nullable
agreement_id = Column(Integer, ForeignKey("agreements.id"), nullable=True, index=True)
name = Column(String, nullable=False)
version = Column(String)
source_file = Column(String)
@@ -18,6 +18,7 @@ class BoqDocument(Base):
# Relationship to project
project = relationship("Project", back_populates="boq_documents")
agreement = relationship("Agreement", back_populates="boq_documents", foreign_keys=[agreement_id])
def __repr__(self):
return f"<BoqDocument(id={self.id}, name='{self.name}')>"