fix: ruff lint + format fixes in tests, ESLint fixes in frontend

This commit is contained in:
2026-07-17 21:28:58 +02:00
parent 341d0c6f38
commit fbb1b39b57
56 changed files with 1399 additions and 721 deletions
+13 -39
View File
@@ -56,12 +56,8 @@ class Vehicle(Base):
__tablename__ = "vehicles"
__table_args__ = (
CheckConstraint(
"char_length(fin) = 17", name="ck_vehicles_fin_length"
),
CheckConstraint(
"condition IN ('new', 'used')", name="ck_vehicles_condition"
),
CheckConstraint("char_length(fin) = 17", name="ck_vehicles_fin_length"),
CheckConstraint("condition IN ('new', 'used')", name="ck_vehicles_condition"),
CheckConstraint(
"availability IN ('available', 'reserved', 'sold')",
name="ck_vehicles_availability",
@@ -87,24 +83,18 @@ class Vehicle(Base):
String(17), unique=True, nullable=False, index=True
)
year: Mapped[int | None] = mapped_column(Integer, nullable=True)
first_registration: Mapped[date | None] = mapped_column(
Date, nullable=True
)
first_registration: Mapped[date | None] = mapped_column(Date, nullable=True)
power_kw: Mapped[int | None] = mapped_column(Integer, nullable=True)
power_hp: Mapped[int | None] = mapped_column(Integer, nullable=True)
fuel_type: Mapped[str | None] = mapped_column(String(50), nullable=True)
transmission: Mapped[str | None] = mapped_column(String(20), nullable=True)
color: Mapped[str | None] = mapped_column(String(50), nullable=True)
condition: Mapped[str] = mapped_column(
String(20), nullable=False, default="used"
)
condition: Mapped[str] = mapped_column(String(20), nullable=False, default="used")
location: Mapped[str | None] = mapped_column(String(255), nullable=True)
availability: Mapped[str] = mapped_column(
String(20), nullable=False, default="available"
)
price: Mapped[Decimal] = mapped_column(
Numeric(12, 2), nullable=False
)
price: Mapped[Decimal] = mapped_column(Numeric(12, 2), nullable=False)
vehicle_type: Mapped[str] = mapped_column(String(20), nullable=False)
lkw_type: Mapped[str | None] = mapped_column(String(50), nullable=True)
machine_type: Mapped[str | None] = mapped_column(String(50), nullable=True)
@@ -112,9 +102,7 @@ class Vehicle(Base):
operating_hours: Mapped[Decimal | None] = mapped_column(
Numeric(12, 1), nullable=True
)
operating_hours_unit: Mapped[str | None] = mapped_column(
String(5), nullable=True
)
operating_hours_unit: Mapped[str | None] = mapped_column(String(5), nullable=True)
mileage_km: Mapped[int | None] = mapped_column(Integer, nullable=True)
description: Mapped[str | None] = mapped_column(Text, nullable=True)
created_at: Mapped[datetime] = mapped_column(
@@ -149,9 +137,7 @@ class Vehicle(Base):
"fin": self.fin,
"year": self.year,
"first_registration": (
self.first_registration.isoformat()
if self.first_registration
else None
self.first_registration.isoformat() if self.first_registration else None
),
"power_kw": self.power_kw,
"power_hp": self.power_hp,
@@ -174,15 +160,9 @@ class Vehicle(Base):
"operating_hours_unit": self.operating_hours_unit,
"mileage_km": self.mileage_km,
"description": self.description,
"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
),
"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),
}
@@ -232,14 +212,8 @@ class MobileDeListing(Base):
"vehicle_id": str(self.vehicle_id),
"ad_id": self.ad_id,
"sync_status": self.sync_status,
"synced_at": (
self.synced_at.isoformat() if self.synced_at else None
),
"synced_at": (self.synced_at.isoformat() if self.synced_at else None),
"error_log": self.error_log,
"created_at": (
self.created_at.isoformat() if self.created_at else None
),
"updated_at": (
self.updated_at.isoformat() if self.updated_at else None
),
"created_at": (self.created_at.isoformat() if self.created_at else None),
"updated_at": (self.updated_at.isoformat() if self.updated_at else None),
}