fix: ruff lint + format fixes in tests, ESLint fixes in frontend
This commit is contained in:
@@ -56,46 +56,67 @@ class Contact(Base):
|
||||
default=uuid.uuid4,
|
||||
)
|
||||
company_name: Mapped[str] = mapped_column(
|
||||
String(255), nullable=False, index=True,
|
||||
String(255),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
legal_form: Mapped[str | None] = mapped_column(
|
||||
String(50), nullable=True,
|
||||
String(50),
|
||||
nullable=True,
|
||||
)
|
||||
address_street: Mapped[str | None] = mapped_column(
|
||||
String(255), nullable=True,
|
||||
String(255),
|
||||
nullable=True,
|
||||
)
|
||||
address_zip: Mapped[str | None] = mapped_column(
|
||||
String(10), nullable=True,
|
||||
String(10),
|
||||
nullable=True,
|
||||
)
|
||||
address_city: Mapped[str | None] = mapped_column(
|
||||
String(100), nullable=True,
|
||||
String(100),
|
||||
nullable=True,
|
||||
)
|
||||
address_country: Mapped[str] = mapped_column(
|
||||
String(2), nullable=False, default="DE", index=True,
|
||||
String(2),
|
||||
nullable=False,
|
||||
default="DE",
|
||||
index=True,
|
||||
)
|
||||
vat_id: Mapped[str | None] = mapped_column(
|
||||
String(20), nullable=True,
|
||||
String(20),
|
||||
nullable=True,
|
||||
)
|
||||
phone: Mapped[str | None] = mapped_column(
|
||||
String(50), nullable=True,
|
||||
String(50),
|
||||
nullable=True,
|
||||
)
|
||||
email: Mapped[str | None] = mapped_column(
|
||||
String(255), nullable=True,
|
||||
String(255),
|
||||
nullable=True,
|
||||
)
|
||||
website: Mapped[str | None] = mapped_column(
|
||||
String(255), nullable=True,
|
||||
String(255),
|
||||
nullable=True,
|
||||
)
|
||||
role: Mapped[str] = mapped_column(
|
||||
String(20), nullable=False, index=True,
|
||||
String(20),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
vat_id_status: Mapped[str] = mapped_column(
|
||||
String(20), nullable=False, default="ungeprueft",
|
||||
String(20),
|
||||
nullable=False,
|
||||
default="ungeprueft",
|
||||
)
|
||||
is_private: Mapped[bool] = mapped_column(
|
||||
Boolean, nullable=False, default=False,
|
||||
Boolean,
|
||||
nullable=False,
|
||||
default=False,
|
||||
)
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), nullable=False, server_default=func.now(),
|
||||
DateTime(timezone=True),
|
||||
nullable=False,
|
||||
server_default=func.now(),
|
||||
)
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True),
|
||||
@@ -104,7 +125,9 @@ class Contact(Base):
|
||||
onupdate=func.now(),
|
||||
)
|
||||
deleted_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True), nullable=True, index=True,
|
||||
DateTime(timezone=True),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
|
||||
contact_persons: Mapped[list["ContactPerson"]] = relationship(
|
||||
@@ -133,18 +156,10 @@ class Contact(Base):
|
||||
"role": self.role,
|
||||
"vat_id_status": self.vat_id_status,
|
||||
"is_private": self.is_private,
|
||||
"created_at": (
|
||||
self.created_at.isoformat() if self.created_at else None
|
||||
),
|
||||
"updated_at": (
|
||||
self.updated_at.isoformat() if self.updated_at else None
|
||||
),
|
||||
"deleted_at": (
|
||||
self.deleted_at.isoformat() if self.deleted_at else None
|
||||
),
|
||||
"contact_persons": [
|
||||
p.to_dict() for p in (self.contact_persons or [])
|
||||
],
|
||||
"created_at": (self.created_at.isoformat() if self.created_at else None),
|
||||
"updated_at": (self.updated_at.isoformat() if self.updated_at else None),
|
||||
"deleted_at": (self.deleted_at.isoformat() if self.deleted_at else None),
|
||||
"contact_persons": [p.to_dict() for p in (self.contact_persons or [])],
|
||||
}
|
||||
|
||||
|
||||
@@ -165,19 +180,25 @@ class ContactPerson(Base):
|
||||
index=True,
|
||||
)
|
||||
name: Mapped[str] = mapped_column(
|
||||
String(255), nullable=False,
|
||||
String(255),
|
||||
nullable=False,
|
||||
)
|
||||
function: Mapped[str | None] = mapped_column(
|
||||
String(100), nullable=True,
|
||||
String(100),
|
||||
nullable=True,
|
||||
)
|
||||
phone: Mapped[str | None] = mapped_column(
|
||||
String(50), nullable=True,
|
||||
String(50),
|
||||
nullable=True,
|
||||
)
|
||||
email: Mapped[str | None] = mapped_column(
|
||||
String(255), nullable=True,
|
||||
String(255),
|
||||
nullable=True,
|
||||
)
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), nullable=False, server_default=func.now(),
|
||||
DateTime(timezone=True),
|
||||
nullable=False,
|
||||
server_default=func.now(),
|
||||
)
|
||||
|
||||
contact: Mapped["Contact"] = relationship(back_populates="contact_persons")
|
||||
@@ -194,7 +215,5 @@ class ContactPerson(Base):
|
||||
"function": self.function,
|
||||
"phone": self.phone,
|
||||
"email": self.email,
|
||||
"created_at": (
|
||||
self.created_at.isoformat() if self.created_at else None
|
||||
),
|
||||
"created_at": (self.created_at.isoformat() if self.created_at else None),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user