-- Create demo accounts for testing the student application portal

-- Insert demo vouchers for testing
INSERT INTO vouchers (serial_number, pin, student_type, price, currency, email, payment_reference, status, is_used, created_at) VALUES
('FU20250001', 'DEMO1234', 'undergraduate', 50.00, 'GHS', 'demo.student1@fanaka.edu', 'demo_ref_001', 'active', false, NOW()),
('FU20250002', 'DEMO5678', 'postgraduate', 75.00, 'GHS', 'demo.student2@fanaka.edu', 'demo_ref_002', 'active', false, NOW()),
('FU20250003', 'DEMO9012', 'undergraduate', 50.00, 'GHS', 'demo.student3@fanaka.edu', 'demo_ref_003', 'active', false, NOW());

-- Insert demo admin users
INSERT INTO admin_users (username, email, password_hash, role, created_at) VALUES
('admin', 'admin@fanaka.edu', '$2b$10$rQZ8kqVZ8kqVZ8kqVZ8kqO', 'admin', NOW()),
('reviewer', 'reviewer@fanaka.edu', '$2b$10$rQZ8kqVZ8kqVZ8kqVZ8kqO', 'reviewer', NOW());

-- Insert demo student applications (partially completed for testing)
INSERT INTO students (
  voucher_id, 
  email, 
  first_name, 
  last_name, 
  date_of_birth, 
  gender, 
  phone, 
  address, 
  city, 
  country, 
  nationality, 
  program_type, 
  preferred_program, 
  application_status, 
  created_at
) VALUES
(
  (SELECT id FROM vouchers WHERE serial_number = 'FU20250001'),
  'demo.student1@fanaka.edu',
  'John',
  'Doe',
  '2000-05-15',
  'male',
  '+233123456789',
  '123 Demo Street',
  'Accra',
  'Ghana',
  'Ghanaian',
  'undergraduate',
  'Computer Science',
  'in_progress',
  NOW()
),
(
  (SELECT id FROM vouchers WHERE serial_number = 'FU20250002'),
  'demo.student2@fanaka.edu',
  'Jane',
  'Smith',
  '1998-08-22',
  'female',
  '+233987654321',
  '456 Demo Avenue',
  'Kumasi',
  'Ghana',
  'Ghanaian',
  'postgraduate',
  'Business Administration',
  'submitted',
  NOW()
),
(
  (SELECT id FROM vouchers WHERE serial_number = 'FU20250003'),
  'demo.student3@fanaka.edu',
  'Michael',
  'Johnson',
  '1999-12-10',
  'male',
  '+233555666777',
  '789 Demo Road',
  'Tamale',
  'Ghana',
  'Ghanaian',
  'undergraduate',
  'Engineering',
  'under_review',
  NOW()
);

-- Insert demo payment records
INSERT INTO payments (reference, email, amount, currency, status, voucher_id, created_at) VALUES
('demo_ref_001', 'demo.student1@fanaka.edu', 50.00, 'GHS', 'completed', (SELECT id FROM vouchers WHERE serial_number = 'FU20250001'), NOW()),
('demo_ref_002', 'demo.student2@fanaka.edu', 75.00, 'GHS', 'completed', (SELECT id FROM vouchers WHERE serial_number = 'FU20250002'), NOW()),
('demo_ref_003', 'demo.student3@fanaka.edu', 50.00, 'GHS', 'completed', (SELECT id FROM vouchers WHERE serial_number = 'FU20250003'), NOW());
