Publish curated MobilityOps source snapshot

This commit is contained in:
Jens committed 2026-09-29 22:03:33 +02:00
commit 7adc072f5e
317 files changed
+48851

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import uuid
from datetime import datetime
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import Mapped, mapped_column
from app.core.db import Base
from app.models.mixins import TimestampMixin, UUIDPrimaryKeyMixin
INSPECTION_TYPES = ("checkout", "return")
class Inspection(UUIDPrimaryKeyMixin, TimestampMixin, Base):
__tablename__ = "inspections"
public_ref: Mapped[str] = mapped_column(String(20), unique=True, nullable=False)
booking_id: Mapped[uuid.UUID] = mapped_column(
UUID(as_uuid=True), ForeignKey("bookings.id"), nullable=False
)
vehicle_id: Mapped[uuid.UUID] = mapped_column(
UUID(as_uuid=True), ForeignKey("vehicles.id"), nullable=False
)
type: Mapped[str] = mapped_column(String(20), nullable=False)
fuel_level_percent: Mapped[int] = mapped_column(Integer, nullable=False)
cleanliness_ok: Mapped[bool] = mapped_column(Boolean, nullable=False)
damage_reported: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
technical_warning: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
notes: Mapped[str | None] = mapped_column(Text)
odometer_km: Mapped[int] = mapped_column(Integer, nullable=False)
completed_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False)
completed_by: Mapped[str | None] = mapped_column(String(120))