acdlite's Description of Work
Small refactor to prepare for Ledgers.
Changes the type of the value in object deduping map (writtenObjects) from string (a reference to an object already written to the response) to {id: number, reference: string} instead. reference is the same string as before, and id is the row ID of the object.
The motivation is so a consumer of the dedupe map can access the row ID of the deduped object. For Ledgers, this allows us to also reuse the corresponding Ledger entries.
The original reference is kept in the map, too, since it encodes additional information about the reference besides just the row id.
An alternative considered was changing the type to string | {id: string, reference: number} but this results in additional type checks whenever the map is accessed, and also means the map is no longer monomorphic.