Some checks failed
Deploy to Production / test (push) Failing after 33s
- Rewrite AGENTS and README files to match the current app layout - Document API routes, trivia UI, and the active panel design language
823 B
823 B
Trade module
Model
- trade sessions are in-memory only
- sessions are keyed by Discord thread ID
- there is no persistence or restart recovery
Main methods
createSession()getSession()endSession()updateMoney()addItem()removeItem()toggleLock()executeTrade()clearSessions()
Rules
- any change to money or items unlocks both participants
executeTrade()requires both users to be locked- money transfer goes through
economyService.modifyUserBalance() - item transfer goes through
inventoryService.removeItem()andaddItem() - item transfers are also logged in
item_transactions
Notes
_sessionsis intentionally exposed for tests- type definitions live under
bot/modules/trade/trade.types.ts, while the service stays inshared/modules/trade