Skip to main content

Channel Mappings

Per-channel availability & pricing for meals, value-added services, promotions, bank offers and coupons. Backs the channel_meal, channel_value_added_service, channel_promotion, channel_bank_offer and channel_coupon tables.

📄️ Upsert a channel-meal mapping for one or more tags

Creates or overwrites the (channelId, mealId, tagName) row for every tag in `tagName`. The field takes an array, so one save can cover several tags — `'tagName': ['purple_coral', 'celest']` writes two mappings, each priced, enabled and deleted on its own. A bare string is still accepted and read as a one-element array. Blank entries and an empty array are rejected; repeated tags are collapsed. The response is always an array, one persisted mapping per tag, in the order supplied.

📄️ Re-apply every enabled channel mapping to the listings carrying its tag

Idempotent. Listing rows marked as overrides are left untouched. The returned counts are listings processed, not rows actually written — a listing already carrying an override is still counted even though the write is skipped. Covers tag-driven mappings only: an offer attached to a channel by listing (via ListingChannelOfferMappingService, keyed off channel_listing) rather than by tag is not re-applied by this backfill.

📄️ Reconcile tag fan-out

Removes listing-channel rows that no longer match any tag on the listing, then re-runs the fan-out. Rows marked as a per-listing override are never removed. Unlike /backfill, which only ever adds, this deletes — it is what repairs a listing whose tags changed while its mappings did not. Only meals and VAS are covered by the prune (promotions, bank offers and coupons can be attached straight to a channel with no tag involved, so an unjustified row for those three is not necessarily an orphan); the fan-out (add) side still covers all five. With `dryRun=true`, reports the same meals/VAS counts the real run would delete, per type, without deleting or fanning out anything.