INSERT INTO `golf_tournaments` (`slug`, `name`, `event_date`, `course_par`, `is_active`, `sort_order`) VALUES
('gm-motors-2026', 'GM Motors 2026', '2026-06-15', 69, 1, 1),
('opus-2026', 'OPUS 2026', '2026-07-20', 69, 1, 2);

SET @gm_id := LAST_INSERT_ID();
SET @opus_id := @gm_id + 1;

INSERT INTO `golf_scoring_teams` (`tournament_id`, `golf_league_id`, `name`, `color`, `sort_order`) VALUES
(@gm_id, NULL, 'Team Eagles', '#1565c0', 1),
(@gm_id, NULL, 'Team Birdies', '#2e7d32', 2),
(@opus_id, NULL, 'Team Alpha', '#ef6c00', 1);

SET @team_eagles := LAST_INSERT_ID();
SET @team_birdies := @team_eagles + 1;
SET @team_alpha := @team_eagles + 2;

INSERT INTO `golf_scoring_players` (`team_id`, `tournament_id`, `golf_league_id`, `display_name`, `email`, `sort_order`) VALUES
(@team_eagles, @gm_id, NULL, 'John Smith', 'nishant@skybooker.com', 1),
(@team_eagles, @gm_id, NULL, 'Mike Johnson', 'nishant@skybooker.com', 2),
(@team_birdies, @gm_id, NULL, 'David Lee', 'nishant@skybooker.com', 1),
(@team_birdies, @gm_id, NULL, 'Chris Walker', 'nishant@skybooker.com', 2),
(@team_alpha, @opus_id, NULL, 'Sarah Wilson', 'nishant@skybooker.com', 1),
(@team_alpha, @opus_id, NULL, 'Tom Brown', 'nishant@skybooker.com', 2);

INSERT INTO `golf_scoring_rounds` (`tournament_id`, `golf_league_id`, `round_date`, `round_label`, `is_locked`) VALUES
(@gm_id, NULL, '2026-06-15', 'Round 1', 0);

SET @round_id := LAST_INSERT_ID();

INSERT INTO `golf_scoring_scores` (`round_id`, `player_id`)
SELECT @round_id, id FROM `golf_scoring_players` WHERE tournament_id = @gm_id;
