ChicoState / ChicoState/PantryNode

Connect Stock Endpoint to Items and Transactions

Open
#200 0 comments 0 reactions 1 assignee Assigned to @briswells View on GitHub
Dominant language
TypeScript
Stars
3
Forks
34
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.