You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a "/stock" endpoint that returns current amounts of items.
Item amounts are already tracked if someone flattens all of the transactions for each item.
By "flatten" we mean, there might be a transaction that donates 3 bananas and 5 cans of beans. Then 2 cans and 1 banana were "purchased" or "thrown own". If you combine (+3 -1) bananas and (+5 -2) cans of beans, you'll get a current stock of 2 bananas and 3 cans of beans.
There is a suggestion to have a nightly job that handles this.
Please look into how to set that up, or come up with a model-based query that relies only on the transactions.
The text was updated successfully, but these errors were encountered:
Jooms
changed the title
Update Stock endpoint to factor-in items that have been thrown-away or purchased
Connect Stock Endpoint to Items and Transactions
Apr 27, 2023
We have a "/stock" endpoint that returns current amounts of items.
Item amounts are already tracked if someone flattens all of the transactions for each item.
By "flatten" we mean, there might be a transaction that donates 3 bananas and 5 cans of beans. Then 2 cans and 1 banana were "purchased" or "thrown own". If you combine (+3 -1) bananas and (+5 -2) cans of beans, you'll get a current stock of 2 bananas and 3 cans of beans.
There is a suggestion to have a nightly job that handles this.
Please look into how to set that up, or come up with a model-based query that relies only on the transactions.
The text was updated successfully, but these errors were encountered: