Paradaux

PAR-17

0

Ability to see space available in chestshops in API/UI on top of stock

PlannedrianTreasury APIFeature

Part of PAR-166 (spin out /find) — the remaining-capacity data-layer gap.

Show the space available in chestshops (free room in the container, on top of current stock) in the API/UI — for surfacing selling opportunities, and to power the legacy /find "hide full shops" filter and REMAINING_CAPACITY sort.

Technical notes — Only current_stock is captured/surfaced (chestshop_shop.current_stock, written by ChestShopMarketMapper.upsertShop/updateShopStockMarketApi.upsertShop/updateShopStock); there's no remaining-free-space column. For a SELL shop, buyers care about space left. The legacy chestshop-database stored this as Shop.estimated_capacity (computed by its own InventoryUtil.remainingCapacity).

⚠️ Correction for the implementer: ChestShop-3's com.Acrobot.Breeze.Utils.InventoryUtil does not have a remainingCapacity() method — it has getAmount(item, inv), fits(...), and countEmpty(inv). Compute free room ChestShop-side from those (empty slots × maxStack + partial-stack headroom for the item), the way MarketRecords.stockOf already calls InventoryUtil.getAmount.

Do:

  • Add a current_space (+ optional fixed capacity) column to chestshop_shop via a new economy-schema migration (highest today is V14 → add V15; do NOT edit V6).
  • Add the field to ChestShopShopRecord and a param to MarketApi.upsertShop/updateShopStock (+ the mapper write SQL).
  • Compute it in ChestShop-3's MarketRecords and surface it alongside stock in the market mapper/DTO and the public REST (PAR-116).

Resources

Comments

tesks · Jun 4, 2026, 9:57 AM

Code context — Only current_stock is captured/surfaced (chestshop_shop.current_stock, written by ChestShopMarketMapper.upsertShop/updateShopStock); there's no remaining-free-space column. For a SELL shop, buyers care about space left (how many more it can buy), which isn't recorded. ChestShop-3 InventoryUtil.fits/getAmount already compute free room at the source.

Approach: add a current_space (+ capacity) column to chestshop_shop and a param to upsertShop/updateShopStock, compute it ChestShop-side via InventoryUtil, and surface it alongside stock in the market mapper/DTO.

Activity

  • ParadauxIO linked a commit — Commit 6902bdf — Add the /find shop-registry read API + schema foundation (PAR-5)
  • tesks description: Description updated
  • tesks changed status to Status → Planned
  • tesks description: Description updated
  • tesks description: Description updated
  • tesks commented
  • tesks assigned Assigned to rian