Listing Badges
Manage badges attached to listings (e.g. BEST_SELLER, FEATURED, TRENDING). Keyed by (listingId, badgeType); upsert overwrites. Badges with expiresAt in the past are filtered from reads and cleaned up by the expired-cleanup endpoint.
📄️ List badges for a listing
Returns all non-expired badges for the given listing.
📄️ Upsert a badge
Creates or overwrites the badge row for the given (listingId, badgeType).
📄️ List badges by badge type
Returns all non-expired badges of the given type across all listings.
📄️ Upsert badges in batch
Bulk-upsert badges. Each row is keyed by (listingId, badgeType).
📄️ Delete one badge
Deletes the badge row identified by (listingId, badgeType). No-op if absent.
📄️ Delete expired badges
Housekeeping: removes badge rows whose `expiresAt` is in the past. Returns the deletion count.
📄️ Delete all badges for a listing
Removes every badge row attached to the given listing.