Predictions
1. What this page does
The Predictions page (/activities/prediction) allows administrators to create and manage promotional prediction events in the website lobby, covering sports (e.g. football), boxing matches, and lottery draws. Administrators can configure matchups, upload banners and competitor artwork, schedule prediction open and close deadlines, define prize payouts (points, tickets, or diamonds), reorder cards in the lobby, and record official results so the system automatically evaluates winners and disburses rewards. In addition, administrators can review performance analytics and player prediction submission logs.
Related routes in the system include:
/activities/prediction— Main prediction activities list and report tab./activities/prediction/new— Create a new prediction activity./activities/prediction/[id]— Activity details page, overview stats, pick distribution summary, and result announcement./activities/prediction/[id]?tab=edit(or/activities/prediction/[id]/edit) — Edit prediction activity details./activities/history— Automatically redirects to the report tab (/activities/prediction?tab=report).
2. Before you start
- Required Permissions:
- You must have the 'Prediction' permission (
activities_prediction) to view, create, edit, reorder, and announce results for prediction activities. - You must have the 'Prediction - report and history' permission (
activities_history) to access the overall report and reward distribution logs.
- You must have the 'Prediction' permission (
- Activity Categories (3 Types):
- Football (Sport): Configure Home and Away teams; supports scorelines, first goal, and draw outcomes.
- Boxing: Configure Red Corner and Blue Corner fighters; supports winning fighter and victory method (knockout or on points).
- Lottery (Lotto): Players predict 3-digit and 2-digit numbers.
- Prerequisites:
- Banner Artwork: Recommended size is 1280 × 720 px (16:9 ratio) in PNG, JPG, or WEBP format up to 5 MB.
- Competitor Artwork (Side 1 and Side 2): Recommended size is 400 × 400 px (square).
- Schedule: Set Start Date, End Date (prediction deadline), and Result Announcement Date.
- Rewards: Specify the amount of points, tickets, or diamonds awarded to winning players.
3. Screen layout
The interface operates on two tiers:
1. Main Predictions Page (/activities/prediction)
Contains two primary tabs:
- Activities Tab: Main table listing all prediction events with lobby display order, category badges, phase statuses, schedules, reward chips, visibility toggles, and action menus.
- Report & Rewards Tab: Overall participation metrics, winner statistics, rewards disbursed, trend charts, category breakdowns, and top winning players.
2. Activity Detail Page (/activities/prediction/[id])
Contains two sub-tabs:
- Overview Tab:
- Summary Cards: Total entries, winners, rewards disbursed, and current activity phase.
- Announce Result Card: Interface to enter official match or lottery outcomes and preview expected winner counts.
- Pick Summary Card: Visual distribution breakdown showing player pick proportions per side.
- Prediction Entries Table: Searchable list of every player who submitted a prediction, with winning/losing outcomes and CSV export.
- Edit Tab: Form to adjust titles, text, schedules, artwork, and rewards (editable before results are announced).
4. Search and filters
Filters on Activities Tab (Main Page)
| Field / Filter | Type | Options / How to use | Result |
|---|---|---|---|
| Search activities... | Text input | Type activity title in Thai or English | Filters table to matching prediction events. |
| Phase Filter Tabs | Filter tabs | Select: All, Open, Awaiting result, Announced, or Deleted | Filters activities by operational phase. |
| Category | Dropdown | Select: All, Football, Boxing, or Lottery | Filters by activity type. |
| Visibility | Dropdown | Select: All, Shown on lobby, or Hidden | Filters by lobby visibility status. |
| Result Date | Date range picker | Select start and end result dates | Displays activities scheduled to announce results within the date window. |
Filters on Prediction Entries Table (Detail Page)
| Field / Filter | Type | Options / How to use | Result |
|---|---|---|---|
| Search player... | Text input | Type player username | Finds specific entries submitted by that player. |
| Result Status | Dropdown | Select: All, Won, or Lost | Filters entries by winning or losing outcome. |
5. Data tables
1. Prediction Activities Table (Main Page)
| Column | What you see | Meaning | Badge or Symbol |
|---|---|---|---|
| Order | Lobby order number with up/down arrows | Display sequence seen by players in the lobby | Circular number button; click to reposition directly |
| Activity | Banner thumbnail, activity title, and category | Event details and competitor matchup | • Blue: Football • Orange: Boxing • Purple: Lottery |
| Phase | Current phase badge | Operational status of the activity | • Green: Open • Yellow: Awaiting result • Blue: Announced • Gray: Deleted |
| Schedule | Start – End dates and Result date | Timestamps for submission window and announcement | Standard date/time format |
| Rewards | Reward badges (e.g. 100 Points, 1 Ticket) | Rewards granted to each winning entry | Orange, blue, or purple badges |
| Last Edited | Date, time, and admin updater name | Audit trail of latest update | Standard date and username |
| Visibility | Switch toggle or Deleted badge | Lobby visibility switch | • Green switch: Shown on lobby • Gray switch: Hidden |
| Actions | 3-dots action menu | Action triggers | Options: View details, Edit, or Delete |
2. Prediction Entries Table (Activity Detail Page)
| Column | What you see | Meaning | Badge or Symbol |
|---|---|---|---|
| Predicted At | Timestamp (e.g. 21/10/2026, 18:00) | Time when the player confirmed their prediction | Standard date/time format |
| Player | Player username (e.g. ball_fan99) | Player account that entered the activity | Bold username text |
| Pick | Pick description (e.g. Liverpool 2-1) | Side or scoreline chosen by the player | Detailed pick description |
| Result | Entry status badge | Outcome comparison against official result | • Green: Won • Gray: Lost • Yellow: Waiting |
| Reward | Reward badges paid out | Items credited to the winning player's wallet | Orange, blue, or purple badges |
6. Step-by-step
1. Creating a new prediction activity
- Navigate to Activities > Predictions in the Activities tab.
- Click Create activity at the top right.
- In the Category section, select: Football, Boxing, or Lottery.
- In the General Information section:
- Enter Title (Thai) (required, e.g.
ทายผล แดงเดือด แมนยู พบ ลิเวอร์พูล). - Enter Title (English) (optional, e.g.
Man Utd vs Liverpool Prediction). - Enter Subtitle (Thai/English) for summary text on the lobby card.
- Enter Description and rules (Thai/English) using the bilingual rich-text editor.
- Enter Title (Thai) (required, e.g.
- In the Matchup & Sides section:
- For Football or Boxing:
- Enter Side 1 name (e.g. Home Team) and upload image (400x400 px).
- Enter Side 2 name (e.g. Away Team) and upload image (400x400 px).
- For Lottery: Enable 3-digit and/or 2-digit prediction choices.
- For Football or Boxing:
- In the Schedule section:
- Set Start date: When predictions open.
- Set End date: When prediction submissions close.
- Set Result date: When the official outcome is announced.
- In the Rewards section:
- Click add reward, select reward type (Points, Tickets, or Diamonds), and enter quantity.
- In the Artwork & Lobby section:
- Upload Banner image (1280x720 px, up to 5 MB).
- Set Keep on lobby after announcing (e.g.
3days) to keep results visible before auto-hiding.
- Verify the Shown on lobby switch on the right side card and click Save.
2. Announcing results and automated payouts
- When the prediction submission deadline passes, the activity transitions to Awaiting result (
awaiting). - Click the activity title in the table to open its detail page (
/activities/prediction/[id]). - In the Overview tab, locate the Announce Result card at the top.
- Input the official outcome:
- For Football/Boxing: Select the winning side (Side 1, Side 2, or Draw).
- For Lottery: Enter the official winning digits.
- The system immediately calculates and previews the expected winner count.
- Click Announce result.
- In the confirmation dialog, review the outcome and total winners count, then confirm.
- The system executes two actions immediately:
- Updates activity phase to Announced (Blue).
- Automatically credits rewards (points, tickets, or diamonds) directly into winning players' wallets.
3. Reordering activities in the lobby
- In the main activities table, locate the Order column.
- Reorder activities using:
- The Move up or Move down arrow buttons to shift position step-by-step.
- Or click the circular order number badge to open the reposition dialog and enter a target place directly.
- Position 1 appears first in the player lobby.
4. Deleting a prediction activity
- Toggle the Shown on lobby switch to Hidden (Gray).
- Click the 3-dots action menu and select Delete.
- Confirm deletion in the prompt. The activity moves to the Deleted tab.
5. Exporting prediction entries to CSV
- In the activity detail page (
/[id]), scroll to the Prediction entries section. - Apply result filters (e.g. show only winning entries) if desired.
- Click Export CSV at the top right of the table.
- The system downloads the entries file to your computer.
7. Edit / Add forms
Form fields on creation (/new) and edit (/[id]?tab=edit) pages include:
| Section | Field | Required? | What to enter | Rules & Constraints |
|---|---|---|---|---|
| Category | Type | Required | Football, Boxing, or Lottery | Immutable after creation |
| General Info | Title (Thai) | Required | Activity title in Thai | Max 255 characters |
| Title (English) | Optional | Activity title in English | Max 255 characters (falls back to Thai name) | |
| Subtitle | Optional | Short description | Shown below title on lobby card | |
| Description | Optional | Rules and details | Rich-text up to 20,000 characters | |
| Matchup | Side 1 / Side 2 | Required (Sport/Boxing) | Team or fighter names | Max 100 characters per side |
| Side artwork | Optional | Competitor logo or photo | Square 400x400 px recommended | |
| Schedule | Start date | Required | Submission window opening | Must be before End date |
| End date | Required | Submission window closing | Must be after Start date and before Result date | |
| Result date | Required | Outcome announcement date | Must be after End date | |
| Rewards | Reward type | Required | Points, Tickets, or Diamonds | At least 1 reward required |
| Amount | Required | Quantity per winning entry | Whole number >= 1 | |
| Artwork | Banner image | Required | Main banner graphic | PNG, JPG, or WEBP up to 5 MB (1280x720) |
| Lobby days | Required | Days shown on lobby post-announcement | Choice between 0 and 30 days (default 3) | |
| Right Card | Visibility | Required | Display toggle | Shown on lobby (Green) or Hidden (Gray) |
8. Popups and dialogs (Popup / Modal)
1. Announce Result Confirmation Dialog
- When it opens: When clicking Announce result on the announcement card.
- What you see: Match outcome summary, total winning entries count, and warning that announcement is irreversible.
- What to do: Carefully verify official results, then confirm.
- Result: Marks activity as Announced and disburses rewards automatically.
2. Move to Place Dialog
- When it opens: When clicking the circular order number in the activities table.
- What you see: Selector of available lobby placement slots.
- What to do: Select the desired destination number and confirm.
- Result: Moves activity to the chosen position and shifts other cards.
3. Delete Activity Confirmation Dialog
- When it opens: When selecting Delete on an inactive activity.
- What you see: Warning prompt stating the activity will be removed from the lobby.
- What to do: Confirm deletion.
- Result: Moves activity to the Deleted archive.
4. Version Conflict Dialog
- When it opens: When saving an activity that was modified by another administrator simultaneously.
- What you see: Outdated version alert.
- What to do: Click Load latest to fetch latest changes, then re-apply edits.
- Result: Prevents concurrent edit overwrites.
9. Statuses and badges
1. Activity Operational Phases
| Phase Badge | Color | Meaning | Next Action |
|---|---|---|---|
| Open | Green | Activity is currently accepting predictions in the lobby. | Monitor participant activity. |
| Awaiting result | Yellow | Deadline closed; awaiting official result announcement. | Admin enters official outcome and announces. |
| Announced | Blue | Official outcome announced and rewards disbursed. | Completed terminal state. |
| Deleted | Gray | Activity was archived. | Read-only audit state. |
2. Category Badges
| Category | Badge Color | Typical Example |
|---|---|---|
| Football (Sport) | Blue | Major football derbies, league matches |
| Boxing | Orange | Championship title fights |
| Lottery (Lotto) | Purple | Government lottery 3-digit and 2-digit draws |
3. Entry Outcome Badges
| Result Badge | Color | Meaning |
|---|---|---|
| Won | Green | Player's pick matched official outcome; rewards credited. |
| Lost | Gray | Player's pick did not match official outcome. |
| Waiting | Yellow | Activity has not yet announced official outcome. |
10. Frequently asked questions / Troubleshooting
- Can announced results be modified or revoked?
- No. Announcing results triggers automated instant wallet credits (points, tickets, or diamonds) to winning accounts. Always double-check official scores before confirming.
- Why are certain activities locked from editing?
- Activities in the Announced or Deleted phases are permanently locked in read-only mode to safeguard financial and historical integrity.
- Why is the Announce Result button disabled?
- Results can only be entered once the submission window closes and the activity enters Awaiting result. It cannot be announced while still in the Open phase.
- How long does an announced activity remain visible in the lobby?
- It stays visible for the duration configured in Keep on lobby after announcing (e.g. 3 days), allowing players to inspect winning results before auto-hiding.