Skip to content

Group inventory: add shared item merge and quantity transfer helpers #37

Description

@prodmodfour

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions