Goal
Move item quantities from a trainer sheet back into the shared group inventory atomically.
Scope
- Add a use case and API route for trainer-to-group transfers.
- Accept
trainerSlug, trainerRevision, groupSlug, groupRevision, section, a trainer row identifier or row index, and quantity.
- In one SQLite transaction:
- read the trainer sheet and group inventory;
- validate both revisions;
- decrement/remove the trainer row;
- merge the item into the group inventory section;
- increment both document revisions;
- return the authoritative trainer sheet update and group inventory.
- Start with GM-only access in this ticket.
Acceptance criteria
- Successful transfer updates both documents atomically.
- If either revision is stale, neither document changes.
- Invalid quantity, missing row, missing group inventory, and equipment partial-transfer cases are rejected clearly.
- Tests cover stackable and equipment transfers.
Depends on
Goal
Move item quantities from a trainer sheet back into the shared group inventory atomically.
Scope
trainerSlug,trainerRevision,groupSlug,groupRevision,section, a trainer row identifier or row index, andquantity.Acceptance criteria
Depends on