Is there a clean, reliable way to programmatically query historical inventory levels for an item and location? So far I've tried querying transactions and playing through them to compute a balance at a point in time, but that approach seems slow and error-prone. I'm looking for alternatives