1. 02 Feb, 2026 25 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Fix incremental reports sync and template error · e69c15ea
      Stefy Lanza (nextime / spora ) authored
      - Fix MatchReport creation for incremental syncs with empty extraction_stats
      - When extraction_stats is empty but bets exist, create MatchReport from bets data
      - Fix duplicate client_id parameter error in reports template
      - Create separate detail_filters dict to avoid duplicate parameter
      e69c15ea
    • Stefy Lanza (nextime / spora )'s avatar
      Fix empty matches update · d3d966a5
      Stefy Lanza (nextime / spora ) authored
      d3d966a5
    • Stefy Lanza (nextime / spora )'s avatar
      Add comprehensive timezone options to all reports pages · 2117385c
      Stefy Lanza (nextime / spora ) authored
      - Create reusable timezone options partial with all IANA timezones
      - Include 400+ timezone options organized by region (Africa, America, Antarctica, Arctic, Asia, Atlantic, Australia, Europe, Indian, Pacific)
      - Each timezone displays only the city name for cleaner UI
      - Update all reports pages to use the timezone options partial
      - Timezone options include: Auto (Browser Local), UTC, and all major world timezones
      2117385c
    • Stefy Lanza (nextime / spora )'s avatar
      Add timezone support to all reports pages · 8a73a862
      Stefy Lanza (nextime / spora ) authored
      - Add timezone selector with auto-detection of browser local timezone
      - Add manual timezone selection options for major world timezones
      - Implement client-side timezone conversion using JavaScript Intl.DateTimeFormat
      - Update all datetime displays to use data-utc-datetime attribute for automatic conversion
      - All reports pages now support timezone filtering and display
      - Timezone options: Auto (Browser Local), UTC, and 14 major world timezones
      8a73a862
    • Stefy Lanza (nextime / spora )'s avatar
      Enhance reports page with improved layout, pagination, and detailed navigation · 6a24111a
      Stefy Lanza (nextime / spora ) authored
      - Repositioned summary cards to 2 rows (3 cards in first row, 2 in second row)
      - Changed table headers from 'Number of Matches' to 'Matches' and 'Number of Bets' to 'Bets'
      - Added professional styling with gradient headers, hover effects, and enhanced card design
      - Implemented full-width layout for reports page
      - Added per-page selector (10, 20, 50, 100 options, default 50) with pagination
      - Fixed 'View Details' button to properly navigate to client report detail page
      - Created match report detail page with match information and bets list
      - Created bet detail page with bet information and bet details breakdown
      - Added breadcrumb navigation throughout all detail pages
      - All pages maintain consistent professional styling and preserve filters
      6a24111a
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Auto-derive client_id from auth token when missing in reports sync · 66045355
      Stefy Lanza (nextime / spora ) authored
      - If client_id is missing or null in sync request, derive it from ClientActivity table
      - Look up most recent client activity for the API token to get rustdesk_id
      - Use derived client_id throughout the sync process (ReportSync, Bet, ExtractionStats, MatchReport)
      - Prevents database error: 'Column client_id cannot be null'
      - Ensures server uses same client identifier that client uses
      - Returns client_id_used in response for debugging
      - Fixes issue where client sends null client_id but server needs valid identifier
      66045355
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Auto-detect client_id from ClientActivity when not provided in /api/reports/last-sync · cd883251
      Stefy Lanza (nextime / spora ) authored
      - When client doesn't send client_id parameter, look up rustdesk_id from ClientActivity table
      - This ensures server uses same client_id that client uses when syncing
      - Fixes issue where server derived 'token_66' but client was syncing with '8d95b8a115c19857'
      - Server now correctly finds existing sync records and returns requires_full_sync=False
      cd883251
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Remove duplicate client_id parameter in url_for call · dce7b7b7
      Stefy Lanza (nextime / spora ) authored
      - Fixed TypeError: jinja2.runtime.Context.call() got multiple values for keyword argument 'client_id'
      - Removed explicit client_id=client.client_id from url_for call since it's already in **filters
      - This fixes the template rendering error on the reports page
      dce7b7b7
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Add full JSON response logging to /api/reports/last-sync · 25fd8462
      Stefy Lanza (nextime / spora ) authored
      - Log the complete JSON response being sent back to the client
      - This helps debug what the client is receiving
      - Shows requires_full_sync flag and all response fields in formatted JSON
      25fd8462
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Derive client_id from API token when not provided in /api/reports/last-sync · 2019b6df
      Stefy Lanza (nextime / spora ) authored
      - When client_id is not provided, derive a unique client_id from the API token (token_{api_token.id})
      - This ensures each API token has its own unique client identifier for sync purposes
      - Fixes issue where client was receiving status for all clients instead of just itself
      - Allows the server to correctly signal requires_full_sync=True when the database is empty for that specific client
      2019b6df
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Add comprehensive debug logging to /api/reports/last-sync endpoint · c5541e46
      Stefy Lanza (nextime / spora ) authored
      - Add detailed logging for client_id, user, and API token information
      - Log counts of bets, extraction_stats, and match_reports for each client
      - Log requires_full_sync flag value for each client
      - Log response being sent to client
      - Add requires_full_sync: False to responses when sync records exist
      - This will help diagnose why client keeps sending incremental sync requests instead of full sync
      c5541e46
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Add missing model imports in /api/reports/last-sync endpoint · e7abf6b6
      Stefy Lanza (nextime / spora ) authored
      - Add Bet, ExtractionStats, and MatchReport model imports to api_get_last_sync function
      - Fixes 'name Bet is not defined' error when querying last sync status
      e7abf6b6
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Make client_id parameter optional in /api/reports/last-sync endpoint · 4ee6e307
      Stefy Lanza (nextime / spora ) authored
      - Make client_id query parameter optional in /api/reports/last-sync
      - When client_id is not provided, return sync information for all clients associated with the authenticated user's API token
      - Add requires_full_sync flag to each client's response when no records exist across ALL report tables
      - Update REPORTS_SYNC_PROTOCOL_DOCUMENTATION.md with checking last sync status section
      - Add GET LAST SYNC INFORMATION section to REPORTS_SYNC_API_SPECIFICATION.txt
      
      This fix allows clients to query their sync status without needing to know their client_id, making the API more user-friendly and enabling automatic recovery detection.
      4ee6e307
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Add requires_full_sync flag for empty database recovery · ce5a588c
      Stefy Lanza (nextime / spora ) authored
      - Add requires_full_sync flag to /api/reports/sync response when no records exist for client across ALL report tables (bets, extraction_stats, match_reports)
      - Add requires_full_sync flag to /api/reports/last-sync response when no records exist for client
      - Update REPORTS_SYNC_PROTOCOL_DOCUMENTATION.md with full sync required scenario
      - Update REPORTS_SYNC_API_SPECIFICATION.txt with requires_full_sync field documentation
      - Create REPORTS_SYNC_EMPTY_DATABASE_FIX.md with comprehensive fix documentation
      
      This fix addresses the critical gap where the server couldn't signal when it required a full sync after database reset, ensuring automatic recovery without manual intervention.
      ce5a588c
    • Stefy Lanza (nextime / spora )'s avatar
    • Stefy Lanza (nextime / spora )'s avatar
      Add automatic migration for accumulated_shortfall and cap_percentage · f6616afb
      Stefy Lanza (nextime / spora ) authored
      - Add Migration_014 to migrations.py for automatic application at launch
      - Migration adds accumulated_shortfall and cap_percentage columns to match_reports and extraction_stats tables
      - Migration will be automatically applied when the application starts
      - Includes both Python migration class and SQL script for manual execution if needed
      f6616afb
    • Stefy Lanza (nextime / spora )'s avatar
      Add accumulated_shortfall and cap_percentage to reports sync · 99ecea2f
      Stefy Lanza (nextime / spora ) authored
      - Add accumulated_shortfall field to ExtractionStats and MatchReport models
      - Add cap_percentage field to ExtractionStats and MatchReport models
      - Update API sync endpoint to accept and store accumulated_shortfall and cap_percentage for each match
      - Update reports page to show totals at the last match of selected period instead of sync timestamp
      - Update client report detail to display accumulated_shortfall and cap_percentage
      - Add comprehensive test script for accumulated_shortfall and cap_percentage implementation
      - Update templates to display cap_percentage in match lists
      
      This allows tracking the progression of the cap redistribution balance for every client
      over time, showing the actual values at the moment of each match extraction.
      99ecea2f
    • Stefy Lanza (nextime / spora )'s avatar
      Add Bootstrap CSS and JS to enable responsive grid layout · 12219916
      Stefy Lanza (nextime / spora ) authored
      - Add Bootstrap 5.3.0 CSS from CDN
      - Add Font Awesome 6.4.0 for icons
      - Add Bootstrap 5.3.0 JS bundle for interactive components
      - This enables the responsive grid system (col-12, col-md-6, col-lg-3) to work properly
      - Cards and filter form will now display in horizontal layout as intended
      12219916
    • Stefy Lanza (nextime / spora )'s avatar
      Update reports page layout: cards in single row, 3-column filter form with conditional date inputs · ac3a9c46
      Stefy Lanza (nextime / spora ) authored
      - Change summary cards to display in single horizontal row using responsive grid (col-12 col-md-6 col-lg-3)
      - Add h-100 class to ensure equal card heights
      - Reorganize filter form into 3-column layout (Client, Date Range, Sort By)
      - Move time filters to always-visible section (works with all date range options)
      - Show custom date range inputs only when 'Custom' date range is selected
      - Add JavaScript to toggle custom date range visibility based on selection
      - Move action buttons to bottom-right of form with Reset and Apply buttons
      - Add resetFilters() function to clear all filters
      - Add me-2 and text-end CSS utility classes
      ac3a9c46
    • Stefy Lanza (nextime / spora )'s avatar
      Enhance reports page UI with colorful gradient cards and improved filter layout · e6c0e63d
      Stefy Lanza (nextime / spora ) authored
      - Add gradient backgrounds to summary cards (Total Payin, Total Payout, Total Balance, CAP Redistribution)
      - Include circular icon boxes with relevant icons for each metric
      - Implement dynamic color for Total Balance (green for positive, red for negative)
      - Reorganize filters into compact, collapsible layout with logical grouping
      - Add collapsible header with animated chevron icon
      - Enhance filter sections with icons and improved spacing
      - Add comprehensive CSS styles for gradients, flexbox utilities, and visual effects
      - Include JavaScript for smooth collapsible animation with icon rotation
      e6c0e63d
    • Stefy Lanza (nextime / spora )'s avatar
      Fix SQL reset script to respect foreign key constraints · 6a5e8b04
      Stefy Lanza (nextime / spora ) authored
      - Fix deletion order: child tables before parent tables
      - Add bet_details deletion before bets deletion
      - All 4 options updated with correct deletion order
      - Prevents foreign key constraint errors
      
      Deletion order:
      1. report_sync_logs (no dependencies)
      2. match_reports (child of report_syncs)
      3. extraction_stats (child of report_syncs)
      4. bet_details (child of bets)
      5. bets (parent of bet_details, child of report_syncs)
      6. report_syncs (parent of bets, extraction_stats, match_reports)
      6a5e8b04
    • Stefy Lanza (nextime / spora )'s avatar
      Add SQL script to reset reports sync data for full resync · b719f53f
      Stefy Lanza (nextime / spora ) authored
      - Add RESET_REPORTS_SYNC.sql with multiple reset options
      - Option 1: Reset for specific client
      - Option 2: Reset for ALL clients (full reset)
      - Option 3: Reset for multiple specific clients
      - Option 4: Reset syncs after specific date
      - Include verification queries to confirm deletion
      - Include auto-increment reset option
      
      This allows administrators to:
      - Force clients to perform full resync
      - Reset corrupted sync data
      - Clean up old sync records
      - Verify deletion was successful
      b719f53f
    • Stefy Lanza (nextime / spora )'s avatar
      Add reports sync last sync query endpoint and client implementation guides · c0619298
      Stefy Lanza (nextime / spora ) authored
      - Add GET /api/reports/last-sync endpoint to query server for last sync information
      - Update reports page with sorting by client name and cap balance
      - Create comprehensive client-side implementation guide (CLIENT_SYNC_IMPLEMENTATION_GUIDE.md)
      - Create minimal client prompt (CLIENT_SYNC_MINIMAL_PROMPT.md)
      - Update final implementation documentation (REPORTS_FINAL_IMPLEMENTATION.md)
      
      This allows clients to:
      - Query server for last sync information before syncing
      - Verify local tracking against server state
      - Recover from tracking corruption
      - Prevent data loss from missed syncs
      c0619298
    • Stefy Lanza (nextime / spora )'s avatar
      Fixed error · 9158dbaf
      Stefy Lanza (nextime / spora ) authored
      9158dbaf
    • Stefy Lanza (nextime / spora )'s avatar
      Refactor reports · 361fe6c0
      Stefy Lanza (nextime / spora ) authored
      361fe6c0
  2. 01 Feb, 2026 8 commits
  3. 21 Jan, 2026 1 commit
  4. 20 Jan, 2026 4 commits
  5. 12 Jan, 2026 2 commits