from django.contrib import admin

from .models import Trip


@admin.register(Trip)
class TripAdmin(admin.ModelAdmin):
    list_display = ("date", "trip_type", "start_location", "end_location", "distance_miles", "distance_source", "updated_at")
    list_filter = ("trip_type", "distance_source", "date")
    search_fields = ("start_location", "end_location", "business_purpose", "notes")
    ordering = ("-date", "-start_time", "-created_at")
