Goal
Add pure helpers for moving item quantities between inventory documents before wiring server routes.
Scope
- Add utility functions for:
- finding a group inventory row by section and row ID;
- decrementing or removing a source row;
- merging stackable rows by normalized item identity;
- treating equipment rows as whole-row transfers;
- moving money between documents if money transfer is included.
- Keep helpers pure and independent from SQLite/API code.
- Reuse trainer inventory section keys and entry types where possible.
Acceptance criteria
- Unit tests cover stackable item transfer, exact-quantity removal, partial decrement, equipment whole-row transfer, invalid quantities, missing rows, and name normalization.
- Helpers do not mutate their inputs unless explicitly documented and tested.
- No HTTP routes or UI are added in this ticket.
Depends on
Goal
Add pure helpers for moving item quantities between inventory documents before wiring server routes.
Scope
Acceptance criteria
Depends on