INSERT IGNORE INTO system_settings (setting_key, setting_value, description)
VALUES
  ('institute_name', 'Crescent College of Accountancy', 'Institution name shown across operational screens.'),
  ('system_title', 'CCA Media Recording System', 'System title shown in browser titles and headers.'),
  ('default_timezone', 'Asia/Karachi', 'Default timezone for Pakistan date and time displays.'),
  ('notification_email', 'shahidmunir@crescentcollege.edu.pk', 'Operational notification recipient email.'),
  ('enable_email_notifications', '1', 'Enable operational email notifications.'),
  ('allow_cameraman_unscheduled_request', '0', 'Allow cameramen to create unscheduled recording requests.'),
  ('show_sunday_recordings', '1', 'Show Sunday recordings in operational planning views.'),
  ('auto_release_resources_on_cancel', '1', 'Automatically release resources when a schedule is cancelled.'),
  ('auto_release_resources_on_complete', '1', 'Automatically release resources when a schedule is completed.');

UPDATE system_settings
SET setting_value = CASE setting_key
  WHEN 'institute_name' THEN 'Crescent College of Accountancy'
  WHEN 'system_title' THEN 'CCA Media Recording System'
  WHEN 'default_timezone' THEN 'Asia/Karachi'
  WHEN 'notification_email' THEN 'shahidmunir@crescentcollege.edu.pk'
  WHEN 'enable_email_notifications' THEN '1'
  WHEN 'allow_cameraman_unscheduled_request' THEN '0'
  WHEN 'show_sunday_recordings' THEN '1'
  WHEN 'auto_release_resources_on_cancel' THEN '1'
  WHEN 'auto_release_resources_on_complete' THEN '1'
  ELSE setting_value
END,
description = CASE setting_key
  WHEN 'institute_name' THEN 'Institution name shown across operational screens.'
  WHEN 'system_title' THEN 'System title shown in browser titles and headers.'
  WHEN 'default_timezone' THEN 'Default timezone for Pakistan date and time displays.'
  WHEN 'notification_email' THEN 'Operational notification recipient email.'
  WHEN 'enable_email_notifications' THEN 'Enable operational email notifications.'
  WHEN 'allow_cameraman_unscheduled_request' THEN 'Allow cameramen to create unscheduled recording requests.'
  WHEN 'show_sunday_recordings' THEN 'Show Sunday recordings in operational planning views.'
  WHEN 'auto_release_resources_on_cancel' THEN 'Automatically release resources when a schedule is cancelled.'
  WHEN 'auto_release_resources_on_complete' THEN 'Automatically release resources when a schedule is completed.'
  ELSE description
END,
updated_at = CURRENT_TIMESTAMP
WHERE setting_key IN (
  'institute_name',
  'system_title',
  'default_timezone',
  'notification_email',
  'enable_email_notifications',
  'allow_cameraman_unscheduled_request',
  'show_sunday_recordings',
  'auto_release_resources_on_cancel',
  'auto_release_resources_on_complete'
);
