-- Experiments Seed Data
-- This file contains all 50 experiments for Phase 2 of JC Experiments

-- =============================================
-- INSERT ALL 50 EXPERIMENTS
-- =============================================

INSERT INTO public.experiments (
    experiment_number,
    reps_required,
    soaking_duration_hr,
    air_drying_time_min,
    plate_contact_frequency_hz,
    throughput_rate_pecans_sec,
    crush_amount_in,
    entry_exit_height_diff_in,
    results_status,
    completion_status,
    phase_id,
    created_by
) VALUES
-- Experiments 1-10
(1, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false, 
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(2, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(3, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(4, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(5, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(6, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(7, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(8, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(9, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(10, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),

-- Experiments 11-20
(11, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(12, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(13, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(14, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(15, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(16, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(17, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(18, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(19, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(20, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),

-- Experiments 21-30
(21, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(22, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(23, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(24, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(25, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(26, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(27, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(28, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(29, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(30, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),

-- Experiments 31-40
(31, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(32, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(33, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(34, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(35, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(36, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(37, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(38, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(39, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(40, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),

-- Experiments 41-50
(41, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(42, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(43, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(44, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(45, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(46, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(47, 3, 3.0, 60, 10.0, 1.8, 0.175, 1.0, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(48, 3, 1.5, 20, 18.0, 3.0, 0.100, 0.25, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(49, 3, 2.0, 30, 15.0, 2.5, 0.125, 0.5, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')),
(50, 3, 2.5, 45, 12.0, 2.0, 0.150, 0.75, 'valid', false,
 (SELECT id FROM public.experiment_phases WHERE name = 'Phase 2 of JC Experiments'),
 (SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com'))
;

-- =============================================
-- CREATE SAMPLE EXPERIMENT REPETITIONS
-- =============================================

-- Create repetitions for first 5 experiments as examples
INSERT INTO public.experiment_repetitions (experiment_id, repetition_number, created_by)
SELECT 
    e.id,
    rep_num,
    e.created_by
FROM public.experiments e
CROSS JOIN generate_series(1, 3) AS rep_num
WHERE e.experiment_number <= 5
;
