F102 — Two-Balance Wallet System
Business Rule
Every registered player holds two separate balances:
Flow:
- Player sits at a table → buy-in amount deducted from account, credited as seat chips
- Player tops up during a session → amount deducted from account, added to seat chips
- Player presses Back to Lobby → all remaining seat chips automatically credited back to account
- If player loses all chips mid-session → can top up from account without leaving the table
Technical Design
Database
API endpoints
Client integration (game-shell.html)
The compliance bar’s Lobby button is intercepted:tableId is extracted from the game iframe URL (?tableId=N). If the player is anonymous or no tableId is present, navigation proceeds immediately without calling leave.
localStorage session shape
balance is stored in pence (integer). £1,000 = 100000. Updated after leave and after fetchPlayerProfile().
Acceptance Criteria
Version Parity
Related
POST /api/tables/{tableId}/sit— buy in to a tablePOST /api/tables/{tableId}/leave— cash out chips back to walletPOST /api/tables/{tableId}/topup— top up chips during a sessionGET /api/players/{playerId}— read account balance- F016 — Credits wallet — in-game chip balance display
- HEDGE-187 · HEDGE-190 (lobby / cashier page)