function toModifierRefs
toModifierRefs(specs: CheckoutIntent["modifiers"]): ModifierRef[] | undefined

Compact the resolved modifier specs to id/quantity references for metadata.

Every trigger (automatic, code, opt-in add-on, and answer) is carried the same way — its modifier id and the resolved quantity — and the webhook re-fetches each by id, re-checking eligibility (the returning-customer visit gate) and re-deriving the amount, so provider metadata amounts are never trusted. Answer-triggered modifiers are ordinary modifier rows now, so their ids can't collide with anything: the resolved (stock-clamped) quantity stored here is exactly what the webhook re-prices, keeping the two totals identical.

Parameters

specs: CheckoutIntent["modifiers"]

Return Type

ModifierRef[] | undefined

Usage

import { toModifierRefs } from "doc.ts";