Repository navigation
Merged
Conversation
Runs at start-up and every ten minutes. Until the day has passed, the organizer can still give a market a new closing time.
GET /bet/activity lists every slip played, every market decided or called off and every scratch card scratched to the end, the newest first, a page at a time and optionally one kind only.
They still see the market, but not its odds or how the coins on it are spread, and the latest bets, member pages and the activity log leave out the odds of bets on it too. A member's own slips keep theirs.
POST /bet/flaks/:game/try draws a ticket by the same odds as a real one and returns every field at once. Nothing is kept, no coins are taken and no prize is paid.
Each decided market comes with every slip that had a pick on it: the pick, its odds, whether it came true and what the slip won or lost all told, winners first. A member kept out of the market sees neither the odds nor what a winner got.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved moderate hidden-odds and activity-pagination issues remain.
Review effort: Lite
Findings: 4
Open (4)
What changed in this PR
Adds activity history, hidden-odds handling, free scratch-card trials, live-stake accounting, and automatic cleanup of unplayed markets.
Changes:
- Adds filtered, paginated activity and scratch-card endpoints.
- Masks excluded-market odds, distributions, totals, and payouts.
- Counts only open slips and schedules unplayed-market cleanup.
| File | Review summary |
|---|---|
test/api.test.ts |
Covers the new activity, hidden-odds, free-ticket, and stake behaviors. |
src/server.ts |
Adds scheduled market cleanup. |
src/flaks.ts |
Generates free scratch-card trials. |
src/bets.ts |
Moderate issues: owner odds exception is missing; hidden-market aggregates and payouts remain exposed. |
src/betRoutes.ts |
Adds activity and scratch-card routes. |
src/activity.ts |
Moderate issues: timestamp cursor ties can skip entries; own historical odds are hidden; hidden combination totals can leak odds; exact-page pagination returns a phantom next; timestamp-only ordering can split slips. |
README.md |
Documents the updated API and behavior. |
dev/demo.ts |
Updates demo handling for hidden odds. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
oskarlarsen
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
GET /bet/activitylists every slip played, every market decided or called off and every scratch card scratched to the end, newest first. Older pages with?before=, one kind with?kind=slip|result|ticket. Each result lists everyone who played on it: their pick, odds, whether it came true and what the slip won or lost all told. Combinations say how many picks they have and how many of their markets were called off.POST /bet/flaks/:game/trydraws a ticket by the real odds and returns every field. Nothing is stored, taken or paid.Testing
npm run typecheckandnpm test(20 tests). New tests cover the activity log, a lost combination's stake, hidden odds and free tickets.Deploy
Merging deploys it. The site PR (TEBONSMA/tebbet,
fixes) uses the new endpoints, so merge this one first.