1'use strict';23// Coupon usage per order, as the imported order's appliedDiscounts.4//5// There is no standalone write: an applied discount rides in the Import Order body (entity6// ecom/order-applied-discount, preferredWrite importOrder). So this module turns a source order's7// coupon lines into `appliedDiscounts[]` entries for the order body, resolving each code through8// the coupon crosswalk. A code the crosswalk cannot resolve produces NO entry and one unresolved9// report line -- a dangling reference would name a coupon that does not exist on the target.10//11// Every entry is the `coupon` one-of variant, which is the only honest one here: the discount12// genuinely was a coupon redemption. The plugin-computed `merchantDiscount` variant is a13// different entity (ecom/discount-rule's records) and is not this module's business.