The Item structure contains count values, one of which is unused.
Provide better APIs to ask questions about which items are in a location. We already have all the database functionality, and many existing types that can answer these questions, but the API isn't really there.
Stock queries:
[x] How many of a particular item do I have over all locations?
Answer: stockInLocationsCount LocationsAny (ItemExact item) anyOccurrence
[x] Assuming I have one or more instances of an item, where are they?
Answer: stockInLocations LocationsAny (ItemExact item) anyOccurrence
[x] What items are in a given location (including/not including descendants)?
Answer: stockInLocations (LocationExact location) ItemAny anyOccurrence
[x] What serial numbers exist for an item? (#93)
Answer: stockInLocations LocationsAny (ItemExact item) (Set SERIAL)
sealed interface LocationMatch
record LocationExact(Location location)
record LocationAndDescendants(Location location)
record LocationAny()
sealed interface StockOccurrence
record StockOccurrenceSet(Location location, ItemSummary item, long count)
record StockOccurrenceSerial(Location location, ItemSummary item, String serial)
enum StockOccurrenceKind { SET, SERIAL }
anyOccurrence :: Set
anyOccurrence = Set(SET, SERIAL)
stockInLocationsCount : LocationMatch -> ItemMatch -> Set -> Long
stockInLocations : LocationMatch -> ItemMatch -> Set -> List<Page>
Item repositing would be moved to stock repositing.
The Item structure contains count values, one of which is unused.
Provide better APIs to ask questions about which items are in a location. We already have all the database functionality, and many existing types that can answer these questions, but the API isn't really there.
Stock queries:
stockInLocationsCount LocationsAny (ItemExact item) anyOccurrence
stockInLocations LocationsAny (ItemExact item) anyOccurrence
stockInLocations (LocationExact location) ItemAny anyOccurrence
stockInLocations LocationsAny (ItemExact item) (Set SERIAL)
sealed interface StockOccurrence record StockOccurrenceSet(Location location, ItemSummary item, long count) record StockOccurrenceSerial(Location location, ItemSummary item, String serial)
enum StockOccurrenceKind { SET, SERIAL } anyOccurrence :: Set
anyOccurrence = Set(SET, SERIAL)
stockInLocationsCount : LocationMatch -> ItemMatch -> Set -> Long
stockInLocations : LocationMatch -> ItemMatch -> Set -> List<Page>