from Schemas.base_imports import ( CrudCollection, String, Integer, Boolean, ForeignKey, Index, TIMESTAMP, Numeric, SmallInteger, mapped_column, Mapped, ) from sqlalchemy import text class BuildIbans(CrudCollection): """ BuildParts class based on declarative_base and BaseMixin via session """ __tablename__ = "build_ibans" __exclude__fields__ = [] iban: Mapped[str] = mapped_column( String(40), server_default="", nullable=False, comment="IBAN number" ) start_date: Mapped[TIMESTAMP] = mapped_column( TIMESTAMP(timezone=True), nullable=False, comment="Bank Transaction Start Date" ) stop_date: Mapped[TIMESTAMP] = mapped_column( TIMESTAMP(timezone=True), server_default="2900-01-01 00:00:00" ) bank_code: Mapped[str] = mapped_column(String(24), server_default="TR0000000000000") xcomment: Mapped[str] = mapped_column(String(64), server_default="????") build_id: Mapped[int] = mapped_column( ForeignKey("build.id"), nullable=True, comment="Building ID" ) build_uu_id: Mapped[str] = mapped_column( String, nullable=True, comment="Building UUID", index=True ) __table_args__ = ( Index("_build_ibans_ndx_01", iban, start_date, unique=True), {"comment": "IBANs related to money transactions due to building objects"}, ) class CompanyDelayInterest(CrudCollection): __tablename__ = "company_delay_interest" company_id: Mapped[int] = mapped_column(Integer, ForeignKey("companies.id"), nullable=True) company_uu_id: Mapped[str] = mapped_column(String, nullable=True) build_id: Mapped[int] = mapped_column(Integer, ForeignKey("build.id"), nullable=True) build_uu_id: Mapped[str] = mapped_column(String, nullable=True) daily_interest_type: Mapped[str] = mapped_column(String(24), nullable=True) daily_interest_rate: Mapped[float] = mapped_column(Numeric(20, 6), nullable=False, server_default=text("0")) bsmv_rate: Mapped[float] = mapped_column(Numeric(20, 6), nullable=False, server_default=text("0")) kkdf_rate: Mapped[float] = mapped_column(Numeric(20, 6), nullable=False, server_default=text("0")) start_date: Mapped[TIMESTAMP] = mapped_column(TIMESTAMP(timezone=True), nullable=False) stop_date: Mapped[TIMESTAMP] = mapped_column(TIMESTAMP(timezone=True), nullable=False, server_default=text("'2900-01-01 03:00:00+03'::timestamptz")) __table_args__ = ( Index("_company_delay_interest_ndx_01", "company_id", "build_id", "start_date", unique=True), Index("ix_company_delay_interest_build_uu_id", "company_id", "build_id"), {"comment": "Company Delay Interest Information"}, ) class BuildIbanDescription(CrudCollection): """ SearchComments class based on declarative_base and CrudCollection via session """ __tablename__ = "build_iban_description" __exclude__fields__ = [] iban: Mapped[str] = mapped_column(String, nullable=False, comment="IBAN Number") group_id: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment="Group ID" ) search_word: Mapped[str] = mapped_column( String, nullable=False, comment="Search Word", index=True ) customer_id: Mapped[int] = mapped_column(ForeignKey("people.id"), nullable=True) customer_uu_id: Mapped[str] = mapped_column( String, nullable=True, comment="Customer UUID" ) company_id: Mapped[int] = mapped_column(ForeignKey("companies.id"), nullable=True) company_uu_id: Mapped[str] = mapped_column( String, nullable=True, comment="Company UUID" ) build_parts_id: Mapped[int] = mapped_column( ForeignKey("build_parts.id"), nullable=True ) build_parts_uu_id: Mapped[str] = mapped_column( String, nullable=True, comment="Build Parts UUID" ) __table_args__ = ( Index( "_search_iban_description_ndx_00", iban, search_word, group_id, unique=True ), {"comment": "Search Iban Description Information"}, )