Group Tezos tickets by issuer, type and contents
Two Tezos tickets can display the same label and still represent different assets. A ticket ledger needs the complete identity before adding quantities.
Build an identity key before summing
The illustrative entries below contain a ticketer alias, contents type, contents value and amount. Replace aliases with full contract addresses in a real index. Compare typed contents using a consistent Michelson representation.
(KT1-A, string, "seat-12", 2)
(KT1-B, string, "seat-12", 1)
The first issuer has two units and the second issuer one. Combining them into three interchangeable seats loses provenance. Even one issuer can make distinct tickets by issuing different content values or types.
Track ownership separately from identity
The account or contract holding a ticket can change while the ticketer remains the same. Splitting and joining quantities also affects amounts without changing ticket identity. Inspect successful operation results before updating owner balances. octez.tezos.com Octez protocol documentation