• Mahmoud Aglan's avatar
    fix: tournament creation was silently failing — wrong column names in insert · 17472ee0
    Mahmoud Aglan authored
    The store() method used column names that don't exist in the database:
    - rounds_count → rounds_total + swiss_rounds
    - entry_fee → entry_fee_coins
    - prize_pool → prize_pool_coins
    - start_date → starts_at
    - organization_id → org_id
    - swiss_org_id, swiss_event_id → removed (don't exist in table)
    - created_by → removed (UUID FK to profiles, admin users aren't in profiles)
    
    Also:
    - Time control is now a proper dropdown with all 14 enum values grouped
      by category (bullet/blitz/rapid/classical)
    - Format dropdown now uses correct enum values (swiss_to_bracket, team_battle
      instead of invalid group_stage)
    - Swiss API tournament creation limited to formats it actually supports
      (swiss, round_robin) — other formats use local bracket/arena engines
    - Insert failure now shows error instead of fake success message
    - On success, redirects to the new tournament page instead of list
    Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
    17472ee0
form.php 21.9 KB