Goal
Move item quantities from the shared group inventory into a trainer sheet atomically.
Scope
- Add a use case and API route for group-to-trainer transfers.
- Accept
groupSlug, groupRevision, trainerSlug, trainerRevision, section, itemId, and quantity.
- In one SQLite transaction:
- read the group inventory and trainer sheet;
- validate both revisions;
- decrement/remove the group row;
- merge the item into the trainer inventory section;
- increment both document revisions;
- return the authoritative group inventory and trainer sheet update.
- 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 trainer, and equipment partial-transfer cases are rejected clearly.
- Tests prove rollback when the second write fails.
Depends on
Goal
Move item quantities from the shared group inventory into a trainer sheet atomically.
Scope
groupSlug,groupRevision,trainerSlug,trainerRevision,section,itemId, andquantity.Acceptance criteria
Depends on