Mixed line and option representations
Separate quantities, charges, variants, parcels and explicit selection flags.
Separate quantity lines from amount-only charges
Preserve each line type without treating charges as stock quantities.
Turn discount fields into an explicit tagged choice
Distinguish a percentage, a fixed amount, zero and no discount.
Map known variant options and preserve unknown attributes
Reject repeated keys while retaining attributes outside the canonical variant.
Retain parcel membership while ordering parcel records
Keep empty parcels and each parcel’s own lines.
Convert explicit service flags into selected option keys
Keep false flags and require the full declared option set.