"""Filters for GET /api/auth/notifications/ (profile alerts only)."""

# Stored lowercase via notify_users (event_type.lower()).
AUTH_NOTIFICATION_EXCLUDED_TYPES = frozenset({
    # Bidding
    'bid_accepted',
    'bid_agreed',
    'bid_countered',
    'bid_rejected',
    'new_bid',
    # Trips & assignment
    'trip_assigned',
    'trip_status',
    'pod_submitted',
    # Trip-linked payments
    'payment_received',
    'payment_pending_cod',
    'payment_pending_card',
    'payment_captured',
    # Load discovery / rate requests
    'nearby_load',
    'rate_request',
    # Chat
    'new_message',
})


def auth_profile_notifications_queryset(user_id):
    """In-app notification feed: profile/compliance only (e.g. document expiry)."""
    from core.models import Notification

    return (
        Notification.objects.filter(user_id=user_id)
        .exclude(type__in=AUTH_NOTIFICATION_EXCLUDED_TYPES)
        .order_by('-created_at', '-id')
    )
