Lotto Pool Prize Test Interface

Pool Prize Processing
Monitoring
Documentation

Pool Prize Processing

This interface allows you to manually trigger the pool prize processing for lotto tournaments.

Monitoring

Monitor the status of pool prize processing and related metrics.

Documentation

How Pool Prize Processing Works

The pool prize processor automatically adds active lottery tickets to the prize pool for each tournament. It runs every minute to ensure tickets are processed in real-time.

Processing Workflow

  1. Identify Active Tournaments - Finds all tournaments with `isActive = 1` and `display = 1`
  2. Find Eligible Tickets - Locates tickets with `isActive = 1` and `addedToThePoolPrize = false`
  3. Random Selection - Randomly selects a subset of eligible tickets (up to 10% of total)
  4. Update Tickets - Sets `addedToThePoolPrize = true` for selected tickets
  5. Update Tournament - Adds ticket prices to `totalRegistrationAmount` for the tournament

Processing Algorithm

Each minute, the processor:

Setup Instructions

Method 1: Using Shell Script (Recommended for Production)
  1. Make the shell script executable:
    chmod +x cron/run_lotto_pool_prize.sh
  2. Add to crontab to run every minute:
    * * * * * /path/to/wingobingiadminapi/cron/run_lotto_pool_prize.sh
Method 2: Using npm script
npm run cron:lotto-pool-prize
Method 3: Direct TypeScript execution
npx ts-node cron/lotto_pool_prize.ts