Collapse the ORE import rollback's saved-entity lists into one ordered collection

Table of Contents

This page is a capture in the inbox bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.

1. What

The ORE import rollback request carries one string list per entity kind: saved_currency_iso_codes, saved_portfolio_ids, saved_book_ids and saved_trade_external_ids. Replace them with one ordered collection of kind-and-key entries — an enumerated kind beside its keys, or a flat list of key-value pairs. Adding a kind would then change one model field instead of four lists, two handlers and a wire name, and the order the rollback traverses would become explicit in the payload.

2. Why

Each list carries a different key type: an ISO code, a uuid, and (since PR 2 of the trading clean-up) the trade's external identifier. One ordered collection states that order once. The cost is that the rollback must still dispatch a different delete request per kind, so a generic bag trades a typed field for a stringly kind and moves exhaustiveness from the compiler to a switch. That is why the trading clean-up deferred it, and it is why the enumerated kind is the better of the two shapes.

3. References

4. See also

Emacs 29.3 (Org mode 9.6.15)