feat: UI/UX cleanup V1 with header, import requisites, and status fixes

This commit is contained in:
Арсентьев Александр
2026-09-27 20:22:13 +03:00
parent 79d802d536
commit 94571f9684
31 changed files with 2842 additions and 73 deletions
+23
View File
@@ -14,12 +14,35 @@ class BoqDocument(Base):
name = Column(String, nullable=False)
version = Column(String)
source_file = Column(String)
document_number = Column(String)
document_date = Column(Date)
contract = Column(String)
created_at = Column(DateTime, default=func.now())
# Relationship to project
project = relationship("Project", back_populates="boq_documents")
agreement = relationship("Agreement", back_populates="boq_documents", foreign_keys=[agreement_id])
_TECHNICAL_PREFIXES = (
"BOQ Import - ",
"BOQ Import — ",
"BOQ Import —",
"BOQ Import -",
"Импорт ведомости — ",
"Импорт ведомости - ",
"Импорт ведомости —",
"Импорт ведомости -",
)
@property
def display_name(self) -> str:
name = (self.name or "").strip()
for prefix in self._TECHNICAL_PREFIXES:
if name.startswith(prefix):
name = name[len(prefix):].strip(" —-–")
break
return name or f"Ведомость #{self.id}"
def __repr__(self):
return f"<BoqDocument(id={self.id}, name='{self.name}')>"