-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 09, 2025 at 10:38 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.0.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `recruitment_system`
--

-- --------------------------------------------------------

--
-- Table structure for table `admins`
--

CREATE TABLE `admins` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `admins`
--

INSERT INTO `admins` (`id`, `username`, `email`, `password`, `created_at`) VALUES
(1, 'admin', 'admin@recruitment.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '2025-08-03 13:06:53');

-- --------------------------------------------------------

--
-- Table structure for table `candidates`
--

CREATE TABLE `candidates` (
  `id` int(11) NOT NULL,
  `first_name` varchar(50) NOT NULL,
  `last_name` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `gender` enum('male','female','other') DEFAULT NULL,
  `profile_picture` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `candidates`
--

INSERT INTO `candidates` (`id`, `first_name`, `last_name`, `email`, `password`, `phone`, `address`, `date_of_birth`, `gender`, `profile_picture`, `created_at`, `updated_at`) VALUES
(1, 'masande', 'ndyaluvane', 'masandendyaluvane@gmail.com', '$2y$10$4kbvEJRnHXXbQBGkEZe2GuK9Gp3deqqMVhxMPFN5nylVfB9sxOF0q', '0726130918', '27 Arum sands \r\nGonubie \r\neast london\r\n5257', '1985-06-29', 'male', '68903b40a49af.jpg', '2025-08-03 14:24:25', '2025-08-04 04:46:56'),
(3, 'John', 'Smith', 'john.smith@email.com', '$2y$10$6tBZw3HHn9ZnWb0cyeXK/uvvPzWQwE4JPHZyaJpN82IOJFWu/259.', '555-0101', NULL, NULL, NULL, NULL, '2025-08-08 18:02:33', '2025-08-08 18:02:33'),
(4, 'Sarah', 'Johnson', 'sarah.johnson@email.com', '$2y$10$BqjseaSyrXndrEWXJfUCDepYGby63y9kJuS.OjY6lRU26oBnSfSLC', '555-0102', NULL, NULL, NULL, NULL, '2025-08-08 18:02:33', '2025-08-08 18:02:33'),
(5, 'Michael', 'Brown', 'michael.brown@email.com', '$2y$10$zRqAk8bsYuoCyKRVf9zPAe2wMQWWl/D8TDo0LQWcizQYvIHrd5aSa', '555-0103', NULL, NULL, NULL, NULL, '2025-08-08 18:02:33', '2025-08-08 18:02:33'),
(6, 'Emma', 'Davis', 'emma.davis@email.com', '$2y$10$hclAA/SWoAXhYhDgOmK2TujWuAEi9Mx4yRMnfbUPTOFd/xAFcWaK.', '555-0104', NULL, NULL, NULL, NULL, '2025-08-08 18:02:34', '2025-08-08 18:02:34'),
(7, 'David', 'Wilson', 'david.wilson@email.com', '$2y$10$1cbexC3kVdrxxYM6gPR/8.1Kl4wQAZLst9CuwnqH396actMFEHiMG', '555-0105', NULL, NULL, NULL, NULL, '2025-08-08 18:02:34', '2025-08-08 18:02:34'),
(8, 'Lisa', 'Anderson', 'lisa.anderson@email.com', '$2y$10$osC.i2Fbh9tnXhlWelGMnuJ5lnwZdgwPemUeJyWkiU7w0VnXcxIJe', '555-0106', NULL, NULL, NULL, NULL, '2025-08-08 18:02:34', '2025-08-08 18:02:34'),
(9, 'Robert', 'Taylor', 'robert.taylor@email.com', '$2y$10$XoUIg1BW/KyXe1cr4IVLQOMXuLXuzmFx6iE/YTuoUPEOrlPDYZWz6', '555-0107', NULL, NULL, NULL, NULL, '2025-08-08 18:02:34', '2025-08-08 18:02:34'),
(10, 'Jennifer', 'Martinez', 'jennifer.martinez@email.com', '$2y$10$5VZKTd5eLChlx2gL/TlOkOyyMkZVAb//mrVANHNtwVOcT9pMWXPJe', '555-0108', NULL, NULL, NULL, NULL, '2025-08-08 18:02:34', '2025-08-08 18:02:34');

-- --------------------------------------------------------

--
-- Table structure for table `candidate_documents`
--

CREATE TABLE `candidate_documents` (
  `id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `document_type` enum('cv','cover_letter','certificate','transcript','other') NOT NULL,
  `title` varchar(200) NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `file_size` int(11) DEFAULT NULL,
  `file_type` varchar(50) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `candidate_documents`
--

INSERT INTO `candidate_documents` (`id`, `candidate_id`, `document_type`, `title`, `file_path`, `file_size`, `file_type`, `description`, `is_public`, `created_at`) VALUES
(1, 1, 'other', 'Drivers license', '6890384727bcb.pdf', 749058, 'application/pdf', '', 1, '2025-08-04 04:34:15'),
(2, 1, 'certificate', 'btech it', '68903874308d1.pdf', 45845, 'application/pdf', '', 1, '2025-08-04 04:35:00'),
(3, 1, 'certificate', 'btech it', '689039894163d.pdf', 45845, 'application/pdf', '', 1, '2025-08-04 04:39:37'),
(4, 1, 'certificate', 'btech it', '68903a447a06c.pdf', 45845, 'application/pdf', '', 1, '2025-08-04 04:42:44'),
(5, 1, 'certificate', 'Post Graduate Certificate in Public Management', '68908d82acbbe.pdf', 154063, 'application/pdf', '', 1, '2025-08-04 10:37:54');

-- --------------------------------------------------------

--
-- Table structure for table `certificates`
--

CREATE TABLE `certificates` (
  `id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `title` varchar(200) NOT NULL,
  `issuing_organization` varchar(200) DEFAULT NULL,
  `issue_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `credential_id` varchar(100) DEFAULT NULL,
  `credential_url` varchar(500) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `certificates`
--

INSERT INTO `certificates` (`id`, `candidate_id`, `title`, `issuing_organization`, `issue_date`, `expiry_date`, `credential_id`, `credential_url`, `description`, `file_path`, `created_at`) VALUES
(1, 1, 'Prince 2', 'AXELOS', '2019-05-29', NULL, 'GR656091624MN', '', '', '688f9f3995544.pdf', '2025-08-03 17:41:13'),
(2, 1, 'Cobit 5', 'IT Winners', '2014-10-03', NULL, '', '', '', '688f9fbb29462.pdf', '2025-08-03 17:43:23'),
(3, 1, 'ITIL', 'AXELOS', '2015-02-25', NULL, '02992540-01-TQG5', '', '', '688fa04d6d9b7.pdf', '2025-08-03 17:45:49');

-- --------------------------------------------------------

--
-- Table structure for table `companies`
--

CREATE TABLE `companies` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `website` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `contact_person_name` varchar(100) DEFAULT 'Contact Person',
  `contact_person_email` varchar(100) DEFAULT 'contact@company.com',
  `contact_person_phone` varchar(20) DEFAULT NULL,
  `contact_person_position` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `companies`
--

INSERT INTO `companies` (`id`, `name`, `email`, `password`, `phone`, `address`, `website`, `description`, `logo`, `status`, `created_at`, `updated_at`, `contact_person_name`, `contact_person_email`, `contact_person_phone`, `contact_person_position`) VALUES
(2, 'PetroSA', '', '', '+27 21 929 3000', '161 Frans Conradie drive\r\nParow\r\nCape Town', 'https://www.petrosa.co.za', 'The Petroleum Oil and Gas Corporation of South Africa (SOC) Limited (PetroSA) is the country’s National Oil Company. PetroSA is a subsidiary of the CEF, which is wholly owned by the State and reports to the Department of Minerals and Energy.', '688f8dacc28f4.png', 'approved', '2025-08-03 16:26:20', '2025-08-03 16:26:20', 'Nonny Mashika', 'nonny.mashika@petrosa.co.za', '+27 21 929 3000', 'Group Manager Communications'),
(8, 'SANPC', 'jacky.mashapu@sa-npc.co.za', '$2y$10$EcyVB9QxstEOfKKItqmGxO/mkWJLLzf5OmynsXdQHh6Jx5NHlLpcy', '0726130918', '1ST Floor Building 1, Corporate Campus, Waterfall City, Midrand', 'https://www.sa-npc.co.za', 'The South African National Petroleum Company (SANPC) is the newly established State-Owned Company. This company was formed after the merger of three of the Central Energy Fund (CEF) subsidiaries, Igas, PetroSA and Strategic Fuel Fund.\r\n\r\nThe decision to merge these companies was a culmination of a policy statement made by CEF’s shareholder, the Minister of Mineral Resources and Energy, Mr Gwede Mantashe at the Portfolio Committee on Mineral Resources and Energy held on 7 May 2020. This policy statement was also endorsed by Cabinet’s approval on 10 June 2020, which paved a way to allow the state to participate meaningfully in the oil and gas developments.', '689098de48b52.png', 'approved', '2025-08-04 11:26:22', '2025-08-04 11:26:22', 'Jacky Mashapu', 'jacky.mashapu@sa-npc.co.za', '0726130918', 'GM Communications');

-- --------------------------------------------------------

--
-- Table structure for table `company_users`
--

CREATE TABLE `company_users` (
  `id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `position` varchar(100) DEFAULT NULL,
  `is_primary` tinyint(1) DEFAULT 0,
  `status` enum('active','inactive') DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `company_users`
--

INSERT INTO `company_users` (`id`, `company_id`, `name`, `email`, `password`, `phone`, `position`, `is_primary`, `status`, `created_at`, `updated_at`) VALUES
(2, 2, 'jongikhaya stuurman', 'jongikhaya.stuurman@petrosa.co.za', '$2y$10$ilNMAoUw8UYocJ2gHRMFROSqp3OsUkd3AjobeVOKgJQ0urofx7Qzi', '0726130918', 'HR Manager', 0, 'active', '2025-08-03 16:26:20', '2025-08-03 16:38:23'),
(3, 2, 'samuel danster', 'samuel.danster@petrosa.co.za', '$2y$10$NEiwU2AGdjHlBn421b1/dOXuwRu547a2oXVNTHt/Ezvg61wvBPLRG', '0726130918', 'HR Manager', 1, 'active', '2025-08-03 16:38:23', '2025-08-03 16:38:23'),
(5, 8, 'jacky mashapu', 'jacky.mashapu@sa-npc.co.za', '$2y$10$vBdBX/.VhUW1tTpeVwBKZuZg0aiT7Uys.PpaSW1p.z6.EbzdyWBiC', '0726130918', 'GM Communications', 1, 'active', '2025-08-04 11:26:22', '2025-08-04 11:26:22');

-- --------------------------------------------------------

--
-- Table structure for table `education`
--

CREATE TABLE `education` (
  `id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `institution` varchar(100) NOT NULL,
  `degree` varchar(100) DEFAULT NULL,
  `field_of_study` varchar(100) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `grade` varchar(20) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `education`
--

INSERT INTO `education` (`id`, `candidate_id`, `institution`, `degree`, `field_of_study`, `start_date`, `end_date`, `grade`, `description`, `created_at`) VALUES
(1, 1, 'Ikwezi Technical skill centre', 'Matric', '', '2002-01-03', '2002-11-30', '12', '', '2025-08-03 17:31:24'),
(2, 1, 'Walter Sisulu University', 'Diploma', 'Information Technology', '2005-01-03', '2007-12-31', 'NQF7', '', '2025-08-03 17:33:26'),
(3, 1, 'Walter Sisulu University', 'BTech', 'Information Technology', '2008-01-03', '2008-12-31', 'NQF8', '', '2025-08-03 17:34:43');

-- --------------------------------------------------------

--
-- Table structure for table `hr_analytics`
--

CREATE TABLE `hr_analytics` (
  `id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `metric_type` enum('application_received','interview_scheduled','interview_completed','candidate_hired','candidate_rejected','job_posted','job_closed') NOT NULL,
  `metric_value` int(11) DEFAULT 1,
  `job_id` int(11) DEFAULT NULL,
  `candidate_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_by` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `hr_analytics`
--

INSERT INTO `hr_analytics` (`id`, `company_id`, `metric_type`, `metric_value`, `job_id`, `candidate_id`, `created_at`, `created_by`) VALUES
(1, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(2, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(3, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(4, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(5, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(6, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(7, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(8, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(9, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(10, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(11, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(12, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(13, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(14, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(15, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(16, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(17, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(18, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(19, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(20, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(21, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(22, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(23, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(24, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(25, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(26, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(27, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(28, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(29, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(30, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(31, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(32, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(33, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(34, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(35, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(36, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(37, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(38, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(39, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(40, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(41, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(42, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(43, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(44, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(45, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(46, 2, 'job_posted', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(47, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(48, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(49, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(50, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(51, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(52, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(53, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(54, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(55, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(56, 2, 'job_posted', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(57, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(58, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(59, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(60, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(61, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(62, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(63, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(64, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(65, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(66, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(67, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(68, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(69, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(70, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(71, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(72, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(73, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(74, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(75, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(76, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(77, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(78, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(79, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(80, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(81, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(82, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(83, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(84, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(85, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(86, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(87, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(88, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(89, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(90, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(91, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(92, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(93, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(94, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(95, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(96, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(97, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(98, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(99, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(100, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(101, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(102, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(103, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(104, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(105, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(106, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(107, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(108, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(109, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(110, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(111, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(112, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(113, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(114, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(115, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(116, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(117, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(118, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(119, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(120, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(121, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(122, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(123, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(124, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(125, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(126, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(127, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(128, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(129, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(130, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(131, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(132, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(133, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(134, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(135, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(136, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(137, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(138, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(139, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(140, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(141, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(142, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(143, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(144, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(145, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(146, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(147, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(148, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(149, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(150, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(151, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(152, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(153, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(154, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(155, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(156, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(157, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(158, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(159, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(160, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(161, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(162, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(163, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(164, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(165, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(166, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(167, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(168, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(169, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(170, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(171, 2, 'job_posted', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(172, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(173, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(174, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(175, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(176, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(177, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(178, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(179, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(180, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(181, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(182, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(183, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(184, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(185, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(186, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(187, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(188, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(189, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(190, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(191, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(192, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(193, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(194, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(195, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(196, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(197, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(198, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(199, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(200, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(201, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(202, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(203, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(204, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(205, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(206, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(207, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(208, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(209, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(210, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(211, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(212, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(213, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(214, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(215, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:46', NULL),
(216, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:46', NULL),
(217, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(218, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(219, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(220, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(221, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(222, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(223, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(224, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(225, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(226, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(227, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(228, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(229, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(230, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(231, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(232, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(233, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(234, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(235, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(236, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(237, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(238, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(239, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(240, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(241, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(242, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(243, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(244, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(245, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(246, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(247, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(248, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(249, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(250, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(251, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(252, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(253, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(254, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(255, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(256, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(257, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(258, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(259, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(260, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(261, 2, 'job_posted', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(262, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(263, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(264, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(265, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(266, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(267, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(268, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(269, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(270, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(271, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(272, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(273, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(274, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(275, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(276, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(277, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(278, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(279, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(280, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(281, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(282, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(283, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(284, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(285, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(286, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(287, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(288, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(289, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(290, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(291, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(292, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(293, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(294, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(295, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(296, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(297, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(298, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(299, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(300, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(301, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(302, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(303, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(304, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(305, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(306, 2, 'job_posted', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(307, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(308, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(309, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(310, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(311, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(312, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(313, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(314, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(315, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(316, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(317, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(318, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(319, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(320, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(321, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(322, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(323, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(324, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(325, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(326, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(327, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(328, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(329, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(330, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(331, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(332, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(333, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(334, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(335, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(336, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(337, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(338, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(339, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(340, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(341, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(342, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(343, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(344, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(345, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(346, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(347, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(348, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(349, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(350, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(351, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(352, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(353, 2, 'candidate_hired', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(354, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(355, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(356, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(357, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(358, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(359, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(360, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(361, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(362, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(363, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(364, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(365, 2, 'job_posted', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(366, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(367, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(368, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(369, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(370, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(371, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(372, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(373, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(374, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(375, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(376, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(377, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(378, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(379, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(380, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(381, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(382, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(383, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(384, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(385, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(386, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(387, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(388, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(389, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(390, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(391, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(392, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(393, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(394, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(395, 2, 'candidate_rejected', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(396, 2, 'candidate_rejected', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(397, 2, 'application_received', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(398, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(399, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(400, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(401, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(402, 2, 'interview_scheduled', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(403, 2, 'candidate_hired', 1, 2, NULL, '2025-08-08 17:49:47', NULL),
(404, 2, 'application_received', 1, 1, NULL, '2025-08-08 17:49:47', NULL),
(405, 2, 'interview_scheduled', 1, 1, NULL, '2025-08-08 17:49:47', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `hr_performance_metrics`
--

CREATE TABLE `hr_performance_metrics` (
  `id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `metric_name` varchar(100) NOT NULL,
  `metric_value` decimal(10,2) NOT NULL,
  `metric_period` varchar(20) NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `interviews`
--

CREATE TABLE `interviews` (
  `id` int(11) NOT NULL,
  `application_id` int(11) NOT NULL,
  `interview_date` datetime NOT NULL,
  `interview_type` enum('phone','video','in-person') DEFAULT 'video',
  `location` varchar(255) DEFAULT NULL,
  `interviewer_name` varchar(100) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `status` enum('scheduled','completed','cancelled','rescheduled') DEFAULT 'scheduled',
  `result` enum('passed','failed','pending') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `interviews`
--

INSERT INTO `interviews` (`id`, `application_id`, `interview_date`, `interview_type`, `location`, `interviewer_name`, `notes`, `status`, `result`, `created_at`, `updated_at`) VALUES
(1, 1, '2025-08-28 13:30:00', 'video', 'https://teams.microsoft.com/l/meetup-join/19%3ameeting_Mzg0YzQ4MzItNDYzNC00M2Q5LWEwNmEtOGNlZmQ0NzI1YzI0%40thread.v2/0?context=%7b%22Tid%22%3a%22ec1984fd-21c9-49a8-8393-8f691552d221%22%2c%22Oid%22%3a%22b8598507-911d-49c4-be78-76357354316f%22%7d', 'J Stuurman', 'prepare a presentation', 'cancelled', 'pending', '2025-08-04 10:49:36', '2025-08-04 11:54:40');

-- --------------------------------------------------------

--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `company_user_id` int(11) DEFAULT 1,
  `category_id` int(11) DEFAULT NULL,
  `title` varchar(100) NOT NULL,
  `description` text NOT NULL,
  `requirements` text DEFAULT NULL,
  `salary_min` decimal(10,2) DEFAULT NULL,
  `salary_max` decimal(10,2) DEFAULT NULL,
  `location` varchar(100) DEFAULT NULL,
  `employment_type` enum('full-time','part-time','contract','internship') DEFAULT NULL,
  `experience_level` enum('entry','mid','senior','executive') DEFAULT NULL,
  `deadline` date DEFAULT NULL,
  `status` enum('active','closed','draft') DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `jobs`
--

INSERT INTO `jobs` (`id`, `company_id`, `company_user_id`, `category_id`, `title`, `description`, `requirements`, `salary_min`, `salary_max`, `location`, `employment_type`, `experience_level`, `deadline`, `status`, `created_at`, `updated_at`) VALUES
(1, 2, 3, 1, 'Senior IT Desktop Support Engineer (Level 2 - Level 3)', 'Scaled Inc is a leading staff augmentation firm connecting USA-based Managed Service Providers (MSPs) with top-tier South African technical talent. Renowned for exceptional technical expertise and outstanding service, we are on a mission to expand our footprint and strengthen our team with passionate professionals.\r\n\r\nRole Overview:\r\n\r\nWe are seeking a skilled and motivated Senior Desktop Support Engineer with a robust background in Office 365, Desktop Support, Cloud-based Infrastructure, and Virtualization. This role requires working in a fully remote environment, equipped with a professional home office setup.\r\n\r\nKey Responsibilities:\r\n\r\nOffice 365 Expertise:\r\nConfigure, manage, and troubleshoot Office 365 applications (Exchange Online, SharePoint Online, Teams).\r\nDesktop Support:\r\nProvide technical support to end-users, including software installations, hardware issue resolution, and general troubleshooting.\r\nWindows Server Administration:\r\nManage Active Directory, Group Policy, DNS, and associated server tasks.\r\nSystem Performance &amp;amp;amp; Security:\r\nMonitor systems, ensure security measures are in place, and maintain IT infrastructure availability.\r\nIT Projects:\r\nCollaborate with the IT team to implement and support various projects and initiatives.\r\nDocumentation:\r\nMaintain comprehensive documentation for IT processes, procedures, and system configurations.nding service, we are on a mission to expand our footprint and strengthen our team with passionate professionals.', 'Minimum 5 years in IT support roles focusing on Office 365, Azure, desktop support, and server administration.\r\nExpertise in Azure services, including Azure Active Directory, Virtual Machines, and Storage.\r\nProficiency in supporting Windows/macOS systems, hardware troubleshooting, and software installations.\r\nStrong familiarity with Windows Server environments (Active Directory, Group Policy, DNS).\r\n\r\nHome Office Setup:\r\n\r\nDedicated workspace (separate room).\r\nMinimum internet speed: 40 Mbps (Fibre preferred)\r\nBackup power supply.\r\nPreferred Certifications:\r\n\r\nMicrosoft: MCSE Certification.\r\nNetworking &amp;amp;amp; Security: Cisco, HP Advanced, Fortinet, Palo Alto, Meraki, Juniper.\r\nCloud: Azure Certified, VMware Certified.\r\nCybersecurity: SANS, GIAC, Security Infrastructure/Management (Splunk, Arctic Wolf, Tenable).', 5000.00, 20000.00, 'Cape Town', 'full-time', 'mid', '2025-09-30', 'active', '2025-08-03 16:53:51', '2025-08-04 04:20:00'),
(2, 2, 3, 4, 'Administrative Controller', 'Provide administrative support to the Production Team enabling the efficient and effective delivery of a Learning and Development Service to the business.', '• Diploma/Degree\r\n• 3 - 5 years relevant experience working in similar environment, applying job-related concepts, techniques and processes at the required level\r\n• Business English: Fluent\r\n• Computer lite..', 45000.00, 75000.00, 'Cape Town', 'full-time', 'mid', '2025-09-30', 'active', '2025-08-04 10:31:08', '2025-08-04 10:31:08'),
(7, 2, 3, 1, 'IT Business Analyst', 'Purpose: As an I.T. Business Analyst at our Head Office, you\'ll play a pivotal role in driving efficiency and enhancing operations through detailed requirements analysis, process documentation, and implementation of cutting-edge solutions. Your expertise will be instrumental in ensuring that our systems and processes are optimized to meet the evolving needs of our business.', 'Minimum Requirements:\r\n• Qualifications in I.T. or Business Analysis (Diploma or Degree preferred).\r\n• 2 – 3 years’ relevant experience\r\n• Strong analytical skills and proficiency in Microsoft Office Applications.\r\n• Excellent written and oral communication skills.\r\n• Ability to thrive in high-pressure situations and adapt quickly.\r\n• Proficient in data analysis and understanding of business functional areas.\r\n• Willingness to travel to sites when required.\r\n• Strong planning, organizational, and time management skills.\r\n• Previous experience in I.T. or Business Analysis is advantageous.\r\n• Valid driver\'s license.\r\n\r\nDuties and Responsibilities\r\n\r\nDuties and Responsibilities:\r\n• Evaluating business processes, anticipating requirements, uncovering areas for improvement, and developing and implementing solutions.\r\n• Leading ongoing reviews of business processes and developing optimization strategies.\r\n• Staying up-to-date on the latest process and IT advancements to automate and modernize systems.\r\n• Conducting meetings and presentations to share ideas and findings.\r\n• Performing requirements analysis.\r\n• Documenting and communicating the results of your efforts.\r\n• Effectively communicating your insights and plans to cross-functional team members and management.\r\n• Gathering critical information from meetings with various stakeholders and producing useful reports.\r\n• Working closely with clients, technicians, and managerial staff.\r\n• Ensuring solutions meet business needs and requirements.\r\n• Performing user acceptance testing.\r\n• Managing projects, developing project plans, monitoring performance, change management and support handovers.\r\n• The ability to present findings and recommendations to senior leaders and to manage stakeholder meetings\r\n• Requirement gathering is a key part of the role so the ability to ask the right questions and correctly understand the information received is essential\r\n• Documentation of Functional business requirements', 170000.00, 330000.00, 'Mossel Bay', 'full-time', 'senior', '2025-08-10', 'active', '2025-08-09 20:28:29', '2025-08-09 20:29:17');

-- --------------------------------------------------------

--
-- Table structure for table `job_applications`
--

CREATE TABLE `job_applications` (
  `id` int(11) NOT NULL,
  `job_id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `resume_id` int(11) DEFAULT NULL,
  `cover_letter` text DEFAULT NULL,
  `status` enum('applied','shortlisted','interviewed','hired','rejected') DEFAULT 'applied',
  `applied_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `job_applications`
--

INSERT INTO `job_applications` (`id`, `job_id`, `candidate_id`, `resume_id`, `cover_letter`, `status`, `applied_at`, `updated_at`) VALUES
(1, 1, 1, 2, 'cover letter goes here', 'applied', '2025-08-03 17:56:22', '2025-08-08 18:02:34'),
(2, 2, 1, 2, 'test covering letter', 'applied', '2025-08-04 10:34:51', '2025-08-08 18:02:34'),
(9, 1, 3, NULL, 'I am excited to apply for this position. I have extensive experience in the relevant field and believe I would be a valuable addition to your team.', 'applied', '2025-05-10 18:02:34', '2025-08-08 18:02:34'),
(10, 1, 4, NULL, 'I believe my qualifications and enthusiasm make me an ideal candidate for this position. I look forward to discussing my application with you.', 'applied', '2025-06-18 18:02:34', '2025-08-08 18:02:34'),
(11, 1, 5, NULL, 'Having researched your company extensively, I am impressed by your commitment to excellence and would love to be part of your team.', 'applied', '2025-07-19 18:02:34', '2025-08-08 18:02:34'),
(12, 1, 6, NULL, 'With my background in technology and passion for innovation, I am confident I can contribute significantly to your organization\'s success.', 'applied', '2025-07-25 18:02:34', '2025-08-08 18:02:34'),
(13, 1, 7, NULL, 'Having researched your company extensively, I am impressed by your commitment to excellence and would love to be part of your team.', 'rejected', '2025-06-01 18:02:34', '2025-08-08 18:02:34'),
(15, 2, 3, NULL, 'With my background in technology and passion for innovation, I am confident I can contribute significantly to your organization\'s success.', 'interviewed', '2025-07-15 18:02:34', '2025-08-08 18:02:34'),
(16, 2, 4, NULL, 'I am excited to apply for this position. I have extensive experience in the relevant field and believe I would be a valuable addition to your team.', 'applied', '2025-07-10 18:02:34', '2025-08-08 18:02:34'),
(17, 2, 5, NULL, 'I believe my qualifications and enthusiasm make me an ideal candidate for this position. I look forward to discussing my application with you.', 'applied', '2025-06-14 18:02:34', '2025-08-08 18:02:34'),
(18, 2, 6, NULL, 'I believe my qualifications and enthusiasm make me an ideal candidate for this position. I look forward to discussing my application with you.', 'applied', '2025-07-28 18:02:34', '2025-08-08 18:02:34'),
(19, 2, 7, NULL, 'Having researched your company extensively, I am impressed by your commitment to excellence and would love to be part of your team.', 'applied', '2025-07-05 18:02:34', '2025-08-08 18:02:34'),
(20, 2, 8, NULL, 'I believe my qualifications and enthusiasm make me an ideal candidate for this position. I look forward to discussing my application with you.', 'applied', '2025-06-16 18:02:34', '2025-08-08 18:02:34'),
(21, 2, 9, NULL, 'I am excited to apply for this position. I have extensive experience in the relevant field and believe I would be a valuable addition to your team.', 'applied', '2025-06-29 18:02:34', '2025-08-08 18:02:34'),
(22, 2, 10, NULL, 'Having researched your company extensively, I am impressed by your commitment to excellence and would love to be part of your team.', 'shortlisted', '2025-07-26 18:02:34', '2025-08-08 18:02:34'),
(23, 7, 1, 2, 'I am a dedicated IT Business analyst with 15 years experience. I am the best candidate for this position.', 'rejected', '2025-08-09 20:31:45', '2025-08-09 20:33:38');

-- --------------------------------------------------------

--
-- Table structure for table `job_application_survey_responses`
--

CREATE TABLE `job_application_survey_responses` (
  `id` int(11) NOT NULL,
  `application_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `response` text NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `job_application_survey_responses`
--

INSERT INTO `job_application_survey_responses` (`id`, `application_id`, `question_id`, `response`, `created_at`) VALUES
(1, 2, 4, 'No Degree', '2025-08-04 10:34:51'),
(2, 2, 5, 'Yes', '2025-08-04 10:34:51'),
(3, 23, 8, 'Degree Information Technology', '2025-08-09 20:31:45'),
(4, 23, 9, '15', '2025-08-09 20:31:45');

-- --------------------------------------------------------

--
-- Table structure for table `job_categories`
--

CREATE TABLE `job_categories` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `job_categories`
--

INSERT INTO `job_categories` (`id`, `name`, `description`, `created_at`) VALUES
(1, 'Information Technology', 'Software development, IT support, cybersecurity', '2025-08-03 13:06:53'),
(2, 'Marketing', 'Digital marketing, content creation, brand management', '2025-08-03 13:06:53'),
(3, 'Finance', 'Accounting, financial analysis, banking', '2025-08-03 13:06:53'),
(4, 'Human Resources', 'Recruitment, employee relations, training', '2025-08-03 13:06:53'),
(5, 'Sales', 'Business development, account management, retail', '2025-08-03 13:06:53'),
(6, 'Engineering', 'Mechanical, electrical, civil engineering', '2025-08-03 13:06:53'),
(7, 'Healthcare', 'Medical, nursing, pharmacy', '2025-08-03 13:06:53'),
(8, 'Education', 'Teaching, training, academic research', '2025-08-03 13:06:53');

-- --------------------------------------------------------

--
-- Table structure for table `job_survey_questions`
--

CREATE TABLE `job_survey_questions` (
  `id` int(11) NOT NULL,
  `job_id` int(11) NOT NULL,
  `question` text NOT NULL,
  `question_type` enum('text','textarea','select','radio','checkbox') DEFAULT 'text',
  `options` text DEFAULT NULL,
  `is_required` tinyint(1) DEFAULT 1,
  `question_order` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `job_survey_questions`
--

INSERT INTO `job_survey_questions` (`id`, `job_id`, `question`, `question_type`, `options`, `is_required`, `question_order`, `created_at`) VALUES
(3, 1, 'Highest Qualification', 'select', '[\"Degree\",\"Diploma\",\"Certificate\"]', 1, 1, '2025-08-04 04:20:00'),
(4, 2, 'Have a Degree plus MBA', 'select', '[\"Degree\",\"Degree Plus postgraduate\",\"No Degree\"]', 1, 1, '2025-08-04 10:31:08'),
(5, 2, '10 years or more management experience', 'select', '[\"Yes\",\"No\"]', 1, 2, '2025-08-04 10:31:08'),
(8, 7, 'What is your highest qualification', 'text', '', 1, 1, '2025-08-09 20:29:17'),
(9, 7, 'How many years do have in a senior IT position', 'text', '', 1, 2, '2025-08-09 20:29:17');

-- --------------------------------------------------------

--
-- Table structure for table `rate_limits`
--

CREATE TABLE `rate_limits` (
  `id` int(11) NOT NULL,
  `identifier` varchar(255) NOT NULL,
  `action` varchar(50) NOT NULL DEFAULT 'login',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `recruitment_funnel`
--

CREATE TABLE `recruitment_funnel` (
  `id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `job_id` int(11) NOT NULL,
  `stage` enum('posted','applications','screening','interview','offer','hired','rejected') NOT NULL,
  `candidate_count` int(11) NOT NULL DEFAULT 0,
  `stage_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `resumes`
--

CREATE TABLE `resumes` (
  `id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `title` varchar(100) DEFAULT NULL,
  `summary` text DEFAULT NULL,
  `skills` text DEFAULT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `is_primary` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `document_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `resumes`
--

INSERT INTO `resumes` (`id`, `candidate_id`, `title`, `summary`, `skills`, `file_path`, `is_primary`, `created_at`, `updated_at`, `document_id`) VALUES
(1, 1, 'Masande Ndyaluvane Resume', 'I am a multi-skilled IT professional with over 15 years’ experience spanning the private sector, oil &amp; gas industry, provincial government, and local government. Demonstrated expertise in ICT governance, cloud computing, Microsoft technologies, and large-scale ICT project management. Adept at developing IT and business strategies, leading cross-functional teams, and delivering innovative solutions that improve service delivery. Strong background in MFMA and PFMA, risk management, strategy development, and IT service management. Recognized for analytical thinking, excellent communication, and driving operational excellence.', 'Microsoft Cloud (Azure, Office 365, SharePoint)   ICT Governance &amp; Strategy Development\r\n  IT Security &amp; Risk Management   IT Service Management             Project Management\r\n  Data Center Management &amp; Disaster Recovery   Budget Management (MFMA &amp; PFMA)\r\n  Software &amp; App Development\r\n   Business Intelligence &amp; Data Analysis\r\n  IT Audit management and recommendation  Policy Development &amp; Compliance\r\n   SAGE 300 &amp; SAGE People', NULL, 0, '2025-08-03 17:29:17', '2025-08-03 17:29:22', NULL),
(2, 1, 'Masande Ndyaluvane Resume', 'I am a multi-skilled IT professional with over 15 years’ experience spanning the private sector, oil &amp; gas industry, provincial government, and local government. Demonstrated expertise in ICT governance, cloud computing, Microsoft technologies, and large-scale ICT project management. Adept at developing IT and business strategies, leading cross-functional teams, and delivering innovative solutions that improve service delivery. Strong background in MFMA and PFMA, risk management, strategy development, and IT service management. Recognized for analytical thinking, excellent communication, and driving operational excellence.', 'Microsoft Cloud (Azure, Office 365, SharePoint)   ICT Governance &amp; Strategy Development\r\n  IT Security &amp; Risk Management   IT Service Management             Project Management\r\n  Data Center Management &amp; Disaster Recovery   Budget Management (MFMA &amp; PFMA)\r\n  Software &amp; App Development\r\n   Business Intelligence &amp; Data Analysis\r\n  IT Audit management and recommendation  Policy Development &amp; Compliance\r\n   SAGE 300 &amp; SAGE People', NULL, 1, '2025-08-03 17:29:22', '2025-08-03 17:29:22', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `source_effectiveness`
--

CREATE TABLE `source_effectiveness` (
  `id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `source_name` varchar(100) NOT NULL,
  `applications_count` int(11) DEFAULT 0,
  `hires_count` int(11) DEFAULT 0,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `source_effectiveness`
--

INSERT INTO `source_effectiveness` (`id`, `company_id`, `source_name`, `applications_count`, `hires_count`, `period_start`, `period_end`, `created_at`) VALUES
(1, 2, 'website', 33, 10, '2025-07-09', '2025-08-08', '2025-08-08 17:49:47'),
(2, 2, 'linkedin', 70, 8, '2025-07-09', '2025-08-08', '2025-08-08 17:49:47'),
(3, 2, 'referral', 59, 4, '2025-07-09', '2025-08-08', '2025-08-08 17:49:47'),
(4, 2, 'job_boards', 96, 7, '2025-07-09', '2025-08-08', '2025-08-08 17:49:47'),
(5, 2, 'social_media', 28, 4, '2025-07-09', '2025-08-08', '2025-08-08 17:49:47');

-- --------------------------------------------------------

--
-- Table structure for table `time_to_hire`
--

CREATE TABLE `time_to_hire` (
  `id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `job_id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `application_date` date NOT NULL,
  `hire_date` date NOT NULL,
  `days_to_hire` int(11) GENERATED ALWAYS AS (to_days(`hire_date`) - to_days(`application_date`)) STORED,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `time_to_hire`
--

INSERT INTO `time_to_hire` (`id`, `company_id`, `job_id`, `candidate_id`, `application_date`, `hire_date`, `created_at`) VALUES
(1, 2, 2, 1, '2025-05-02', '2025-05-10', '2025-08-08 17:49:46'),
(2, 2, 2, 1, '2025-04-21', '2025-05-13', '2025-08-08 17:49:46'),
(3, 2, 1, 1, '2025-04-04', '2025-05-14', '2025-08-08 17:49:46'),
(4, 2, 2, 1, '2025-04-04', '2025-05-15', '2025-08-08 17:49:46'),
(5, 2, 1, 1, '2025-05-07', '2025-05-27', '2025-08-08 17:49:46'),
(6, 2, 1, 1, '2025-05-13', '2025-06-01', '2025-08-08 17:49:46'),
(7, 2, 2, 1, '2025-05-20', '2025-06-05', '2025-08-08 17:49:46'),
(8, 2, 1, 1, '2025-05-19', '2025-06-11', '2025-08-08 17:49:46'),
(9, 2, 1, 1, '2025-05-07', '2025-06-21', '2025-08-08 17:49:46'),
(10, 2, 2, 1, '2025-05-20', '2025-06-22', '2025-08-08 17:49:46'),
(11, 2, 1, 1, '2025-06-11', '2025-06-26', '2025-08-08 17:49:46'),
(12, 2, 2, 1, '2025-06-01', '2025-07-01', '2025-08-08 17:49:47'),
(13, 2, 1, 1, '2025-06-24', '2025-07-04', '2025-08-08 17:49:47'),
(14, 2, 2, 1, '2025-06-28', '2025-07-05', '2025-08-08 17:49:47'),
(15, 2, 1, 1, '2025-06-06', '2025-07-08', '2025-08-08 17:49:47'),
(16, 2, 1, 1, '2025-06-01', '2025-07-10', '2025-08-08 17:49:47'),
(17, 2, 1, 1, '2025-06-09', '2025-07-11', '2025-08-08 17:49:47'),
(18, 2, 2, 1, '2025-07-09', '2025-07-20', '2025-08-08 17:49:47'),
(19, 2, 2, 1, '2025-07-01', '2025-07-24', '2025-08-08 17:49:47'),
(20, 2, 1, 1, '2025-07-03', '2025-07-26', '2025-08-08 17:49:47'),
(21, 2, 1, 1, '2025-06-23', '2025-07-29', '2025-08-08 17:49:47'),
(22, 2, 2, 1, '2025-06-23', '2025-08-01', '2025-08-08 17:49:47'),
(23, 2, 2, 1, '2025-07-14', '2025-08-06', '2025-08-08 17:49:47');

-- --------------------------------------------------------

--
-- Table structure for table `work_experience`
--

CREATE TABLE `work_experience` (
  `id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `company_name` varchar(100) NOT NULL,
  `position` varchar(100) NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `is_current` tinyint(1) DEFAULT 0,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `work_experience`
--

INSERT INTO `work_experience` (`id`, `candidate_id`, `company_name`, `position`, `start_date`, `end_date`, `is_current`, `description`, `created_at`) VALUES
(1, 1, 'Walter Sisulu University', 'Software Developer', '2009-01-05', '2013-01-31', 0, 'Manage development of software solutions, cloud servers, ICT policies, and Business Intelligence systems.\r\nLead software applications projects including institutional website, student portal, online results, and ITS reporting (ERP system).', '2025-08-03 17:48:12'),
(2, 1, 'KSD Municipality', 'System Administrator', '2013-02-01', '2013-06-30', 0, 'Manage application servers environment, Software Applications backups, disaster recovery, Service Level Agreements.\r\nManage software applications user access and daily operations.', '2025-08-03 17:49:42'),
(3, 1, 'Office of the Premier EC', 'Provincial Software &amp; Applications Developer', '2013-07-01', NULL, 1, 'Manage provincial hosting environment, Business Analysis and service level agreements.\r\n Develop software applications for provincial departments.\r\nDevelop provincial Applications enterprise architecture.', '2025-08-03 17:52:37');

-- --------------------------------------------------------

--
-- Table structure for table `work_references`
--

CREATE TABLE `work_references` (
  `id` int(11) NOT NULL,
  `candidate_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `position` varchar(100) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `relationship` varchar(100) DEFAULT NULL,
  `years_known` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `work_references`
--

INSERT INTO `work_references` (`id`, `candidate_id`, `name`, `position`, `company`, `email`, `phone`, `relationship`, `years_known`, `created_at`) VALUES
(1, 1, 'Jongikhaya Stuurman', 'CIO', 'Petrosa', 'jongikhaya.stuurman@petrosa.co.za', '0739781234', 'CIO', 7, '2025-08-03 17:54:18');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `candidates`
--
ALTER TABLE `candidates`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `candidate_documents`
--
ALTER TABLE `candidate_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `candidate_id` (`candidate_id`);

--
-- Indexes for table `certificates`
--
ALTER TABLE `certificates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `candidate_id` (`candidate_id`);

--
-- Indexes for table `companies`
--
ALTER TABLE `companies`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `company_users`
--
ALTER TABLE `company_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD KEY `company_id` (`company_id`);

--
-- Indexes for table `education`
--
ALTER TABLE `education`
  ADD PRIMARY KEY (`id`),
  ADD KEY `candidate_id` (`candidate_id`);

--
-- Indexes for table `hr_analytics`
--
ALTER TABLE `hr_analytics`
  ADD PRIMARY KEY (`id`),
  ADD KEY `job_id` (`job_id`),
  ADD KEY `candidate_id` (`candidate_id`),
  ADD KEY `idx_company_metric` (`company_id`,`metric_type`),
  ADD KEY `idx_created_at` (`created_at`);

--
-- Indexes for table `hr_performance_metrics`
--
ALTER TABLE `hr_performance_metrics`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_company_period` (`company_id`,`metric_period`,`period_start`);

--
-- Indexes for table `interviews`
--
ALTER TABLE `interviews`
  ADD PRIMARY KEY (`id`),
  ADD KEY `application_id` (`application_id`);

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `company_id` (`company_id`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `company_user_id` (`company_user_id`);

--
-- Indexes for table `job_applications`
--
ALTER TABLE `job_applications`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_application` (`job_id`,`candidate_id`),
  ADD KEY `candidate_id` (`candidate_id`),
  ADD KEY `resume_id` (`resume_id`);

--
-- Indexes for table `job_application_survey_responses`
--
ALTER TABLE `job_application_survey_responses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_application_question` (`application_id`,`question_id`),
  ADD KEY `question_id` (`question_id`);

--
-- Indexes for table `job_categories`
--
ALTER TABLE `job_categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `job_survey_questions`
--
ALTER TABLE `job_survey_questions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `job_id` (`job_id`);

--
-- Indexes for table `rate_limits`
--
ALTER TABLE `rate_limits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_identifier_action_time` (`identifier`,`action`,`created_at`);

--
-- Indexes for table `recruitment_funnel`
--
ALTER TABLE `recruitment_funnel`
  ADD PRIMARY KEY (`id`),
  ADD KEY `job_id` (`job_id`),
  ADD KEY `idx_company_job` (`company_id`,`job_id`),
  ADD KEY `idx_stage_date` (`stage`,`stage_date`);

--
-- Indexes for table `resumes`
--
ALTER TABLE `resumes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `candidate_id` (`candidate_id`),
  ADD KEY `document_id` (`document_id`);

--
-- Indexes for table `source_effectiveness`
--
ALTER TABLE `source_effectiveness`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_company_period` (`company_id`,`period_start`);

--
-- Indexes for table `time_to_hire`
--
ALTER TABLE `time_to_hire`
  ADD PRIMARY KEY (`id`),
  ADD KEY `job_id` (`job_id`),
  ADD KEY `candidate_id` (`candidate_id`),
  ADD KEY `idx_company_hire_date` (`company_id`,`hire_date`);

--
-- Indexes for table `work_experience`
--
ALTER TABLE `work_experience`
  ADD PRIMARY KEY (`id`),
  ADD KEY `candidate_id` (`candidate_id`);

--
-- Indexes for table `work_references`
--
ALTER TABLE `work_references`
  ADD PRIMARY KEY (`id`),
  ADD KEY `candidate_id` (`candidate_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `candidates`
--
ALTER TABLE `candidates`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `candidate_documents`
--
ALTER TABLE `candidate_documents`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `certificates`
--
ALTER TABLE `certificates`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `companies`
--
ALTER TABLE `companies`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `company_users`
--
ALTER TABLE `company_users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `education`
--
ALTER TABLE `education`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `hr_analytics`
--
ALTER TABLE `hr_analytics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=406;

--
-- AUTO_INCREMENT for table `hr_performance_metrics`
--
ALTER TABLE `hr_performance_metrics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `interviews`
--
ALTER TABLE `interviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `job_applications`
--
ALTER TABLE `job_applications`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `job_application_survey_responses`
--
ALTER TABLE `job_application_survey_responses`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `job_categories`
--
ALTER TABLE `job_categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `job_survey_questions`
--
ALTER TABLE `job_survey_questions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `rate_limits`
--
ALTER TABLE `rate_limits`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `recruitment_funnel`
--
ALTER TABLE `recruitment_funnel`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `resumes`
--
ALTER TABLE `resumes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `source_effectiveness`
--
ALTER TABLE `source_effectiveness`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `time_to_hire`
--
ALTER TABLE `time_to_hire`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `work_experience`
--
ALTER TABLE `work_experience`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `work_references`
--
ALTER TABLE `work_references`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `candidate_documents`
--
ALTER TABLE `candidate_documents`
  ADD CONSTRAINT `candidate_documents_ibfk_1` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `certificates`
--
ALTER TABLE `certificates`
  ADD CONSTRAINT `certificates_ibfk_1` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `company_users`
--
ALTER TABLE `company_users`
  ADD CONSTRAINT `company_users_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `education`
--
ALTER TABLE `education`
  ADD CONSTRAINT `education_ibfk_1` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `hr_analytics`
--
ALTER TABLE `hr_analytics`
  ADD CONSTRAINT `hr_analytics_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `hr_analytics_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `hr_analytics_ibfk_3` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `hr_performance_metrics`
--
ALTER TABLE `hr_performance_metrics`
  ADD CONSTRAINT `hr_performance_metrics_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `interviews`
--
ALTER TABLE `interviews`
  ADD CONSTRAINT `interviews_ibfk_1` FOREIGN KEY (`application_id`) REFERENCES `job_applications` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `jobs`
--
ALTER TABLE `jobs`
  ADD CONSTRAINT `jobs_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `jobs_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `job_categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `jobs_ibfk_3` FOREIGN KEY (`company_user_id`) REFERENCES `company_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `job_applications`
--
ALTER TABLE `job_applications`
  ADD CONSTRAINT `job_applications_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `job_applications_ibfk_2` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `job_applications_ibfk_3` FOREIGN KEY (`resume_id`) REFERENCES `resumes` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `job_application_survey_responses`
--
ALTER TABLE `job_application_survey_responses`
  ADD CONSTRAINT `job_application_survey_responses_ibfk_1` FOREIGN KEY (`application_id`) REFERENCES `job_applications` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `job_application_survey_responses_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `job_survey_questions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `job_survey_questions`
--
ALTER TABLE `job_survey_questions`
  ADD CONSTRAINT `job_survey_questions_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `recruitment_funnel`
--
ALTER TABLE `recruitment_funnel`
  ADD CONSTRAINT `recruitment_funnel_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `recruitment_funnel_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `resumes`
--
ALTER TABLE `resumes`
  ADD CONSTRAINT `resumes_ibfk_1` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `resumes_ibfk_2` FOREIGN KEY (`document_id`) REFERENCES `candidate_documents` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `source_effectiveness`
--
ALTER TABLE `source_effectiveness`
  ADD CONSTRAINT `source_effectiveness_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `time_to_hire`
--
ALTER TABLE `time_to_hire`
  ADD CONSTRAINT `time_to_hire_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `time_to_hire_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `time_to_hire_ibfk_3` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `work_experience`
--
ALTER TABLE `work_experience`
  ADD CONSTRAINT `work_experience_ibfk_1` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `work_references`
--
ALTER TABLE `work_references`
  ADD CONSTRAINT `work_references_ibfk_1` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
