project items added

This commit is contained in:
2024-11-18 20:21:38 +03:00
parent 7bc16e02d1
commit 1e8f5023e8
9 changed files with 534 additions and 44 deletions

View File

@@ -34,6 +34,7 @@ from databases.sql_models.building.decision_book import (
BuildDecisionBookProjects,
BuildDecisionBookProjectPerson,
BuildDecisionBookPersonOccupants,
BuildDecisionBookProjectItems,
)
from databases.sql_models.company.company import (
Companies,
@@ -120,6 +121,7 @@ __all__ = [
"BuildDecisionBookProjects",
"BuildDecisionBookProjectPerson",
"BuildDecisionBookPersonOccupants",
"BuildDecisionBookProjectItems",
"Companies",
"RelationshipDutyCompany",
"Employees",

View File

@@ -1033,17 +1033,15 @@ class BuildDecisionBookProjects(CrudCollection):
decision_book_pdf_path: Mapped[str] = mapped_column(
String, server_default="", nullable=True
)
is_completed: Mapped[bool] = mapped_column(
Boolean, server_default="0", comment="Project is Completed"
)
status_id: Mapped[int] = mapped_column(SmallInteger, nullable=True)
resp_company_fix_wage: Mapped[float] = mapped_column(
Numeric(10, 2), server_default="0"
)
is_out_sourced: Mapped[bool] = mapped_column(Boolean, server_default="0")
contact_id: Mapped[int] = mapped_column(
ForeignKey("contracts.id"), nullable=True, comment="Contract id"
)
contact_uu_id: Mapped[str] = mapped_column(
String, nullable=True, comment="Contract UUID"
)
meeting_date: Mapped[TIMESTAMP] = mapped_column(
TIMESTAMP, server_default="1900-01-01 00:00:00", index=True
)
@@ -1052,6 +1050,12 @@ class BuildDecisionBookProjects(CrudCollection):
approved_price: Mapped[float] = mapped_column(Numeric(16, 4), server_default="0")
final_price: Mapped[float] = mapped_column(Numeric(16, 4), server_default="0")
contact_id: Mapped[int] = mapped_column(
ForeignKey("contracts.id"), nullable=True, comment="Contract id"
)
contact_uu_id: Mapped[str] = mapped_column(
String, nullable=True, comment="Contract UUID"
)
build_decision_book_id: Mapped[int] = mapped_column(
ForeignKey("build_decision_book.id"), nullable=False
)
@@ -1209,6 +1213,38 @@ class BuildDecisionBookProjectPerson(CrudCollection):
)
class BuildDecisionBookProjectItems(CrudCollection):
"""
Builds class based on declarative_base and BaseMixin via session
"""
__tablename__ = "build_decision_book_project_items"
__exclude__fields__ = []
item_header: Mapped[str] = mapped_column(
String, nullable=False, comment="Item Header"
)
item_comment: Mapped[str] = mapped_column(
Text, nullable=False, comment="Item Comment"
)
attachment_pdf_path: Mapped[str] = mapped_column(
String, server_default="", nullable=True, comment="Attachment PDF Path"
)
item_estimated_cost: Mapped[float] = mapped_column(
Numeric(16, 2), server_default="0", comment="Estimated Cost"
)
build_decision_book_project_id: Mapped[int] = mapped_column(
ForeignKey("build_decision_book_projects.id"), nullable=False
)
build_decision_book_project_uu_id: Mapped[str] = mapped_column(
String, nullable=True, comment="Decision Book Project UUID"
)
__table_args__ = (
{"comment": "Project Items related to decision taken at building meetings"},
)
#
# class BuildDecisionBookPaymentsMaster(CrudCollection):
# """