| 01-tournament-engine |
06 |
financial |
| int64 |
| poker |
| buyin |
| rebuy |
| payout |
| bounty |
| pko |
| receipt |
| audit |
| rake |
|
| phase |
provides |
| 01-tournament-engine/plan-03 |
audit trail and undo engine |
|
| phase |
provides |
| 01-tournament-engine/plan-05 |
buyin configs with rake splits, payout structures with brackets |
|
|
| Financial transaction engine (buy-in, rebuy, add-on, re-entry) |
| PKO bounty transfer with half-split chain tracking |
| Prize pool calculation from all transaction types |
| Payout distribution with int64 rounding (round DOWN, remainder to 1st) |
| CI gate test proving sum(payouts) == prize_pool across 10,000+ inputs |
| Bubble prize proposal/confirm with proportional shaving |
| Receipt generation with sequential numbering and reprint |
| Late registration with level AND time cutoffs plus admin override |
| Season reserve tracking via rake split categories |
| Financial API routes (prize-pool, payouts, transactions, receipts) |
|
| 01-tournament-engine/plan-07 |
| 01-tournament-engine/plan-09 |
| 01-tournament-engine/plan-12 |
|
| added |
patterns |
|
|
| int64 cents for all monetary values (zero float64) |
| Round DOWN to venue denomination, remainder to 1st place |
| Property-based CI gate test with 10,000+ random payout combinations |
| Rake split transactions per category (house, staff, league, season_reserve) |
| Proportional rake scaling for rebuy/addon (different rake amounts) |
|
|
| created |
modified |
| internal/financial/engine.go |
| internal/financial/engine_test.go |
| internal/financial/payout.go |
| internal/financial/payout_test.go |
| internal/financial/receipt.go |
| internal/server/routes/financials.go |
|
|
|
| PKO bounty half-split uses integer division (half = bountyValue/2, remainder stays with bounty portion) |
| Unique entry count for bracket selection uses COUNT(DISTINCT player_id) on non-undone buyin transactions |
| Rebuy/addon rake splits are proportionally scaled from buyin rake splits |
| Receipt number is sequential per tournament (COUNT of existing receipts + 1) |
| Bubble prize shaves proportionally from top 3 positions, extending to 5 if needed |
| Late reg checks level AND time cutoffs independently (either exceeded closes registration) |
|
| Financial engine pattern: load tournament info, load buyin config, validate, create transaction, audit, broadcast |
| CalculatePayoutsFromPool is a pure function for testability and CI gate |
| Transaction undo marks undone=1 and reverses player state effects |
|
| FIN-03 |
| FIN-04 |
| FIN-07 |
| FIN-08 |
| FIN-09 |
| FIN-12 |
| FIN-13 |
| FIN-14 |
|
9min |
2026-03-01 |