Channel Listings
Which listings each channel sells. Backs the channel_listing table — the membership itself, not the per-channel meal/offer overlays on top of it.
The row count is load-bearing. A channel with zero rows here is treated as not yet curated and matches EVERY listing. So the first mapping written to a channel narrows it from the whole catalogue to that one listing, and deleting a channel's last mapping widens it back to the whole catalogue. To stop a channel selling a listing while keeping it curated, upsert with isEnabled: false rather than deleting the row.
📄️ List channel-listing mappings by channel or by listing
Supply exactly one of `channelId` or `listingId`.
📄️ Map a listing to a channel
Creates or overwrites the (channelId, listingId) row. `isEnabled` defaults to true. If this is the channel's first mapping, the channel stops matching every listing.
📄️ Get one channel-listing mapping
Get one channel-listing mapping
📄️ Remove a channel-listing mapping
Deletes the row. To keep the channel curated while withdrawing one listing, upsert with `isEnabled: false` instead — removing a channel's last row makes it match every listing again.
📄️ Map many listings to one channel
Applied in a single transaction. Every listing id is validated before anything is written, so one bad id fails the whole batch.