-- =============================================================================
-- PeopleFlow HRIS - Commercial-Grade Multi-Tenant SaaS HRIS
-- MySQL 8.x Complete Database Dump (DDL + Initial Seed Data)
-- Character Set: utf8mb4 | Collation: utf8mb4_unicode_ci
-- Timezone: Asia/Dhaka (GMT+6) | Default Currency: BDT (৳)
-- Compatible with: MySQL 8.0+, MySQL 8.2+, MariaDB 10.4+, phpMyAdmin, cPanel
-- =============================================================================

/*!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 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+06:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

CREATE DATABASE IF NOT EXISTS `peopleflow_hris` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE `peopleflow_hris`;

--
-- Table structure for table `migrations`
--
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations` (11 records)
--
LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '2026_01_01_000001_create_departments_table', 1),
(3, '2026_01_01_000002_create_designations_table', 1),
(4, '2026_01_01_000003_create_work_schedules_table', 1),
(5, '2026_01_01_000004_create_employees_table', 1),
(6, '2026_01_01_000005_create_attendance_table', 1),
(7, '2026_01_01_000006_create_leave_types_table', 1),
(8, '2026_01_01_000007_create_leave_requests_table', 1),
(9, '2026_01_01_000008_create_audit_logs_table', 1),
(10, '2026_01_01_000009_create_settings_table', 1),
(11, '2026_01_01_000010_create_saas_and_extended_modules_tables', 1);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `organizations`
--
DROP TABLE IF EXISTS `organizations`;
CREATE TABLE `organizations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Bangladesh',
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'BDT',
  `currency_symbol` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '৳',
  `timezone` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Asia/Dhaka',
  `logo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('active','trial','suspended') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trial',
  `trial_ends_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `organizations_slug_unique` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `organizations` (1 records)
--
LOCK TABLES `organizations` WRITE;
/*!40000 ALTER TABLE `organizations` DISABLE KEYS */;
INSERT INTO `organizations` (`id`, `name`, `slug`, `email`, `phone`, `address`, `city`, `country`, `currency`, `currency_symbol`, `timezone`, `logo_path`, `status`, `trial_ends_at`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'PeopleFlow Technologies Ltd.', 'peopleflow-bangladesh', 'contact@peopleflow.com', '+880 2 9882200', 'Avenue 5, Gulshan-2, Dhaka-1212', 'Dhaka', 'Bangladesh', 'BDT', '৳', 'Asia/Dhaka', NULL, 'active', '2027-10-28 12:27:22', '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL);
/*!40000 ALTER TABLE `organizations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `subscription_plans`
--
DROP TABLE IF EXISTS `subscription_plans`;
CREATE TABLE `subscription_plans` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price_monthly` decimal(10,2) NOT NULL DEFAULT '0.00',
  `price_yearly` decimal(10,2) NOT NULL DEFAULT '0.00',
  `employee_limit` int NOT NULL DEFAULT '50',
  `storage_limit_mb` int NOT NULL DEFAULT '1024',
  `features` json DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscription_plans_slug_unique` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `subscription_plans` (4 records)
--
LOCK TABLES `subscription_plans` WRITE;
/*!40000 ALTER TABLE `subscription_plans` DISABLE KEYS */;
INSERT INTO `subscription_plans` (`id`, `name`, `slug`, `price_monthly`, `price_yearly`, `employee_limit`, `storage_limit_mb`, `features`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Starter', 'starter', 4999, 49990, 20, 1024, '["Employee Directory","Attendance","Leave Management"]', 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(2, 'Professional', 'professional', 9999, 99990, 50, 5120, '["All Starter Features","BDT Payroll Processing","Document Vault","Reports"]', 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(3, 'Business', 'business', 19999, 199990, 150, 15360, '["All Professional Features","Recruitment ATS","HR Helpdesk","Audit Logs"]', 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(4, 'Enterprise', 'enterprise', 39999, 399990, 500, 51200, '["Unlimited Scaling","Dedicated Account Manager","Custom API & Biometrics"]', 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `subscription_plans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `organization_subscriptions`
--
DROP TABLE IF EXISTS `organization_subscriptions`;
CREATE TABLE `organization_subscriptions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `subscription_plan_id` bigint unsigned NOT NULL,
  `status` enum('trialing','active','past_due','canceled','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trialing',
  `billing_cycle` enum('monthly','yearly') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'monthly',
  `starts_at` datetime NOT NULL,
  `ends_at` datetime NOT NULL,
  `trial_ends_at` datetime DEFAULT NULL,
  `payment_method` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `org_subscriptions_org_idx` (`organization_id`),
  KEY `org_subscriptions_plan_idx` (`subscription_plan_id`),
  CONSTRAINT `fk_org_sub_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_org_sub_plan` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `organization_subscriptions` (1 records)
--
LOCK TABLES `organization_subscriptions` WRITE;
/*!40000 ALTER TABLE `organization_subscriptions` DISABLE KEYS */;
INSERT INTO `organization_subscriptions` (`id`, `organization_id`, `subscription_plan_id`, `status`, `billing_cycle`, `starts_at`, `ends_at`, `trial_ends_at`, `payment_method`, `created_at`, `updated_at`) VALUES
(1, 1, 2, 'active', 'monthly', '2026-08-28 12:27:22', '2027-08-28 12:27:22', NULL, 'bank_transfer', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `organization_subscriptions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `modules`
--
DROP TABLE IF EXISTS `modules`;
CREATE TABLE `modules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `icon` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bi-grid',
  `is_core` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `modules_key_unique` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `modules` (8 records)
--
LOCK TABLES `modules` WRITE;
/*!40000 ALTER TABLE `modules` DISABLE KEYS */;
INSERT INTO `modules` (`id`, `key`, `name`, `description`, `icon`, `is_core`, `created_at`, `updated_at`) VALUES
(1, 'employees', 'Employee Management', 'Directory, profiles, departments and designations', 'bi-person-lines-fill', 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(2, 'attendance', 'Attendance Management', 'Biometric punches, late arrival flags and overtime logs', 'bi-clock-history', 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(3, 'leaves', 'Leave Management', 'Multi-tier approvals, quotas and team calendar', 'bi-calendar-check', 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(4, 'payroll', 'Payroll Management', 'Monthly BDT calculations, allowances, statutory tax and payslips', 'bi-cash-stack', 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(5, 'documents', 'Document Vault', 'Encrypted document management and expiry alerts', 'bi-file-earmark-lock2', 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(6, 'recruitment', 'Recruitment & ATS', 'Job vacancies, resume parsing and candidate pipeline', 'bi-briefcase', 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(7, 'helpdesk', 'HR Helpdesk', 'Employee service requests and grievance tracking', 'bi-headset', 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(8, 'reports', 'Reports & Analytics', 'Turnout graphs, payroll trends and CSV export streaming', 'bi-bar-chart-line', 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `modules` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `organization_modules`
--
DROP TABLE IF EXISTS `organization_modules`;
CREATE TABLE `organization_modules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `module_id` bigint unsigned NOT NULL,
  `is_enabled` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `org_module_unique` (`organization_id`,`module_id`),
  KEY `org_modules_mod_idx` (`module_id`),
  CONSTRAINT `fk_org_mod_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_org_mod_module` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `organization_modules` (8 records)
--
LOCK TABLES `organization_modules` WRITE;
/*!40000 ALTER TABLE `organization_modules` DISABLE KEYS */;
INSERT INTO `organization_modules` (`id`, `organization_id`, `module_id`, `is_enabled`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(2, 1, 2, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(3, 1, 3, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(4, 1, 4, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(5, 1, 5, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(6, 1, 6, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(7, 1, 7, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(8, 1, 8, 1, '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `organization_modules` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `branches`
--
DROP TABLE IF EXISTS `branches`;
CREATE TABLE `branches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_head_office` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `branches_org_idx` (`organization_id`),
  CONSTRAINT `fk_branch_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` enum('super_admin','hr_admin','department_manager','employee') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'employee',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_role_idx` (`role`),
  KEY `users_is_active_idx` (`is_active`),
  KEY `users_org_idx` (`organization_id`),
  CONSTRAINT `fk_users_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users` (50 records)
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `role`, `is_active`, `remember_token`, `created_at`, `updated_at`, `deleted_at`, `organization_id`) VALUES
(1, 'Mahmudul Hasan', 'mahmudul.hasan@peopleflow.com', '2026-10-28 12:27:13', '$2y$12$6kSWQKbKw5zZaNqiTRrnkOkXBdcrmE6roKQ43i63Far8NZB/JUu/u', 'super_admin', 1, NULL, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(2, 'Tasnim Jahan', 'tasnim.jahan@peopleflow.com', '2026-10-28 12:27:13', '$2y$12$aW926qiJKcwwc21OXcOv0.jVruywELQUDTD2NSxDnHiyeYsTF5Ota', 'super_admin', 1, NULL, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(3, 'Nusrat Sharmin', 'nusrat.sharmin@peopleflow.com', '2026-10-28 12:27:13', '$2y$12$Kx5BjZL8XybTCOEMbg3DZuZMsAc09cwIGai9cYzVZo.2991A7yZTy', 'employee', 1, NULL, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(4, 'Farhana Chowdhury', 'farhana.chowdhury@peopleflow.com', '2026-10-28 12:27:14', '$2y$12$t7HoA76OclnKB0ZEMeva6u7SOoK0YTh0J009dZ6q89QBrpVoAbfTK', 'hr_admin', 1, NULL, '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1),
(5, 'Tanvir Ahmed', 'tanvir.ahmed@peopleflow.com', '2026-10-28 12:27:14', '$2y$12$gNi/TMF8P0nOe3EAbM1nKujfprT7Mtfpz5mUI94/dfTm0Lugq9F0i', 'hr_admin', 1, NULL, '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1),
(6, 'Sharmin Akter', 'sharmin.akter@peopleflow.com', '2026-10-28 12:27:14', '$2y$12$J1ErI8N6EBiMHRECm2OZKea0PlaMIfyTVP2AIRODSYuy76oK7uN5G', 'employee', 1, NULL, '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1),
(7, 'Kazi Riad', 'kazi.riad@peopleflow.com', '2026-10-28 12:27:14', '$2y$12$9hupsoZ.nI3wDhJu6MOXwudJ0MxNupgDAXh1krz3LvOGCY4RDtB5m', 'employee', 1, NULL, '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1),
(8, 'Mustafa Rahman', 'mustafa.rahman@peopleflow.com', '2026-10-28 12:27:14', '$2y$12$f7d3qDiBYifbOrXQaJga/.aRUX9NITRpveil58p/U5Flt243ovGgy', 'department_manager', 1, NULL, '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1),
(9, 'Nazmul Huda', 'nazmul.huda@peopleflow.com', '2026-10-28 12:27:15', '$2y$12$AYRMsrG6fFF.VuCg9yM1.OwdXiNaD2Ycc5woYLADyMP71sASb47XK', 'employee', 1, NULL, '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1),
(10, 'Mithila Sultana', 'mithila.sultana@peopleflow.com', '2026-10-28 12:27:15', '$2y$12$06YGFJ3hYG.5oWfeL2R2de/cGdbKsGcxK7V/W7AGiiwrZmpL0j5ne', 'employee', 1, NULL, '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1),
(11, 'Sakib Al-Hasan', 'sakib.al-hasan@peopleflow.com', '2026-10-28 12:27:15', '$2y$12$9qhKlGmVmJder49Z.9xKjeIYXK/53wVjQKIij4sV/Py8g135dRIPi', 'employee', 1, NULL, '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1),
(12, 'Zubair Alam', 'zubair.alam@peopleflow.com', '2026-10-28 12:27:15', '$2y$12$PC1kmpDs4RYNCtZrBstWVeUzkgV/QRZh.1UmwjHlRT7LTNvf64vK6', 'department_manager', 1, NULL, '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1),
(13, 'Asif Iqbal', 'asif.iqbal@peopleflow.com', '2026-10-28 12:27:15', '$2y$12$if3/Nf.OGEeBdujw5Md7eOw5sAREjt7mOERACfWM3BKZFYVuJYXKy', 'employee', 1, NULL, '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1),
(14, 'Sadia Afrin', 'sadia.afrin@peopleflow.com', '2026-10-28 12:27:16', '$2y$12$ZbbD3zeofxlj5z1V/LPhmO8kyA9gdmqu8e4Mp3CJieVmWC6HBWe.C', 'employee', 1, NULL, '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1),
(15, 'Tahmid Khan', 'tahmid.khan@peopleflow.com', '2026-10-28 12:27:16', '$2y$12$ZMNBJlmyOZopKzgwA..LB.t0vYJZcEs3SnD2X/yxDB0chpT.3fRVG', 'employee', 1, NULL, '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1),
(16, 'Rezaul Karim', 'rezaul.karim@peopleflow.com', '2026-10-28 12:27:16', '$2y$12$Llm.F6xpUvslHO6ZsxjdFu8VE17viQRTrOadIUeAoMpS8N8TrcAjS', 'employee', 1, NULL, '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1),
(17, 'Rumana Islam', 'rumana.islam@peopleflow.com', '2026-10-28 12:27:16', '$2y$12$FA2llmOQfOZqiOE81fGbk.XOX98/R18c6xiTnd2RJ6QjkhRa5nIdq', 'employee', 1, NULL, '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1),
(18, 'Mehedi Hasan', 'mehedi.hasan@peopleflow.com', '2026-10-28 12:27:16', '$2y$12$ZLo2p05GLgcc3otyZHEKOuXClasoJJfpURCePcHp9D8IcMUCzSTbm', 'employee', 1, NULL, '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1),
(19, 'Ayesha Siddiqua', 'ayesha.siddiqua@peopleflow.com', '2026-10-28 12:27:16', '$2y$12$N4lvJE8UDLEW/kFxigom9uamvXnggszr64leoT9Kd8CjLkWvAZnse', 'employee', 1, NULL, '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1),
(20, 'Fahim Faysal', 'fahim.faysal@peopleflow.com', '2026-10-28 12:27:17', '$2y$12$GPs1eScei/rUwEq4QlVGiuOwR/1p2VbvGaMPQp/lrpD.JtO/ZY.CS', 'employee', 1, NULL, '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1),
(21, 'Naimur Rahman', 'naimur.rahman@peopleflow.com', '2026-10-28 12:27:17', '$2y$12$tjj7KXLvDa2hjbRYLuFQkum83gHEMC4d6VQ8d/qcuSmtaLRpKGqe6', 'employee', 1, NULL, '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1),
(22, 'Shahidul Islam', 'shahidul.islam@peopleflow.com', '2026-10-28 12:27:17', '$2y$12$glX06xnYyiQAOV5w.daqKuR2A7fOU6gIkhZYnB/Arxclj7KxVE0H.', 'employee', 1, NULL, '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1),
(23, 'Sanjida Khatun', 'sanjida.khatun@peopleflow.com', '2026-10-28 12:27:17', '$2y$12$AFq8p1gz7nOoDnGkPtNn/OUHeGOLD3sYyCBe29kAMmiAsUwcTLz6a', 'employee', 1, NULL, '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1),
(24, 'Arifur Rahman', 'arifur.rahman@peopleflow.com', '2026-10-28 12:27:17', '$2y$12$.JrBakQw3nYdy3CfKnsMZu/jkohd7u/xhG8ODIa0inQxgDNAIShqK', 'employee', 1, NULL, '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1),
(25, 'Imtiaz Ahmed', 'imtiaz.ahmed@peopleflow.com', '2026-10-28 12:27:18', '$2y$12$p0lOuIUpG1fwstv2rahVHeQ6b7EIf75p8Cjy2m5iW6VQ3MVAF6l/u', 'department_manager', 1, NULL, '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1),
(26, 'Kamrul Hasan', 'kamrul.hasan@peopleflow.com', '2026-10-28 12:27:18', '$2y$12$UDSyBu1y.XvOuewidIo7eONFT7wc1Ckk3rnTlR.ykJ4xB7YWvphku', 'employee', 1, NULL, '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1),
(27, 'Laila Anjuman', 'laila.anjuman@peopleflow.com', '2026-10-28 12:27:18', '$2y$12$PoyGiZ1wbTzPdnti54cEVecxeZz30S0hpRhE85edzeTQ.U1D6zDDm', 'employee', 1, NULL, '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1),
(28, 'Rashed Chowdhury', 'rashed.chowdhury@peopleflow.com', '2026-10-28 12:27:18', '$2y$12$A8n2c3EPpoDpBbaDWkRXm.FZCv2Ej8W2DlhUzzlgCsegyJAppdyai', 'employee', 1, NULL, '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1),
(29, 'Babor Ali', 'babor.ali@peopleflow.com', '2026-10-28 12:27:18', '$2y$12$JpAyWYe0S2lm8TrRYDq/segKRlvwmr9r/VFPukTFVXJ6PbpiPo2T6', 'employee', 1, NULL, '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1),
(30, 'Sumona Nasrin', 'sumona.nasrin@peopleflow.com', '2026-10-28 12:27:19', '$2y$12$.0NCMpyZt9TVx1CSY/YY6.vEOGXm6mJ230HtxUTA48K3EqbohAGcS', 'employee', 1, NULL, '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1),
(31, 'Jewel Rana', 'jewel.rana@peopleflow.com', '2026-10-28 12:27:19', '$2y$12$eawNnYTEtnvxy5j1qkXznustHPEoQnMHuHfy6QjFeR7OIQ6WBJIqC', 'employee', 1, NULL, '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1),
(32, 'Shahriar Kabir', 'shahriar.kabir@peopleflow.com', '2026-10-28 12:27:19', '$2y$12$e0C6saWUrHU5hxHPHr.TjuD9D2TCUBGhOFt5FFczo9FyUZb/0X1f2', 'department_manager', 1, NULL, '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1),
(33, 'Anika Tabassum', 'anika.tabassum@peopleflow.com', '2026-10-28 12:27:19', '$2y$12$b2CIIfYdyDsK7gb54ikwEu4QZrSHmV8Lyw8aTRt315JzsD6wTLlu2', 'employee', 1, NULL, '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1),
(34, 'Shakil Mahmud', 'shakil.mahmud@peopleflow.com', '2026-10-28 12:27:19', '$2y$12$zJC0kqS3SIDmaJfC7yuTMuywnF1Lrvq2Tmrfo7Z/rAwcSEujha4ga', 'employee', 1, NULL, '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1),
(35, 'Monir Hossain', 'monir.hossain@peopleflow.com', '2026-10-28 12:27:19', '$2y$12$xDtD0OMFfkDFIAXVJu9OHe1YV9ULmCNLrYH.ZGX46SJekEu2y4x2q', 'employee', 1, NULL, '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1),
(36, 'Tania Parveen', 'tania.parveen@peopleflow.com', '2026-10-28 12:27:20', '$2y$12$/emoLJ2oKdrRdW6/YFh95eFUZrR6xy3tuVUKiT/sH.qT3ayAlnHgy', 'employee', 1, NULL, '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1),
(37, 'Ashfaq Nabi', 'ashfaq.nabi@peopleflow.com', '2026-10-28 12:27:20', '$2y$12$F4uwQEkzbfBL1slJ6OyrW.I0EblQP4Nku..SKxCxrCZ/RH7O5/jza', 'employee', 1, NULL, '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1),
(38, 'Habibur Rahman', 'habibur.rahman@peopleflow.com', '2026-10-28 12:27:20', '$2y$12$P5iTCSome/hVs9QEd.TsdevlR3S4SjeIaYlaBSMle5R3gLhQkoVN2', 'employee', 1, NULL, '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1),
(39, 'Sabrina Mostofa', 'sabrina.mostofa@peopleflow.com', '2026-10-28 12:27:20', '$2y$12$HIDlkAFyxq85yfhzjivuXeGlaBWO.DGnCt3uw96FlqEz1kWEF00nq', 'employee', 1, NULL, '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1),
(40, 'Delwar Jahid', 'delwar.jahid@peopleflow.com', '2026-10-28 12:27:20', '$2y$12$XwAo7oCTvo7ouOtwy0RsiO64ZQaKHn9tG2Ql2l5JABrH3YKieQqAW', 'employee', 1, NULL, '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1),
(41, 'Khadija Begum', 'khadija.begum@peopleflow.com', '2026-10-28 12:27:21', '$2y$12$NWzbBJq.Egaps5EQX5o93.v/OMgzy.AiRSQqCg.HBeBmbT21O3.SO', 'employee', 1, NULL, '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1),
(42, 'Firoz Shah', 'firoz.shah@peopleflow.com', '2026-10-28 12:27:21', '$2y$12$7F3CQxObBmAfSxBatsVqE.0lRLe2ctPr26MBuB8FOoZIemEYyFv3q', 'employee', 1, NULL, '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1),
(43, 'Lamia Tabassum', 'lamia.tabassum@peopleflow.com', '2026-10-28 12:27:21', '$2y$12$7sf.je2ESJIYNuW4openOezI3f87ESGv7pnpkF8qqufSclMB0m5Qy', 'employee', 1, NULL, '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1),
(44, 'Saiful Islam', 'saiful.islam@peopleflow.com', '2026-10-28 12:27:21', '$2y$12$2Pn5SmVK/YuY76BTPPLwoeeir55lw7arP0Ipp5/e95/uq7Zb5jQkW', 'employee', 1, NULL, '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1),
(45, 'Rina Khanam', 'rina.khanam@peopleflow.com', '2026-10-28 12:27:21', '$2y$12$C.Wfn1N57ycEO2arhmiwKuiAHL8.ueDEleaSkqlrmu./zWi8l6ac2', 'employee', 1, NULL, '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1),
(46, 'Anwar Hossain', 'anwar.hossain@peopleflow.com', '2026-10-28 12:27:21', '$2y$12$mSp5c1419ZTcZNPbRMSbpulqA4xinR64.AudyJ5CLwpcZKMzE0eiy', 'employee', 1, NULL, '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1),
(47, 'Farzana Yeasmin', 'farzana.yeasmin@peopleflow.com', '2026-10-28 12:27:22', '$2y$12$c4vv.k7zS1.LcpRTsGKCvepiZn5JuP85F.2MNct21ZsJdPQ6szbSO', 'employee', 1, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1),
(48, 'Nazir Uddin', 'nazir.uddin@peopleflow.com', '2026-10-28 12:27:22', '$2y$12$hnng5GqBLvSW9FWplAJtNOf6WCOdzyJknRRTT9.buUP9Q.VbfHtmi', 'employee', 1, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1),
(49, 'Tahmina Binte', 'tahmina.binte@peopleflow.com', '2026-10-28 12:27:22', '$2y$12$OAFitnS/reQPFE10Sw/0IORRkeekUjc3euB6Y1SnqzRjqIJ2IBiom', 'employee', 1, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1),
(50, 'Jannatul Ferdous', 'jannatul.ferdous@peopleflow.com', '2026-10-28 12:27:22', '$2y$12$hV6xlFPunQ7F3ndRUS0FouA8fEXrFz0uNnlbCvV347NWD/rRoVK.C', 'employee', 1, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_reset_tokens`
--
DROP TABLE IF EXISTS `password_reset_tokens`;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `sessions`
--
DROP TABLE IF EXISTS `sessions`;
CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `departments`
--
DROP TABLE IF EXISTS `departments`;
CREATE TABLE `departments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `manager_id` bigint unsigned DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `departments_org_idx` (`organization_id`),
  CONSTRAINT `fk_departments_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `departments` (6 records)
--
LOCK TABLES `departments` WRITE;
/*!40000 ALTER TABLE `departments` DISABLE KEYS */;
INSERT INTO `departments` (`id`, `name`, `code`, `description`, `manager_id`, `is_active`, `created_at`, `updated_at`, `deleted_at`, `organization_id`) VALUES
(1, 'Administration', 'ADM', 'Executive management and administrative operations.', 1, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(2, 'Human Resources', 'HR', 'Talent acquisition, employee welfare, and compliance.', 4, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(3, 'Finance & Accounts', 'FIN', 'Financial planning, payroll, and fiscal audits.', 8, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(4, 'Information Technology', 'IT', 'Software engineering, infrastructure, and cybersecurity.', 12, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(5, 'Operations', 'OPS', 'Business process logistics and client delivery.', 25, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(6, 'Sales & Marketing', 'SAL', 'Enterprise sales, partnerships, and brand marketing.', 32, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1);
/*!40000 ALTER TABLE `departments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `designations`
--
DROP TABLE IF EXISTS `designations`;
CREATE TABLE `designations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `department_id` bigint unsigned NOT NULL,
  `title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `level` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `designations_dept_idx` (`department_id`),
  KEY `designations_org_idx` (`organization_id`),
  CONSTRAINT `fk_designations_dept` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_designations_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `designations` (26 records)
--
LOCK TABLES `designations` WRITE;
/*!40000 ALTER TABLE `designations` DISABLE KEYS */;
INSERT INTO `designations` (`id`, `department_id`, `title`, `code`, `description`, `is_active`, `created_at`, `updated_at`, `deleted_at`, `organization_id`) VALUES
(1, 1, 'Chief Executive Officer', 'CEO', 'Chief Executive Officer within Administration', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(2, 1, 'Managing Director', 'MD', 'Managing Director within Administration', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(3, 1, 'Executive Assistant', 'EA', 'Executive Assistant within Administration', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(4, 2, 'Head of Human Resources', 'HHR', 'Head of Human Resources within Human Resources', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(5, 2, 'HR Operations Manager', 'HROM', 'HR Operations Manager within Human Resources', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(6, 2, 'Senior HR Specialist', 'SHRS', 'Senior HR Specialist within Human Resources', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(7, 2, 'Talent Acquisition Executive', 'TAE', 'Talent Acquisition Executive within Human Resources', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(8, 3, 'Finance Director', 'FD', 'Finance Director within Finance & Accounts', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(9, 3, 'Senior Accountant', 'SRACC', 'Senior Accountant within Finance & Accounts', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(10, 3, 'Payroll Specialist', 'PS', 'Payroll Specialist within Finance & Accounts', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(11, 3, 'Accounts Officer', 'AO', 'Accounts Officer within Finance & Accounts', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(12, 4, 'Chief Technology Officer', 'CTO', 'Chief Technology Officer within Information Technology', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(13, 4, 'Lead Software Architect', 'LSA', 'Lead Software Architect within Information Technology', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(14, 4, 'Senior Full Stack Engineer', 'SFSE', 'Senior Full Stack Engineer within Information Technology', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(15, 4, 'DevOps & Cloud Engineer', 'DCE', 'DevOps & Cloud Engineer within Information Technology', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(16, 4, 'QA Automation Lead', 'QAL', 'QA Automation Lead within Information Technology', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(17, 4, 'Software Engineer', 'SE', 'Software Engineer within Information Technology', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(18, 4, 'IT Support Specialist', 'ITSS', 'IT Support Specialist within Information Technology', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(19, 5, 'Chief Operating Officer', 'COO', 'Chief Operating Officer within Operations', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(20, 5, 'Operations Manager', 'OM', 'Operations Manager within Operations', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(21, 5, 'Logistics Coordinator', 'LC', 'Logistics Coordinator within Operations', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(22, 5, 'Process Executive', 'PE', 'Process Executive within Operations', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(23, 6, 'Head of Business Development', 'HBD', 'Head of Business Development within Sales & Marketing', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(24, 6, 'Senior Enterprise Account Manager', 'SEAM', 'Senior Enterprise Account Manager within Sales & Marketing', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(25, 6, 'Digital Marketing Lead', 'DML', 'Digital Marketing Lead within Sales & Marketing', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(26, 6, 'Sales Executive', 'SE2', 'Sales Executive within Sales & Marketing', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1);
/*!40000 ALTER TABLE `designations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `work_schedules`
--
DROP TABLE IF EXISTS `work_schedules`;
CREATE TABLE `work_schedules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_time` time NOT NULL DEFAULT '09:00:00',
  `end_time` time NOT NULL DEFAULT '18:00:00',
  `grace_period_minutes` int NOT NULL DEFAULT '15',
  `standard_hours` decimal(4,2) NOT NULL DEFAULT '8.00',
  `break_hours` decimal(4,2) NOT NULL DEFAULT '1.00',
  `working_days` json NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `schedules_org_idx` (`organization_id`),
  CONSTRAINT `fk_schedules_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `work_schedules` (2 records)
--
LOCK TABLES `work_schedules` WRITE;
/*!40000 ALTER TABLE `work_schedules` DISABLE KEYS */;
INSERT INTO `work_schedules` (`id`, `name`, `start_time`, `end_time`, `grace_period_minutes`, `standard_hours`, `break_hours`, `working_days`, `is_default`, `is_active`, `created_at`, `updated_at`, `deleted_at`, `organization_id`) VALUES
(1, 'General Corporate Shift (09:00 - 18:00)', '09:00:00', '18:00:00', 15, 8, 1, '["Sunday","Monday","Tuesday","Wednesday","Thursday"]', 1, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(2, 'IT Infrastructure 24/7 Morning Shift (07:00 - 16:00)', '07:00:00', '16:00:00', 15, 8, 1, '["Sunday","Monday","Tuesday","Wednesday","Thursday"]', 0, 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1);
/*!40000 ALTER TABLE `work_schedules` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employees`
--
DROP TABLE IF EXISTS `employees`;
CREATE TABLE `employees` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned NOT NULL,
  `employee_code` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `first_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gender` enum('male','female','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_of_birth` date NOT NULL,
  `nid_or_passport` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `work_email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `personal_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `department_id` bigint unsigned NOT NULL,
  `designation_id` bigint unsigned NOT NULL,
  `work_schedule_id` bigint unsigned DEFAULT NULL,
  `branch_id` bigint unsigned DEFAULT NULL,
  `reporting_manager_id` bigint unsigned DEFAULT NULL,
  `joining_date` date NOT NULL,
  `confirmation_date` date DEFAULT NULL,
  `employment_type` enum('full_time','part_time','contract','intern') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'full_time',
  `employment_status` enum('active','probation','notice_period','resigned','terminated') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `basic_salary` decimal(12,2) NOT NULL DEFAULT '0.00',
  `house_rent_allowance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `medical_allowance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `conveyance_allowance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `bank_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_account_no` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_branch` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `blood_group` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `emergency_contact_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `emergency_contact_phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `emergency_contact_relation` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `employees_user_id_unique` (`user_id`),
  UNIQUE KEY `employees_employee_code_unique` (`employee_code`),
  UNIQUE KEY `employees_work_email_unique` (`work_email`),
  KEY `employees_org_idx` (`organization_id`),
  KEY `employees_dept_idx` (`department_id`),
  KEY `employees_desig_idx` (`designation_id`),
  KEY `employees_schedule_idx` (`work_schedule_id`),
  KEY `employees_branch_idx` (`branch_id`),
  KEY `employees_manager_idx` (`reporting_manager_id`),
  CONSTRAINT `fk_emp_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_emp_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_emp_dept` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  CONSTRAINT `fk_emp_desig` FOREIGN KEY (`designation_id`) REFERENCES `designations` (`id`),
  CONSTRAINT `fk_emp_schedule` FOREIGN KEY (`work_schedule_id`) REFERENCES `work_schedules` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_emp_branch` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_emp_manager` FOREIGN KEY (`reporting_manager_id`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `employees` (50 records)
--
LOCK TABLES `employees` WRITE;
/*!40000 ALTER TABLE `employees` DISABLE KEYS */;
INSERT INTO `employees` (`id`, `user_id`, `employee_code`, `first_name`, `last_name`, `gender`, `date_of_birth`, `work_email`, `personal_email`, `phone`, `address`, `city`, `emergency_contact_name`, `emergency_contact_relation`, `emergency_contact_phone`, `department_id`, `designation_id`, `reporting_manager_id`, `work_schedule_id`, `employment_type`, `employment_status`, `joining_date`, `resignation_date`, `basic_salary`, `house_rent_allowance`, `medical_allowance`, `conveyance_allowance`, `bank_name`, `bank_branch`, `bank_account_number`, `bank_routing_number`, `avatar_path`, `created_at`, `updated_at`, `deleted_at`, `organization_id`, `branch_id`) VALUES
(1, 1, 'PF-001', 'Mahmudul', 'Hasan', 'male', '1990-05-15 00:00:00', 'mahmudul.hasan@peopleflow.com', 'mahmudul.personal@example.com', '+880 1711 000001', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Mahmudul)', 'Spouse/Family', '+880 1819 737316', 1, 1, NULL, 1, 'full_time', 'active', '2021-01-15 00:00:00', NULL, 140000, 70000, 42000, 28000, 'City Bank PLC', 'Gulshan Avenue Branch', '110786255187', '225272184', 'https://ui-avatars.com/api/?name=Mahmudul%2BHasan&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1, NULL),
(2, 2, 'PF-002', 'Tasnim', 'Jahan', 'female', '1990-05-15 00:00:00', 'tasnim.jahan@peopleflow.com', 'tasnim.personal@example.com', '+880 1711 000002', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Tasnim)', 'Spouse/Family', '+880 1819 466940', 1, 2, 1, 1, 'full_time', 'active', '2021-02-01 00:00:00', NULL, 130000, 65000, 39000, 26000, 'City Bank PLC', 'Gulshan Avenue Branch', '110201511745', '225272184', 'https://ui-avatars.com/api/?name=Tasnim%2BJahan&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1, NULL),
(3, 3, 'PF-003', 'Nusrat', 'Sharmin', 'female', '1990-05-15 00:00:00', 'nusrat.sharmin@peopleflow.com', 'nusrat.personal@example.com', '+880 1711 000003', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Nusrat)', 'Spouse/Family', '+880 1819 468813', 1, 3, 1, 1, 'full_time', 'active', '2022-03-10 00:00:00', NULL, 27500, 13750, 8250, 5500, 'City Bank PLC', 'Gulshan Avenue Branch', '110839472464', '225272184', 'https://ui-avatars.com/api/?name=Nusrat%2BSharmin&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1, NULL),
(4, 4, 'PF-004', 'Farhana', 'Chowdhury', 'female', '1990-05-15 00:00:00', 'farhana.chowdhury@peopleflow.com', 'farhana.personal@example.com', '+880 1711 000004', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Farhana)', 'Spouse/Family', '+880 1819 245009', 2, 4, NULL, 1, 'full_time', 'active', '2021-03-01 00:00:00', NULL, 80000, 40000, 24000, 16000, 'City Bank PLC', 'Gulshan Avenue Branch', '110204490106', '225272184', 'https://ui-avatars.com/api/?name=Farhana%2BChowdhury&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1, NULL),
(5, 5, 'PF-005', 'Tanvir', 'Ahmed', 'male', '1990-05-15 00:00:00', 'tanvir.ahmed@peopleflow.com', 'tanvir.personal@example.com', '+880 1711 000005', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Tanvir)', 'Spouse/Family', '+880 1819 759032', 2, 5, 4, 1, 'full_time', 'active', '2022-01-15 00:00:00', NULL, 55000, 27500, 16500, 11000, 'City Bank PLC', 'Gulshan Avenue Branch', '110567221801', '225272184', 'https://ui-avatars.com/api/?name=Tanvir%2BAhmed&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1, NULL),
(6, 6, 'PF-006', 'Sharmin', 'Akter', 'female', '1990-05-15 00:00:00', 'sharmin.akter@peopleflow.com', 'sharmin.personal@example.com', '+880 1711 000006', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Sharmin)', 'Spouse/Family', '+880 1819 722719', 2, 6, 4, 1, 'full_time', 'active', '2022-06-01 00:00:00', NULL, 37500, 18750, 11250, 7500, 'City Bank PLC', 'Gulshan Avenue Branch', '110925925562', '225272184', 'https://ui-avatars.com/api/?name=Sharmin%2BAkter&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1, NULL),
(7, 7, 'PF-007', 'Kazi', 'Riad', 'male', '1990-05-15 00:00:00', 'kazi.riad@peopleflow.com', 'kazi.personal@example.com', '+880 1711 000007', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Kazi)', 'Spouse/Family', '+880 1819 289476', 2, 7, 4, 1, 'full_time', 'active', '2023-04-15 00:00:00', NULL, 25000, 12500, 7500, 5000, 'City Bank PLC', 'Gulshan Avenue Branch', '110776405269', '225272184', 'https://ui-avatars.com/api/?name=Kazi%2BRiad&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1, NULL),
(8, 8, 'PF-008', 'Mustafa', 'Rahman', 'male', '1990-05-15 00:00:00', 'mustafa.rahman@peopleflow.com', 'mustafa.personal@example.com', '+880 1711 000008', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Mustafa)', 'Spouse/Family', '+880 1819 491805', 3, 8, NULL, 1, 'full_time', 'active', '2021-04-01 00:00:00', NULL, 87500, 43750, 26250, 17500, 'City Bank PLC', 'Gulshan Avenue Branch', '110773766949', '225272184', 'https://ui-avatars.com/api/?name=Mustafa%2BRahman&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:14', '2026-10-28 12:27:22', NULL, 1, NULL),
(9, 9, 'PF-009', 'Nazmul', 'Huda', 'male', '1990-05-15 00:00:00', 'nazmul.huda@peopleflow.com', 'nazmul.personal@example.com', '+880 1711 000009', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Nazmul)', 'Spouse/Family', '+880 1819 659769', 3, 9, 8, 1, 'full_time', 'active', '2022-02-10 00:00:00', NULL, 45000, 22500, 13500, 9000, 'City Bank PLC', 'Gulshan Avenue Branch', '110444425460', '225272184', 'https://ui-avatars.com/api/?name=Nazmul%2BHuda&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1, NULL),
(10, 10, 'PF-010', 'Mithila', 'Sultana', 'female', '1990-05-15 00:00:00', 'mithila.sultana@peopleflow.com', 'mithila.personal@example.com', '+880 1711 000010', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Mithila)', 'Spouse/Family', '+880 1819 931679', 3, 10, 8, 1, 'full_time', 'active', '2022-08-15 00:00:00', NULL, 32500, 16250, 9750, 6500, 'City Bank PLC', 'Gulshan Avenue Branch', '110457889478', '225272184', 'https://ui-avatars.com/api/?name=Mithila%2BSultana&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1, NULL),
(11, 11, 'PF-011', 'Sakib', 'Al-Hasan', 'male', '1990-05-15 00:00:00', 'sakib.al-hasan@peopleflow.com', 'sakib.personal@example.com', '+880 1711 000011', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Sakib)', 'Spouse/Family', '+880 1819 450577', 3, 11, 8, 1, 'full_time', 'active', '2023-07-01 00:00:00', NULL, 22500, 11250, 6750, 4500, 'City Bank PLC', 'Gulshan Avenue Branch', '110299649674', '225272184', 'https://ui-avatars.com/api/?name=Sakib%2BAl-Hasan&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1, NULL),
(12, 12, 'PF-012', 'Zubair', 'Alam', 'male', '1990-05-15 00:00:00', 'zubair.alam@peopleflow.com', 'zubair.personal@example.com', '+880 1711 000012', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Zubair)', 'Spouse/Family', '+880 1819 266485', 4, 12, NULL, 1, 'full_time', 'active', '2021-02-15 00:00:00', NULL, 120000, 60000, 36000, 24000, 'City Bank PLC', 'Gulshan Avenue Branch', '110461455067', '225272184', 'https://ui-avatars.com/api/?name=Zubair%2BAlam&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1, NULL),
(13, 13, 'PF-013', 'Asif', 'Iqbal', 'male', '1990-05-15 00:00:00', 'asif.iqbal@peopleflow.com', 'asif.personal@example.com', '+880 1711 000013', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Asif)', 'Spouse/Family', '+880 1819 477847', 4, 13, 12, 1, 'full_time', 'active', '2021-06-01 00:00:00', NULL, 90000, 45000, 27000, 18000, 'City Bank PLC', 'Gulshan Avenue Branch', '110134584535', '225272184', 'https://ui-avatars.com/api/?name=Asif%2BIqbal&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:15', '2026-10-28 12:27:22', NULL, 1, NULL),
(14, 14, 'PF-014', 'Sadia', 'Afrin', 'female', '1990-05-15 00:00:00', 'sadia.afrin@peopleflow.com', 'sadia.personal@example.com', '+880 1711 000014', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Sadia)', 'Spouse/Family', '+880 1819 142543', 4, 14, 12, 1, 'full_time', 'active', '2022-01-10 00:00:00', NULL, 67500, 33750, 20250, 13500, 'City Bank PLC', 'Gulshan Avenue Branch', '110175937153', '225272184', 'https://ui-avatars.com/api/?name=Sadia%2BAfrin&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1, NULL),
(15, 15, 'PF-015', 'Tahmid', 'Khan', 'male', '1990-05-15 00:00:00', 'tahmid.khan@peopleflow.com', 'tahmid.personal@example.com', '+880 1711 000015', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Tahmid)', 'Spouse/Family', '+880 1819 390961', 4, 14, 12, 1, 'full_time', 'active', '2022-03-01 00:00:00', NULL, 65000, 32500, 19500, 13000, 'City Bank PLC', 'Gulshan Avenue Branch', '110150221653', '225272184', 'https://ui-avatars.com/api/?name=Tahmid%2BKhan&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1, NULL),
(16, 16, 'PF-016', 'Rezaul', 'Karim', 'male', '1990-05-15 00:00:00', 'rezaul.karim@peopleflow.com', 'rezaul.personal@example.com', '+880 1711 000016', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Rezaul)', 'Spouse/Family', '+880 1819 950678', 4, 15, 12, 1, 'full_time', 'active', '2022-04-15 00:00:00', NULL, 62500, 31250, 18750, 12500, 'City Bank PLC', 'Gulshan Avenue Branch', '110179330959', '225272184', 'https://ui-avatars.com/api/?name=Rezaul%2BKarim&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1, NULL),
(17, 17, 'PF-017', 'Rumana', 'Islam', 'female', '1990-05-15 00:00:00', 'rumana.islam@peopleflow.com', 'rumana.personal@example.com', '+880 1711 000017', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Rumana)', 'Spouse/Family', '+880 1819 373084', 4, 16, 12, 1, 'full_time', 'active', '2022-07-01 00:00:00', NULL, 52500, 26250, 15750, 10500, 'City Bank PLC', 'Gulshan Avenue Branch', '110311583372', '225272184', 'https://ui-avatars.com/api/?name=Rumana%2BIslam&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1, NULL),
(18, 18, 'PF-018', 'Mehedi', 'Hasan', 'male', '1990-05-15 00:00:00', 'mehedi.hasan@peopleflow.com', 'mehedi.personal@example.com', '+880 1711 000018', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Mehedi)', 'Spouse/Family', '+880 1819 680409', 4, 17, 12, 1, 'full_time', 'active', '2023-01-15 00:00:00', NULL, 40000, 20000, 12000, 8000, 'City Bank PLC', 'Gulshan Avenue Branch', '110574591910', '225272184', 'https://ui-avatars.com/api/?name=Mehedi%2BHasan&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1, NULL),
(19, 19, 'PF-019', 'Ayesha', 'Siddiqua', 'female', '1990-05-15 00:00:00', 'ayesha.siddiqua@peopleflow.com', 'ayesha.personal@example.com', '+880 1711 000019', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Ayesha)', 'Spouse/Family', '+880 1819 771822', 4, 17, 12, 1, 'full_time', 'active', '2023-02-01 00:00:00', NULL, 40000, 20000, 12000, 8000, 'City Bank PLC', 'Gulshan Avenue Branch', '110283751324', '225272184', 'https://ui-avatars.com/api/?name=Ayesha%2BSiddiqua&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:16', '2026-10-28 12:27:22', NULL, 1, NULL),
(20, 20, 'PF-020', 'Fahim', 'Faysal', 'male', '1990-05-15 00:00:00', 'fahim.faysal@peopleflow.com', 'fahim.personal@example.com', '+880 1711 000020', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Fahim)', 'Spouse/Family', '+880 1819 427131', 4, 17, 12, 1, 'full_time', 'active', '2023-05-10 00:00:00', NULL, 37500, 18750, 11250, 7500, 'City Bank PLC', 'Gulshan Avenue Branch', '110774952690', '225272184', 'https://ui-avatars.com/api/?name=Fahim%2BFaysal&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1, NULL),
(21, 21, 'PF-021', 'Naimur', 'Rahman', 'male', '1990-05-15 00:00:00', 'naimur.rahman@peopleflow.com', 'naimur.personal@example.com', '+880 1711 000021', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Naimur)', 'Spouse/Family', '+880 1819 771950', 4, 18, 12, 1, 'full_time', 'active', '2023-09-01 00:00:00', NULL, 22500, 11250, 6750, 4500, 'City Bank PLC', 'Gulshan Avenue Branch', '110498345609', '225272184', 'https://ui-avatars.com/api/?name=Naimur%2BRahman&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1, NULL),
(22, 22, 'PF-022', 'Shahidul', 'Islam', 'male', '1990-05-15 00:00:00', 'shahidul.islam@peopleflow.com', 'shahidul.personal@example.com', '+880 1711 000022', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Shahidul)', 'Spouse/Family', '+880 1819 198866', 4, 17, 12, 1, 'full_time', 'active', '2024-01-15 00:00:00', NULL, 35000, 17500, 10500, 7000, 'City Bank PLC', 'Gulshan Avenue Branch', '110407982048', '225272184', 'https://ui-avatars.com/api/?name=Shahidul%2BIslam&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1, NULL),
(23, 23, 'PF-023', 'Sanjida', 'Khatun', 'female', '1990-05-15 00:00:00', 'sanjida.khatun@peopleflow.com', 'sanjida.personal@example.com', '+880 1711 000023', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Sanjida)', 'Spouse/Family', '+880 1819 949039', 4, 16, 12, 1, 'full_time', 'active', '2024-03-01 00:00:00', NULL, 32500, 16250, 9750, 6500, 'City Bank PLC', 'Gulshan Avenue Branch', '110151360103', '225272184', 'https://ui-avatars.com/api/?name=Sanjida%2BKhatun&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1, NULL),
(24, 24, 'PF-024', 'Arifur', 'Rahman', 'male', '1990-05-15 00:00:00', 'arifur.rahman@peopleflow.com', 'arifur.personal@example.com', '+880 1711 000024', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Arifur)', 'Spouse/Family', '+880 1819 789279', 4, 17, 12, 1, 'full_time', 'active', '2024-06-15 00:00:00', NULL, 30000, 15000, 9000, 6000, 'City Bank PLC', 'Gulshan Avenue Branch', '110241465266', '225272184', 'https://ui-avatars.com/api/?name=Arifur%2BRahman&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:17', '2026-10-28 12:27:22', NULL, 1, NULL),
(25, 25, 'PF-025', 'Imtiaz', 'Ahmed', 'male', '1990-05-15 00:00:00', 'imtiaz.ahmed@peopleflow.com', 'imtiaz.personal@example.com', '+880 1711 000025', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Imtiaz)', 'Spouse/Family', '+880 1819 130124', 5, 19, NULL, 1, 'full_time', 'active', '2021-03-15 00:00:00', NULL, 100000, 50000, 30000, 20000, 'City Bank PLC', 'Gulshan Avenue Branch', '110618882795', '225272184', 'https://ui-avatars.com/api/?name=Imtiaz%2BAhmed&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1, NULL),
(26, 26, 'PF-026', 'Kamrul', 'Hasan', 'male', '1990-05-15 00:00:00', 'kamrul.hasan@peopleflow.com', 'kamrul.personal@example.com', '+880 1711 000026', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Kamrul)', 'Spouse/Family', '+880 1819 309442', 5, 20, 25, 1, 'full_time', 'active', '2022-04-01 00:00:00', NULL, 55000, 27500, 16500, 11000, 'City Bank PLC', 'Gulshan Avenue Branch', '110894803659', '225272184', 'https://ui-avatars.com/api/?name=Kamrul%2BHasan&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1, NULL),
(27, 27, 'PF-027', 'Laila', 'Anjuman', 'female', '1990-05-15 00:00:00', 'laila.anjuman@peopleflow.com', 'laila.personal@example.com', '+880 1711 000027', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Laila)', 'Spouse/Family', '+880 1819 632707', 5, 21, 25, 1, 'full_time', 'active', '2022-09-10 00:00:00', NULL, 30000, 15000, 9000, 6000, 'City Bank PLC', 'Gulshan Avenue Branch', '110297409261', '225272184', 'https://ui-avatars.com/api/?name=Laila%2BAnjuman&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1, NULL),
(28, 28, 'PF-028', 'Rashed', 'Chowdhury', 'male', '1990-05-15 00:00:00', 'rashed.chowdhury@peopleflow.com', 'rashed.personal@example.com', '+880 1711 000028', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Rashed)', 'Spouse/Family', '+880 1819 515210', 5, 22, 25, 1, 'full_time', 'active', '2023-02-15 00:00:00', NULL, 22500, 11250, 6750, 4500, 'City Bank PLC', 'Gulshan Avenue Branch', '110549905031', '225272184', 'https://ui-avatars.com/api/?name=Rashed%2BChowdhury&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1, NULL),
(29, 29, 'PF-029', 'Babor', 'Ali', 'male', '1990-05-15 00:00:00', 'babor.ali@peopleflow.com', 'babor.personal@example.com', '+880 1711 000029', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Babor)', 'Spouse/Family', '+880 1819 589450', 5, 22, 25, 1, 'full_time', 'active', '2023-08-01 00:00:00', NULL, 21000, 10500, 6300, 4200, 'City Bank PLC', 'Gulshan Avenue Branch', '110935906332', '225272184', 'https://ui-avatars.com/api/?name=Babor%2BAli&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:18', '2026-10-28 12:27:22', NULL, 1, NULL),
(30, 30, 'PF-030', 'Sumona', 'Nasrin', 'female', '1990-05-15 00:00:00', 'sumona.nasrin@peopleflow.com', 'sumona.personal@example.com', '+880 1711 000030', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Sumona)', 'Spouse/Family', '+880 1819 261936', 5, 21, 25, 1, 'full_time', 'active', '2024-01-10 00:00:00', NULL, 25000, 12500, 7500, 5000, 'City Bank PLC', 'Gulshan Avenue Branch', '110510544597', '225272184', 'https://ui-avatars.com/api/?name=Sumona%2BNasrin&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1, NULL),
(31, 31, 'PF-031', 'Jewel', 'Rana', 'male', '1990-05-15 00:00:00', 'jewel.rana@peopleflow.com', 'jewel.personal@example.com', '+880 1711 000031', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Jewel)', 'Spouse/Family', '+880 1819 726837', 5, 22, 25, 1, 'full_time', 'active', '2024-05-01 00:00:00', NULL, 20000, 10000, 6000, 4000, 'City Bank PLC', 'Gulshan Avenue Branch', '110137750293', '225272184', 'https://ui-avatars.com/api/?name=Jewel%2BRana&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1, NULL),
(32, 32, 'PF-032', 'Shahriar', 'Kabir', 'male', '1990-05-15 00:00:00', 'shahriar.kabir@peopleflow.com', 'shahriar.personal@example.com', '+880 1711 000032', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Shahriar)', 'Spouse/Family', '+880 1819 563615', 6, 23, NULL, 1, 'full_time', 'active', '2021-05-01 00:00:00', NULL, 82500, 41250, 24750, 16500, 'City Bank PLC', 'Gulshan Avenue Branch', '110732127569', '225272184', 'https://ui-avatars.com/api/?name=Shahriar%2BKabir&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1, NULL),
(33, 33, 'PF-033', 'Anika', 'Tabassum', 'female', '1990-05-15 00:00:00', 'anika.tabassum@peopleflow.com', 'anika.personal@example.com', '+880 1711 000033', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Anika)', 'Spouse/Family', '+880 1819 969640', 6, 24, 32, 1, 'full_time', 'active', '2022-05-15 00:00:00', NULL, 50000, 25000, 15000, 10000, 'City Bank PLC', 'Gulshan Avenue Branch', '110449716624', '225272184', 'https://ui-avatars.com/api/?name=Anika%2BTabassum&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1, NULL),
(34, 34, 'PF-034', 'Shakil', 'Mahmud', 'male', '1990-05-15 00:00:00', 'shakil.mahmud@peopleflow.com', 'shakil.personal@example.com', '+880 1711 000034', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Shakil)', 'Spouse/Family', '+880 1819 878204', 6, 25, 32, 1, 'full_time', 'active', '2022-11-01 00:00:00', NULL, 42500, 21250, 12750, 8500, 'City Bank PLC', 'Gulshan Avenue Branch', '110240121024', '225272184', 'https://ui-avatars.com/api/?name=Shakil%2BMahmud&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1, NULL),
(35, 35, 'PF-035', 'Monir', 'Hossain', 'male', '1990-05-15 00:00:00', 'monir.hossain@peopleflow.com', 'monir.personal@example.com', '+880 1711 000035', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Monir)', 'Spouse/Family', '+880 1819 137522', 6, 26, 32, 1, 'full_time', 'active', '2023-03-20 00:00:00', NULL, 25000, 12500, 7500, 5000, 'City Bank PLC', 'Gulshan Avenue Branch', '110232099342', '225272184', 'https://ui-avatars.com/api/?name=Monir%2BHossain&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:19', '2026-10-28 12:27:22', NULL, 1, NULL),
(36, 36, 'PF-036', 'Tania', 'Parveen', 'female', '1990-05-15 00:00:00', 'tania.parveen@peopleflow.com', 'tania.personal@example.com', '+880 1711 000036', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Tania)', 'Spouse/Family', '+880 1819 211511', 6, 26, 32, 1, 'full_time', 'active', '2023-07-15 00:00:00', NULL, 24000, 12000, 7200, 4800, 'City Bank PLC', 'Gulshan Avenue Branch', '110706177097', '225272184', 'https://ui-avatars.com/api/?name=Tania%2BParveen&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1, NULL),
(37, 37, 'PF-037', 'Ashfaq', 'Nabi', 'male', '1990-05-15 00:00:00', 'ashfaq.nabi@peopleflow.com', 'ashfaq.personal@example.com', '+880 1711 000037', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Ashfaq)', 'Spouse/Family', '+880 1819 833219', 6, 26, 32, 1, 'full_time', 'active', '2024-02-01 00:00:00', NULL, 22500, 11250, 6750, 4500, 'City Bank PLC', 'Gulshan Avenue Branch', '110355847762', '225272184', 'https://ui-avatars.com/api/?name=Ashfaq%2BNabi&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1, NULL),
(38, 38, 'PF-038', 'Habibur', 'Rahman', 'male', '1990-05-15 00:00:00', 'habibur.rahman@peopleflow.com', 'habibur.personal@example.com', '+880 1711 000038', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Habibur)', 'Spouse/Family', '+880 1819 834042', 4, 17, 12, 1, 'full_time', 'active', '2024-04-01 00:00:00', NULL, 37500, 18750, 11250, 7500, 'City Bank PLC', 'Gulshan Avenue Branch', '110476041565', '225272184', 'https://ui-avatars.com/api/?name=Habibur%2BRahman&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1, NULL),
(39, 39, 'PF-039', 'Sabrina', 'Mostofa', 'female', '1990-05-15 00:00:00', 'sabrina.mostofa@peopleflow.com', 'sabrina.personal@example.com', '+880 1711 000039', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Sabrina)', 'Spouse/Family', '+880 1819 487848', 4, 16, 12, 1, 'full_time', 'active', '2024-07-10 00:00:00', NULL, 30000, 15000, 9000, 6000, 'City Bank PLC', 'Gulshan Avenue Branch', '110913068343', '225272184', 'https://ui-avatars.com/api/?name=Sabrina%2BMostofa&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1, NULL),
(40, 40, 'PF-040', 'Delwar', 'Jahid', 'male', '1990-05-15 00:00:00', 'delwar.jahid@peopleflow.com', 'delwar.personal@example.com', '+880 1711 000040', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Delwar)', 'Spouse/Family', '+880 1819 565330', 3, 11, 8, 1, 'full_time', 'active', '2024-08-01 00:00:00', NULL, 22500, 11250, 6750, 4500, 'City Bank PLC', 'Gulshan Avenue Branch', '110229160513', '225272184', 'https://ui-avatars.com/api/?name=Delwar%2BJahid&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:20', '2026-10-28 12:27:22', NULL, 1, NULL),
(41, 41, 'PF-041', 'Khadija', 'Begum', 'female', '1990-05-15 00:00:00', 'khadija.begum@peopleflow.com', 'khadija.personal@example.com', '+880 1711 000041', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Khadija)', 'Spouse/Family', '+880 1819 607826', 2, 7, 4, 1, 'full_time', 'active', '2024-09-15 00:00:00', NULL, 25000, 12500, 7500, 5000, 'City Bank PLC', 'Gulshan Avenue Branch', '110392874700', '225272184', 'https://ui-avatars.com/api/?name=Khadija%2BBegum&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1, NULL),
(42, 42, 'PF-042', 'Firoz', 'Shah', 'male', '1990-05-15 00:00:00', 'firoz.shah@peopleflow.com', 'firoz.personal@example.com', '+880 1711 000042', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Firoz)', 'Spouse/Family', '+880 1819 158412', 5, 22, 25, 1, 'full_time', 'active', '2024-10-01 00:00:00', NULL, 21000, 10500, 6300, 4200, 'City Bank PLC', 'Gulshan Avenue Branch', '110380874124', '225272184', 'https://ui-avatars.com/api/?name=Firoz%2BShah&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1, NULL),
(43, 43, 'PF-043', 'Lamia', 'Tabassum', 'female', '1990-05-15 00:00:00', 'lamia.tabassum@peopleflow.com', 'lamia.personal@example.com', '+880 1711 000043', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Lamia)', 'Spouse/Family', '+880 1819 424830', 6, 26, 32, 1, 'full_time', 'active', '2024-11-01 00:00:00', NULL, 24000, 12000, 7200, 4800, 'City Bank PLC', 'Gulshan Avenue Branch', '110263046244', '225272184', 'https://ui-avatars.com/api/?name=Lamia%2BTabassum&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1, NULL),
(44, 44, 'PF-044', 'Saiful', 'Islam', 'male', '1990-05-15 00:00:00', 'saiful.islam@peopleflow.com', 'saiful.personal@example.com', '+880 1711 000044', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Saiful)', 'Spouse/Family', '+880 1819 242965', 4, 17, 12, 1, 'full_time', 'active', '2025-01-05 00:00:00', NULL, 35000, 17500, 10500, 7000, 'City Bank PLC', 'Gulshan Avenue Branch', '110403189291', '225272184', 'https://ui-avatars.com/api/?name=Saiful%2BIslam&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1, NULL),
(45, 45, 'PF-045', 'Rina', 'Khanam', 'female', '1990-05-15 00:00:00', 'rina.khanam@peopleflow.com', 'rina.personal@example.com', '+880 1711 000045', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Rina)', 'Spouse/Family', '+880 1819 733275', 4, 18, 12, 1, 'full_time', 'active', '2025-02-01 00:00:00', NULL, 20000, 10000, 6000, 4000, 'City Bank PLC', 'Gulshan Avenue Branch', '110447463294', '225272184', 'https://ui-avatars.com/api/?name=Rina%2BKhanam&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1, NULL),
(46, 46, 'PF-046', 'Anwar', 'Hossain', 'male', '1990-05-15 00:00:00', 'anwar.hossain@peopleflow.com', 'anwar.personal@example.com', '+880 1711 000046', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Anwar)', 'Spouse/Family', '+880 1819 714227', 5, 21, 25, 1, 'full_time', 'active', '2025-03-10 00:00:00', NULL, 24000, 12000, 7200, 4800, 'City Bank PLC', 'Gulshan Avenue Branch', '110845491972', '225272184', 'https://ui-avatars.com/api/?name=Anwar%2BHossain&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:21', '2026-10-28 12:27:22', NULL, 1, NULL),
(47, 47, 'PF-047', 'Farzana', 'Yeasmin', 'female', '1990-05-15 00:00:00', 'farzana.yeasmin@peopleflow.com', 'farzana.personal@example.com', '+880 1711 000047', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Farzana)', 'Spouse/Family', '+880 1819 368831', 3, 11, 8, 1, 'full_time', 'active', '2025-04-15 00:00:00', NULL, 23000, 11500, 6900, 4600, 'City Bank PLC', 'Gulshan Avenue Branch', '110201472709', '225272184', 'https://ui-avatars.com/api/?name=Farzana%2BYeasmin&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1, NULL),
(48, 48, 'PF-048', 'Nazir', 'Uddin', 'male', '1990-05-15 00:00:00', 'nazir.uddin@peopleflow.com', 'nazir.personal@example.com', '+880 1711 000048', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Nazir)', 'Spouse/Family', '+880 1819 522166', 2, 7, 4, 1, 'full_time', 'active', '2025-05-01 00:00:00', NULL, 24000, 12000, 7200, 4800, 'City Bank PLC', 'Gulshan Avenue Branch', '110743223919', '225272184', 'https://ui-avatars.com/api/?name=Nazir%2BUddin&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1, NULL),
(49, 49, 'PF-049', 'Tahmina', 'Binte', 'female', '1990-05-15 00:00:00', 'tahmina.binte@peopleflow.com', 'tahmina.personal@example.com', '+880 1711 000049', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Tahmina)', 'Spouse/Family', '+880 1819 289518', 6, 26, 32, 1, 'full_time', 'active', '2025-06-15 00:00:00', NULL, 23500, 11750, 7050, 4700, 'City Bank PLC', 'Gulshan Avenue Branch', '110979133178', '225272184', 'https://ui-avatars.com/api/?name=Tahmina%2BBinte&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1, NULL),
(50, 50, 'PF-050', 'Jannatul', 'Ferdous', 'female', '1990-05-15 00:00:00', 'jannatul.ferdous@peopleflow.com', 'jannatul.personal@example.com', '+880 1711 000050', 'Gulshan-2, Dhaka-1212', 'Dhaka', 'Next of Kin (Jannatul)', 'Spouse/Family', '+880 1819 587479', 4, 17, 12, 1, 'full_time', 'active', '2025-08-01 00:00:00', NULL, 34000, 17000, 10200, 6800, 'City Bank PLC', 'Gulshan Avenue Branch', '110393159936', '225272184', 'https://ui-avatars.com/api/?name=Jannatul%2BFerdous&background=0284c7&color=ffffff&size=128', '2026-10-28 12:27:22', '2026-10-28 12:27:22', NULL, 1, NULL);
/*!40000 ALTER TABLE `employees` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `attendances`
--
DROP TABLE IF EXISTS `attendances`;
CREATE TABLE `attendances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `punch_in` time DEFAULT NULL,
  `punch_out` time DEFAULT NULL,
  `punch_in_ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `punch_out_ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `punch_in_device` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `punch_out_device` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `late_minutes` int NOT NULL DEFAULT '0',
  `early_leaving_minutes` int NOT NULL DEFAULT '0',
  `overtime_minutes` int NOT NULL DEFAULT '0',
  `working_hours` decimal(4,2) NOT NULL DEFAULT '0.00',
  `status` enum('present','late','half_day','absent','on_leave','holiday','weekend') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'present',
  `notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attendances_employee_date_unique` (`employee_id`,`date`),
  KEY `attendances_org_idx` (`organization_id`),
  KEY `attendances_date_idx` (`date`),
  KEY `attendances_status_idx` (`status`),
  CONSTRAINT `fk_att_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_att_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attendances` (50 records)
--
LOCK TABLES `attendances` WRITE;
/*!40000 ALTER TABLE `attendances` DISABLE KEYS */;
INSERT INTO `attendances` (`id`, `employee_id`, `date`, `scheduled_in`, `scheduled_out`, `check_in`, `check_out`, `late_minutes`, `early_departure_minutes`, `working_hours`, `overtime_hours`, `status`, `source`, `check_in_ip`, `check_out_ip`, `remarks`, `created_at`, `updated_at`, `organization_id`) VALUES
(1, 1, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:47:00', '2026-10-28 18:07:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.100', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(2, 2, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:36:00', '2026-10-28 18:23:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.101', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(3, 3, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:50:00', '2026-10-28 18:27:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.102', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(4, 4, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:47:00', '2026-10-28 18:30:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.103', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(5, 5, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:42:00', '2026-10-28 18:22:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.104', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(6, 6, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:50:00', '2026-10-28 18:16:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.105', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(7, 7, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:57:00', '2026-10-28 18:23:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.106', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(8, 8, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:45:00', '2026-10-28 18:30:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.107', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(9, 9, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:55:00', '2026-10-28 18:08:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.108', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(10, 10, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:57:00', '2026-10-28 18:15:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.109', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(11, 11, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:56:00', '2026-10-28 18:23:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.110', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(12, 12, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:47:00', '2026-10-28 18:05:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.111', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(13, 13, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:56:00', '2026-10-28 18:12:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.112', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(14, 14, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:49:00', '2026-10-28 18:30:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.113', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(15, 15, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:45:00', '2026-10-28 18:12:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.114', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(16, 16, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:37:00', '2026-10-28 18:07:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.115', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(17, 17, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:56:00', '2026-10-28 18:24:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.116', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(18, 18, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:56:00', '2026-10-28 18:28:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.117', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(19, 19, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:36:00', '2026-10-28 18:13:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.118', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(20, 20, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:49:00', '2026-10-28 18:12:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.119', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(21, 21, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:43:00', '2026-10-28 18:12:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.120', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(22, 22, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:43:00', '2026-10-28 18:30:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.121', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(23, 23, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:53:00', '2026-10-28 18:15:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.122', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(24, 24, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:58:00', '2026-10-28 18:25:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.123', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(25, 25, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:47:00', '2026-10-28 18:11:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.124', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(26, 26, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:42:00', '2026-10-28 18:14:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.125', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(27, 27, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:41:00', '2026-10-28 18:27:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.126', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(28, 28, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:38:00', '2026-10-28 18:30:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.127', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(29, 29, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:44:00', '2026-10-28 18:14:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.128', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(30, 30, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:58:00', '2026-10-28 18:22:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.129', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(31, 31, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:44:00', '2026-10-28 18:11:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.130', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(32, 32, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:41:00', '2026-10-28 18:22:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.131', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(33, 33, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:48:00', '2026-10-28 18:17:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.132', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(34, 34, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:57:00', '2026-10-28 18:30:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.133', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(35, 35, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:57:00', '2026-10-28 18:15:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.134', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(36, 36, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:40:00', '2026-10-28 18:14:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.135', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(37, 37, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:42:00', '2026-10-28 18:06:00', 0, 0, 8.25, 0.5, 'present', 'biometric_gate_1', '192.168.10.136', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(38, 38, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 08:45:00', '2026-10-28 18:27:00', 0, 0, 8.25, 0.5, 'present', 'web_self_service', '192.168.10.137', NULL, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(39, 39, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 09:40:00', '2026-10-28 18:15:00', 40, 0, 8, 0, 'late', 'biometric_gate_1', '192.168.10.138', NULL, 'Traffic delay reported via self-service', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(40, 40, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 09:36:00', '2026-10-28 18:15:00', 36, 0, 8, 0, 'late', 'biometric_gate_1', '192.168.10.139', NULL, 'Traffic delay reported via self-service', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(41, 41, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 09:18:00', '2026-10-28 18:15:00', 18, 0, 8, 0, 'late', 'biometric_gate_1', '192.168.10.140', NULL, 'Traffic delay reported via self-service', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(42, 42, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 09:41:00', '2026-10-28 18:15:00', 41, 0, 8, 0, 'late', 'biometric_gate_1', '192.168.10.141', NULL, 'Traffic delay reported via self-service', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(43, 43, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 09:21:00', '2026-10-28 18:15:00', 21, 0, 8, 0, 'late', 'biometric_gate_1', '192.168.10.142', NULL, 'Traffic delay reported via self-service', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(44, 44, '2026-10-28 00:00:00', '09:00:00', '18:00:00', '2026-10-28 09:36:00', '2026-10-28 18:15:00', 36, 0, 8, 0, 'late', 'biometric_gate_1', '192.168.10.143', NULL, 'Traffic delay reported via self-service', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(45, 45, '2026-10-28 00:00:00', '09:00:00', '18:00:00', NULL, NULL, 0, 0, 0, 0, 'on_leave', 'web_self_service', NULL, NULL, 'Approved Annual / Sick Leave', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(46, 46, '2026-10-28 00:00:00', '09:00:00', '18:00:00', NULL, NULL, 0, 0, 0, 0, 'on_leave', 'web_self_service', NULL, NULL, 'Approved Annual / Sick Leave', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(47, 47, '2026-10-28 00:00:00', '09:00:00', '18:00:00', NULL, NULL, 0, 0, 0, 0, 'on_leave', 'web_self_service', NULL, NULL, 'Approved Annual / Sick Leave', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(48, 48, '2026-10-28 00:00:00', '09:00:00', '18:00:00', NULL, NULL, 0, 0, 0, 0, 'absent', 'admin_manual', NULL, NULL, 'Unexcused absence without prior notification', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(49, 49, '2026-10-28 00:00:00', '09:00:00', '18:00:00', NULL, NULL, 0, 0, 0, 0, 'absent', 'admin_manual', NULL, NULL, 'Unexcused absence without prior notification', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1),
(50, 50, '2026-10-28 00:00:00', '09:00:00', '18:00:00', NULL, NULL, 0, 0, 0, 0, 'absent', 'admin_manual', NULL, NULL, 'Unexcused absence without prior notification', '2026-10-28 12:27:22', '2026-10-28 12:27:22', 1);
/*!40000 ALTER TABLE `attendances` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `attendance_corrections`
--
DROP TABLE IF EXISTS `attendance_corrections`;
CREATE TABLE `attendance_corrections` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `attendance_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `requested_punch_in` time DEFAULT NULL,
  `requested_punch_out` time DEFAULT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `reviewed_by` bigint unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `review_comment` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `att_corr_att_idx` (`attendance_id`),
  KEY `att_corr_emp_idx` (`employee_id`),
  KEY `att_corr_rev_idx` (`reviewed_by`),
  CONSTRAINT `fk_att_corr_att` FOREIGN KEY (`attendance_id`) REFERENCES `attendances` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_att_corr_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_att_corr_user` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `leave_types`
--
DROP TABLE IF EXISTS `leave_types`;
CREATE TABLE `leave_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `default_quota_days` int NOT NULL DEFAULT '10',
  `is_paid` tinyint(1) NOT NULL DEFAULT '1',
  `requires_attachment` tinyint(1) NOT NULL DEFAULT '0',
  `allow_half_day` tinyint(1) NOT NULL DEFAULT '1',
  `carry_forward_allowed` tinyint(1) NOT NULL DEFAULT '0',
  `max_carry_forward_days` int NOT NULL DEFAULT '0',
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leave_types_org_idx` (`organization_id`),
  CONSTRAINT `fk_leave_types_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leave_types` (6 records)
--
LOCK TABLES `leave_types` WRITE;
/*!40000 ALTER TABLE `leave_types` DISABLE KEYS */;
INSERT INTO `leave_types` (`id`, `name`, `code`, `default_quota_days`, `is_paid`, `requires_attachment`, `allow_half_day`, `carry_forward_allowed`, `max_carry_forward_days`, `description`, `is_active`, `created_at`, `updated_at`, `deleted_at`, `organization_id`) VALUES
(1, 'Annual Leave', 'AL', 18, 1, 0, 1, 1, 7, 'Earned annual privilege leave accrued over service period.', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(2, 'Casual Leave', 'CL', 10, 1, 0, 1, 0, 0, 'Short-notice leave for unforeseen personal or urgent situations.', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(3, 'Sick Leave', 'SL', 14, 1, 1, 1, 0, 0, 'Medical leave. Requires physician certificate if exceeding 2 consecutive days.', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(4, 'Maternity Leave', 'ML', 112, 1, 1, 0, 0, 0, 'Statutory maternity leave for eligible female employees.', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(5, 'Paternity Leave', 'PL', 7, 1, 1, 0, 0, 0, 'Leave for male employees upon the birth of a child.', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1),
(6, 'Unpaid Leave (LWP)', 'LWP', 0, 0, 0, 1, 0, 0, 'Leave without pay approved on special discretionary grounds.', 1, '2026-10-28 12:27:13', '2026-10-28 12:27:22', NULL, 1);
/*!40000 ALTER TABLE `leave_types` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_balances`
--
DROP TABLE IF EXISTS `leave_balances`;
CREATE TABLE `leave_balances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned NOT NULL,
  `leave_type_id` bigint unsigned NOT NULL,
  `year` int NOT NULL,
  `allocated_days` decimal(5,2) NOT NULL DEFAULT '0.00',
  `used_days` decimal(5,2) NOT NULL DEFAULT '0.00',
  `pending_days` decimal(5,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `leave_balances_emp_type_year_unique` (`employee_id`,`leave_type_id`,`year`),
  KEY `leave_balances_type_idx` (`leave_type_id`),
  CONSTRAINT `fk_leave_bal_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_leave_bal_type` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leave_balances` (300 records)
--
LOCK TABLES `leave_balances` WRITE;
/*!40000 ALTER TABLE `leave_balances` DISABLE KEYS */;
INSERT INTO `leave_balances` (`id`, `employee_id`, `leave_type_id`, `year`, `allocated_days`, `used_days`, `pending_days`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 2026, 18, 1, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(2, 1, 2, 2026, 10, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(3, 1, 3, 2026, 14, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(4, 1, 4, 2026, 112, 3, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(5, 1, 5, 2026, 7, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(6, 1, 6, 2026, 0, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(7, 2, 1, 2026, 18, 2, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(8, 2, 2, 2026, 10, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(9, 2, 3, 2026, 14, 3, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(10, 2, 4, 2026, 112, 2, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(11, 2, 5, 2026, 7, 1, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(12, 2, 6, 2026, 0, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(13, 3, 1, 2026, 18, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(14, 3, 2, 2026, 10, 3, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(15, 3, 3, 2026, 14, 2, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(16, 3, 4, 2026, 112, 1, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(17, 3, 5, 2026, 7, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(18, 3, 6, 2026, 0, 0, 0, '2026-10-28 12:27:13', '2026-10-28 12:27:13'),
(19, 4, 1, 2026, 18, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(20, 4, 2, 2026, 10, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(21, 4, 3, 2026, 14, 1, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(22, 4, 4, 2026, 112, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(23, 4, 5, 2026, 7, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(24, 4, 6, 2026, 0, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(25, 5, 1, 2026, 18, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(26, 5, 2, 2026, 10, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(27, 5, 3, 2026, 14, 1, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(28, 5, 4, 2026, 112, 2, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(29, 5, 5, 2026, 7, 1, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(30, 5, 6, 2026, 0, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(31, 6, 1, 2026, 18, 2, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(32, 6, 2, 2026, 10, 1, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(33, 6, 3, 2026, 14, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(34, 6, 4, 2026, 112, 1, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(35, 6, 5, 2026, 7, 2, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(36, 6, 6, 2026, 0, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(37, 7, 1, 2026, 18, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(38, 7, 2, 2026, 10, 1, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(39, 7, 3, 2026, 14, 1, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(40, 7, 4, 2026, 112, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(41, 7, 5, 2026, 7, 2, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(42, 7, 6, 2026, 0, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(43, 8, 1, 2026, 18, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(44, 8, 2, 2026, 10, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(45, 8, 3, 2026, 14, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(46, 8, 4, 2026, 112, 2, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(47, 8, 5, 2026, 7, 3, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(48, 8, 6, 2026, 0, 0, 0, '2026-10-28 12:27:14', '2026-10-28 12:27:14'),
(49, 9, 1, 2026, 18, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(50, 9, 2, 2026, 10, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15');
INSERT INTO `leave_balances` (`id`, `employee_id`, `leave_type_id`, `year`, `allocated_days`, `used_days`, `pending_days`, `created_at`, `updated_at`) VALUES
(51, 9, 3, 2026, 14, 1, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(52, 9, 4, 2026, 112, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(53, 9, 5, 2026, 7, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(54, 9, 6, 2026, 0, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(55, 10, 1, 2026, 18, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(56, 10, 2, 2026, 10, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(57, 10, 3, 2026, 14, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(58, 10, 4, 2026, 112, 1, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(59, 10, 5, 2026, 7, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(60, 10, 6, 2026, 0, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(61, 11, 1, 2026, 18, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(62, 11, 2, 2026, 10, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(63, 11, 3, 2026, 14, 1, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(64, 11, 4, 2026, 112, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(65, 11, 5, 2026, 7, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(66, 11, 6, 2026, 0, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(67, 12, 1, 2026, 18, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(68, 12, 2, 2026, 10, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(69, 12, 3, 2026, 14, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(70, 12, 4, 2026, 112, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(71, 12, 5, 2026, 7, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(72, 12, 6, 2026, 0, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(73, 13, 1, 2026, 18, 2, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(74, 13, 2, 2026, 10, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(75, 13, 3, 2026, 14, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(76, 13, 4, 2026, 112, 3, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(77, 13, 5, 2026, 7, 1, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(78, 13, 6, 2026, 0, 0, 0, '2026-10-28 12:27:15', '2026-10-28 12:27:15'),
(79, 14, 1, 2026, 18, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(80, 14, 2, 2026, 10, 1, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(81, 14, 3, 2026, 14, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(82, 14, 4, 2026, 112, 2, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(83, 14, 5, 2026, 7, 2, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(84, 14, 6, 2026, 0, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(85, 15, 1, 2026, 18, 1, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(86, 15, 2, 2026, 10, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(87, 15, 3, 2026, 14, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(88, 15, 4, 2026, 112, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(89, 15, 5, 2026, 7, 2, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(90, 15, 6, 2026, 0, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(91, 16, 1, 2026, 18, 1, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(92, 16, 2, 2026, 10, 2, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(93, 16, 3, 2026, 14, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(94, 16, 4, 2026, 112, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(95, 16, 5, 2026, 7, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(96, 16, 6, 2026, 0, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(97, 17, 1, 2026, 18, 1, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(98, 17, 2, 2026, 10, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(99, 17, 3, 2026, 14, 1, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(100, 17, 4, 2026, 112, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16');
INSERT INTO `leave_balances` (`id`, `employee_id`, `leave_type_id`, `year`, `allocated_days`, `used_days`, `pending_days`, `created_at`, `updated_at`) VALUES
(101, 17, 5, 2026, 7, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(102, 17, 6, 2026, 0, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(103, 18, 1, 2026, 18, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(104, 18, 2, 2026, 10, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(105, 18, 3, 2026, 14, 2, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(106, 18, 4, 2026, 112, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(107, 18, 5, 2026, 7, 1, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(108, 18, 6, 2026, 0, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(109, 19, 1, 2026, 18, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(110, 19, 2, 2026, 10, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(111, 19, 3, 2026, 14, 3, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(112, 19, 4, 2026, 112, 2, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(113, 19, 5, 2026, 7, 1, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(114, 19, 6, 2026, 0, 0, 0, '2026-10-28 12:27:16', '2026-10-28 12:27:16'),
(115, 20, 1, 2026, 18, 2, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(116, 20, 2, 2026, 10, 3, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(117, 20, 3, 2026, 14, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(118, 20, 4, 2026, 112, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(119, 20, 5, 2026, 7, 2, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(120, 20, 6, 2026, 0, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(121, 21, 1, 2026, 18, 2, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(122, 21, 2, 2026, 10, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(123, 21, 3, 2026, 14, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(124, 21, 4, 2026, 112, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(125, 21, 5, 2026, 7, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(126, 21, 6, 2026, 0, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(127, 22, 1, 2026, 18, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(128, 22, 2, 2026, 10, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(129, 22, 3, 2026, 14, 2, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(130, 22, 4, 2026, 112, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(131, 22, 5, 2026, 7, 2, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(132, 22, 6, 2026, 0, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(133, 23, 1, 2026, 18, 3, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(134, 23, 2, 2026, 10, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(135, 23, 3, 2026, 14, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(136, 23, 4, 2026, 112, 2, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(137, 23, 5, 2026, 7, 2, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(138, 23, 6, 2026, 0, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(139, 24, 1, 2026, 18, 3, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(140, 24, 2, 2026, 10, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(141, 24, 3, 2026, 14, 3, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(142, 24, 4, 2026, 112, 1, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(143, 24, 5, 2026, 7, 3, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(144, 24, 6, 2026, 0, 0, 0, '2026-10-28 12:27:17', '2026-10-28 12:27:17'),
(145, 25, 1, 2026, 18, 1, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(146, 25, 2, 2026, 10, 2, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(147, 25, 3, 2026, 14, 2, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(148, 25, 4, 2026, 112, 1, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(149, 25, 5, 2026, 7, 1, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(150, 25, 6, 2026, 0, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18');
INSERT INTO `leave_balances` (`id`, `employee_id`, `leave_type_id`, `year`, `allocated_days`, `used_days`, `pending_days`, `created_at`, `updated_at`) VALUES
(151, 26, 1, 2026, 18, 2, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(152, 26, 2, 2026, 10, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(153, 26, 3, 2026, 14, 1, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(154, 26, 4, 2026, 112, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(155, 26, 5, 2026, 7, 3, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(156, 26, 6, 2026, 0, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(157, 27, 1, 2026, 18, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(158, 27, 2, 2026, 10, 2, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(159, 27, 3, 2026, 14, 1, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(160, 27, 4, 2026, 112, 1, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(161, 27, 5, 2026, 7, 3, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(162, 27, 6, 2026, 0, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(163, 28, 1, 2026, 18, 2, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(164, 28, 2, 2026, 10, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(165, 28, 3, 2026, 14, 3, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(166, 28, 4, 2026, 112, 3, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(167, 28, 5, 2026, 7, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(168, 28, 6, 2026, 0, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(169, 29, 1, 2026, 18, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(170, 29, 2, 2026, 10, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(171, 29, 3, 2026, 14, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(172, 29, 4, 2026, 112, 2, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(173, 29, 5, 2026, 7, 2, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(174, 29, 6, 2026, 0, 0, 0, '2026-10-28 12:27:18', '2026-10-28 12:27:18'),
(175, 30, 1, 2026, 18, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(176, 30, 2, 2026, 10, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(177, 30, 3, 2026, 14, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(178, 30, 4, 2026, 112, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(179, 30, 5, 2026, 7, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(180, 30, 6, 2026, 0, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(181, 31, 1, 2026, 18, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(182, 31, 2, 2026, 10, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(183, 31, 3, 2026, 14, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(184, 31, 4, 2026, 112, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(185, 31, 5, 2026, 7, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(186, 31, 6, 2026, 0, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(187, 32, 1, 2026, 18, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(188, 32, 2, 2026, 10, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(189, 32, 3, 2026, 14, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(190, 32, 4, 2026, 112, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(191, 32, 5, 2026, 7, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(192, 32, 6, 2026, 0, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(193, 33, 1, 2026, 18, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(194, 33, 2, 2026, 10, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(195, 33, 3, 2026, 14, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(196, 33, 4, 2026, 112, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(197, 33, 5, 2026, 7, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(198, 33, 6, 2026, 0, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(199, 34, 1, 2026, 18, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(200, 34, 2, 2026, 10, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19');
INSERT INTO `leave_balances` (`id`, `employee_id`, `leave_type_id`, `year`, `allocated_days`, `used_days`, `pending_days`, `created_at`, `updated_at`) VALUES
(201, 34, 3, 2026, 14, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(202, 34, 4, 2026, 112, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(203, 34, 5, 2026, 7, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(204, 34, 6, 2026, 0, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(205, 35, 1, 2026, 18, 2, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(206, 35, 2, 2026, 10, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(207, 35, 3, 2026, 14, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(208, 35, 4, 2026, 112, 1, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(209, 35, 5, 2026, 7, 3, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(210, 35, 6, 2026, 0, 0, 0, '2026-10-28 12:27:19', '2026-10-28 12:27:19'),
(211, 36, 1, 2026, 18, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(212, 36, 2, 2026, 10, 3, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(213, 36, 3, 2026, 14, 3, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(214, 36, 4, 2026, 112, 2, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(215, 36, 5, 2026, 7, 3, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(216, 36, 6, 2026, 0, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(217, 37, 1, 2026, 18, 2, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(218, 37, 2, 2026, 10, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(219, 37, 3, 2026, 14, 2, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(220, 37, 4, 2026, 112, 1, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(221, 37, 5, 2026, 7, 2, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(222, 37, 6, 2026, 0, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(223, 38, 1, 2026, 18, 1, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(224, 38, 2, 2026, 10, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(225, 38, 3, 2026, 14, 1, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(226, 38, 4, 2026, 112, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(227, 38, 5, 2026, 7, 2, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(228, 38, 6, 2026, 0, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(229, 39, 1, 2026, 18, 1, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(230, 39, 2, 2026, 10, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(231, 39, 3, 2026, 14, 2, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(232, 39, 4, 2026, 112, 1, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(233, 39, 5, 2026, 7, 2, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(234, 39, 6, 2026, 0, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(235, 40, 1, 2026, 18, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(236, 40, 2, 2026, 10, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(237, 40, 3, 2026, 14, 3, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(238, 40, 4, 2026, 112, 1, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(239, 40, 5, 2026, 7, 3, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(240, 40, 6, 2026, 0, 0, 0, '2026-10-28 12:27:20', '2026-10-28 12:27:20'),
(241, 41, 1, 2026, 18, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(242, 41, 2, 2026, 10, 1, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(243, 41, 3, 2026, 14, 1, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(244, 41, 4, 2026, 112, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(245, 41, 5, 2026, 7, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(246, 41, 6, 2026, 0, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(247, 42, 1, 2026, 18, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(248, 42, 2, 2026, 10, 1, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(249, 42, 3, 2026, 14, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(250, 42, 4, 2026, 112, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21');
INSERT INTO `leave_balances` (`id`, `employee_id`, `leave_type_id`, `year`, `allocated_days`, `used_days`, `pending_days`, `created_at`, `updated_at`) VALUES
(251, 42, 5, 2026, 7, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(252, 42, 6, 2026, 0, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(253, 43, 1, 2026, 18, 1, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(254, 43, 2, 2026, 10, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(255, 43, 3, 2026, 14, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(256, 43, 4, 2026, 112, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(257, 43, 5, 2026, 7, 1, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(258, 43, 6, 2026, 0, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(259, 44, 1, 2026, 18, 1, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(260, 44, 2, 2026, 10, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(261, 44, 3, 2026, 14, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(262, 44, 4, 2026, 112, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(263, 44, 5, 2026, 7, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(264, 44, 6, 2026, 0, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(265, 45, 1, 2026, 18, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(266, 45, 2, 2026, 10, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(267, 45, 3, 2026, 14, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(268, 45, 4, 2026, 112, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(269, 45, 5, 2026, 7, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(270, 45, 6, 2026, 0, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(271, 46, 1, 2026, 18, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(272, 46, 2, 2026, 10, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(273, 46, 3, 2026, 14, 3, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(274, 46, 4, 2026, 112, 2, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(275, 46, 5, 2026, 7, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(276, 46, 6, 2026, 0, 0, 0, '2026-10-28 12:27:21', '2026-10-28 12:27:21'),
(277, 47, 1, 2026, 18, 3, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(278, 47, 2, 2026, 10, 2, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(279, 47, 3, 2026, 14, 1, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(280, 47, 4, 2026, 112, 1, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(281, 47, 5, 2026, 7, 1, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(282, 47, 6, 2026, 0, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(283, 48, 1, 2026, 18, 1, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(284, 48, 2, 2026, 10, 2, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(285, 48, 3, 2026, 14, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(286, 48, 4, 2026, 112, 3, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(287, 48, 5, 2026, 7, 1, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(288, 48, 6, 2026, 0, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(289, 49, 1, 2026, 18, 3, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(290, 49, 2, 2026, 10, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(291, 49, 3, 2026, 14, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(292, 49, 4, 2026, 112, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(293, 49, 5, 2026, 7, 3, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(294, 49, 6, 2026, 0, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(295, 50, 1, 2026, 18, 2, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(296, 50, 2, 2026, 10, 2, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(297, 50, 3, 2026, 14, 3, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(298, 50, 4, 2026, 112, 2, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(299, 50, 5, 2026, 7, 3, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(300, 50, 6, 2026, 0, 0, 0, '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `leave_balances` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_requests`
--
DROP TABLE IF EXISTS `leave_requests`;
CREATE TABLE `leave_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `leave_type_id` bigint unsigned NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `is_half_day` tinyint(1) NOT NULL DEFAULT '0',
  `half_day_session` enum('first_half','second_half') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `days_count` decimal(4,1) NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `emergency_contact` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `attachment_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','approved','rejected','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `manager_reviewed_by` bigint unsigned DEFAULT NULL,
  `manager_reviewed_at` datetime DEFAULT NULL,
  `manager_status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `manager_comment` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hr_reviewed_by` bigint unsigned DEFAULT NULL,
  `hr_reviewed_at` datetime DEFAULT NULL,
  `hr_status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `hr_comment` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leave_req_org_idx` (`organization_id`),
  KEY `leave_req_emp_idx` (`employee_id`),
  KEY `leave_req_type_idx` (`leave_type_id`),
  KEY `leave_req_status_idx` (`status`),
  KEY `leave_req_mgr_idx` (`manager_reviewed_by`),
  KEY `leave_req_hr_idx` (`hr_reviewed_by`),
  CONSTRAINT `fk_leave_req_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_leave_req_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_leave_req_type` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`),
  CONSTRAINT `fk_leave_req_mgr` FOREIGN KEY (`manager_reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_leave_req_hr` FOREIGN KEY (`hr_reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `document_categories`
--
DROP TABLE IF EXISTS `document_categories`;
CREATE TABLE `document_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `doc_cat_org_idx` (`organization_id`),
  CONSTRAINT `fk_doc_cat_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `document_categories` (2 records)
--
LOCK TABLES `document_categories` WRITE;
/*!40000 ALTER TABLE `document_categories` DISABLE KEYS */;
INSERT INTO `document_categories` (`id`, `organization_id`, `name`, `description`, `created_at`, `updated_at`) VALUES
(1, 1, 'National Identity & Passports', 'Government identity verification documents', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(2, 1, 'Employment Contracts', 'Signed corporate offer letters and NDA agreements', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `document_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `documents`
--
DROP TABLE IF EXISTS `documents`;
CREATE TABLE `documents` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `document_category_id` bigint unsigned DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_size` bigint NOT NULL DEFAULT '0',
  `mime_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issue_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `status` enum('valid','expiring_soon','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'valid',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `docs_org_idx` (`organization_id`),
  KEY `docs_emp_idx` (`employee_id`),
  KEY `docs_cat_idx` (`document_category_id`),
  CONSTRAINT `fk_docs_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_docs_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_docs_cat` FOREIGN KEY (`document_category_id`) REFERENCES `document_categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documents` (2 records)
--
LOCK TABLES `documents` WRITE;
/*!40000 ALTER TABLE `documents` DISABLE KEYS */;
INSERT INTO `documents` (`id`, `organization_id`, `employee_id`, `document_category_id`, `title`, `file_path`, `file_size`, `mime_type`, `issue_date`, `expiry_date`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, 'National ID Card - Mahmudul Hasan', 'documents/sample_nid.pdf', 460800, 'application/pdf', '2024-10-28 12:27:22', '2031-10-28 12:27:22', 'valid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(2, 1, 1, 2, 'Appointment Letter - Mahmudul Hasan', 'documents/appointment.pdf', 798720, 'application/pdf', '2025-10-28 12:27:22', NULL, 'valid', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_openings`
--
DROP TABLE IF EXISTS `job_openings`;
CREATE TABLE `job_openings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `department_id` bigint unsigned NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `vacancies` int NOT NULL DEFAULT '1',
  `experience_years_min` int NOT NULL DEFAULT '0',
  `salary_min` decimal(12,2) NOT NULL DEFAULT '0.00',
  `salary_max` decimal(12,2) NOT NULL DEFAULT '0.00',
  `employment_type` enum('full_time','part_time','contract','intern') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'full_time',
  `location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Dhaka, Bangladesh',
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('draft','published','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `closing_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_org_idx` (`organization_id`),
  KEY `jobs_dept_idx` (`department_id`),
  CONSTRAINT `fk_jobs_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_jobs_dept` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `job_openings` (1 records)
--
LOCK TABLES `job_openings` WRITE;
/*!40000 ALTER TABLE `job_openings` DISABLE KEYS */;
INSERT INTO `job_openings` (`id`, `organization_id`, `department_id`, `title`, `job_code`, `employment_type`, `experience_level`, `vacancies`, `deadline`, `description`, `requirements`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 4, 'Senior Full Stack PHP/Laravel Engineer', 'JOB-ENG01', 'full_time', 'Senior (4+ Years)', 2, '2026-11-17 12:27:22', 'We are seeking an experienced Laravel Architect to lead backend development of our core enterprise modules.', 'Proficiency in PHP 8.2+, MySQL 8, Eloquent ORM, REST APIs, and Blade architectures.', 'published', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `job_openings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `candidates`
--
DROP TABLE IF EXISTS `candidates`;
CREATE TABLE `candidates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resume_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `candidates_org_idx` (`organization_id`),
  CONSTRAINT `fk_candidates_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `candidates` (1 records)
--
LOCK TABLES `candidates` WRITE;
/*!40000 ALTER TABLE `candidates` DISABLE KEYS */;
INSERT INTO `candidates` (`id`, `organization_id`, `full_name`, `email`, `phone`, `resume_path`, `portfolio_url`, `experience_years`, `current_company`, `current_salary`, `expected_salary`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 'Tariq Aziz', 'tariq.aziz@example.com', '+880 1711 998877', NULL, NULL, 5.5, 'Kona Software Lab', 110000, 140000, 'interviewing', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `candidates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_applications`
--
DROP TABLE IF EXISTS `job_applications`;
CREATE TABLE `job_applications` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `job_opening_id` bigint unsigned NOT NULL,
  `candidate_id` bigint unsigned NOT NULL,
  `cover_letter` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stage` enum('applied','shortlisted','interview_scheduled','offer_extended','rejected','hired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'applied',
  `rating` tinyint NOT NULL DEFAULT '0',
  `notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `job_apps_org_idx` (`organization_id`),
  KEY `job_apps_opening_idx` (`job_opening_id`),
  KEY `job_apps_cand_idx` (`candidate_id`),
  CONSTRAINT `fk_job_apps_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_job_apps_opening` FOREIGN KEY (`job_opening_id`) REFERENCES `job_openings` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_job_apps_candidate` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `job_applications` (1 records)
--
LOCK TABLES `job_applications` WRITE;
/*!40000 ALTER TABLE `job_applications` DISABLE KEYS */;
INSERT INTO `job_applications` (`id`, `organization_id`, `job_opening_id`, `candidate_id`, `cover_letter`, `stage`, `rating`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, NULL, 'interview_scheduled', 4, 'Strong system design skills demonstrated in initial technical screening.', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `job_applications` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_periods`
--
DROP TABLE IF EXISTS `payroll_periods`;
CREATE TABLE `payroll_periods` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `payment_date` date NOT NULL,
  `status` enum('draft','processing','finalized','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `total_gross` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_deductions` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_net` decimal(14,2) NOT NULL DEFAULT '0.00',
  `processed_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_periods_org_idx` (`organization_id`),
  KEY `payroll_periods_proc_idx` (`processed_by`),
  CONSTRAINT `fk_payroll_periods_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_payroll_periods_user` FOREIGN KEY (`processed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_periods` (1 records)
--
LOCK TABLES `payroll_periods` WRITE;
/*!40000 ALTER TABLE `payroll_periods` DISABLE KEYS */;
INSERT INTO `payroll_periods` (`id`, `organization_id`, `name`, `start_date`, `end_date`, `payment_date`, `status`, `total_gross`, `total_deductions`, `total_net`, `processed_by`, `created_at`, `updated_at`) VALUES
(1, 1, 'October 2026', '2026-10-01 00:00:00', '2026-10-31 00:00:00', '2026-10-31 00:00:00', 'finalized', 4571231.98, 141061.64, 4430170.34, NULL, '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `payroll_periods` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_items`
--
DROP TABLE IF EXISTS `payroll_items`;
CREATE TABLE `payroll_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `payroll_period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `basic_salary` decimal(12,2) NOT NULL DEFAULT '0.00',
  `house_rent` decimal(12,2) NOT NULL DEFAULT '0.00',
  `medical` decimal(12,2) NOT NULL DEFAULT '0.00',
  `conveyance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `overtime_hours` decimal(6,2) NOT NULL DEFAULT '0.00',
  `overtime_pay` decimal(12,2) NOT NULL DEFAULT '0.00',
  `bonus` decimal(12,2) NOT NULL DEFAULT '0.00',
  `deductions` decimal(12,2) NOT NULL DEFAULT '0.00',
  `tax` decimal(12,2) NOT NULL DEFAULT '0.00',
  `net_salary` decimal(12,2) NOT NULL DEFAULT '0.00',
  `payment_status` enum('pending','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payroll_period_emp_unique` (`payroll_period_id`,`employee_id`),
  KEY `payroll_items_org_idx` (`organization_id`),
  KEY `payroll_items_emp_idx` (`employee_id`),
  CONSTRAINT `fk_payroll_items_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_payroll_items_period` FOREIGN KEY (`payroll_period_id`) REFERENCES `payroll_periods` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_payroll_items_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_items` (50 records)
--
LOCK TABLES `payroll_items` WRITE;
/*!40000 ALTER TABLE `payroll_items` DISABLE KEYS */;
INSERT INTO `payroll_items` (`id`, `organization_id`, `payroll_period_id`, `employee_id`, `basic_salary`, `house_rent`, `medical`, `conveyance`, `overtime_hours`, `overtime_pay`, `bonus`, `deductions`, `tax`, `net_salary`, `payment_status`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, 140000, 70000, 42000, 28000, 3, 3028.85, 0, 12401.44, 12401.44, 270627.41, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(2, 1, 1, 2, 130000, 65000, 39000, 26000, 5, 4687.5, 0, 11484.38, 11484.38, 253203.12, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(3, 1, 1, 3, 27500, 13750, 8250, 5500, 8, 1586.54, 0, 1079.33, 1079.33, 55507.21, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(4, 1, 1, 4, 80000, 40000, 24000, 16000, 5, 2884.62, 0, 6394.23, 6394.23, 156490.39, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(5, 1, 1, 5, 55000, 27500, 16500, 11000, 2, 793.27, 0, 3789.66, 3789.66, 107003.61, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(6, 1, 1, 6, 37500, 18750, 11250, 7500, 0, 0, 0, 2000, 2000, 73000, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(7, 1, 1, 7, 25000, 12500, 7500, 5000, 11, 1983.17, 0, 849.16, 849.16, 51134.01, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(8, 1, 1, 8, 87500, 43750, 26250, 17500, 0, 0, 0, 7000, 7000, 168000, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(9, 1, 1, 9, 45000, 22500, 13500, 9000, 9, 2920.67, 0, 2896.03, 2896.03, 90024.64, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(10, 1, 1, 10, 32500, 16250, 9750, 6500, 7, 1640.63, 0, 1582.03, 1582.03, 65058.6, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(11, 1, 1, 11, 22500, 11250, 6750, 4500, 0, 0, 0, 500, 500, 44500, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(12, 1, 1, 12, 120000, 60000, 36000, 24000, 0, 0, 0, 10250, 10250, 229750, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(13, 1, 1, 13, 90000, 45000, 27000, 18000, 8, 5192.31, 0, 7509.62, 7509.62, 177682.69, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(14, 1, 1, 14, 67500, 33750, 20250, 13500, 11, 5354.57, 0, 5267.73, 5267.73, 135086.84, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(15, 1, 1, 15, 65000, 32500, 19500, 13000, 12, 5625, 0, 5031.25, 5031.25, 130593.75, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(16, 1, 1, 16, 62500, 31250, 18750, 12500, 4, 1802.88, 0, 4590.14, 4590.14, 122212.74, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(17, 1, 1, 17, 52500, 26250, 15750, 10500, 1, 378.61, 0, 3518.93, 3518.93, 101859.68, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(18, 1, 1, 18, 40000, 20000, 12000, 8000, 12, 3461.54, 0, 2423.08, 2423.08, 81038.46, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(19, 1, 1, 19, 40000, 20000, 12000, 8000, 2, 576.92, 0, 2278.85, 2278.85, 78298.07, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(20, 1, 1, 20, 37500, 18750, 11250, 7500, 3, 811.3, 0, 2040.57, 2040.57, 73770.73, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(21, 1, 1, 21, 22500, 11250, 6750, 4500, 5, 811.3, 0, 540.57, 540.57, 45270.73, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(22, 1, 1, 22, 35000, 17500, 10500, 7000, 8, 2019.23, 0, 1850.96, 1850.96, 70168.27, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(23, 1, 1, 23, 32500, 16250, 9750, 6500, 10, 2343.75, 0, 1617.19, 1617.19, 65726.56, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(24, 1, 1, 24, 30000, 15000, 9000, 6000, 9, 1947.12, 0, 1347.36, 1347.36, 60599.76, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(25, 1, 1, 25, 100000, 50000, 30000, 20000, 10, 7211.54, 0, 8610.58, 8610.58, 198600.96, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(26, 1, 1, 26, 55000, 27500, 16500, 11000, 0, 0, 0, 3750, 3750, 106250, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(27, 1, 1, 27, 30000, 15000, 9000, 6000, 3, 649.04, 0, 1282.45, 1282.45, 59366.59, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(28, 1, 1, 28, 22500, 11250, 6750, 4500, 7, 1135.82, 0, 556.79, 556.79, 45579.03, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(29, 1, 1, 29, 21000, 10500, 6300, 4200, 2, 302.88, 0, 365.14, 365.14, 41937.74, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(30, 1, 1, 30, 25000, 12500, 7500, 5000, 11, 1983.17, 0, 849.16, 849.16, 51134.01, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(31, 1, 1, 31, 20000, 10000, 6000, 4000, 4, 576.92, 0, 278.85, 278.85, 40298.07, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(32, 1, 1, 32, 82500, 41250, 24750, 16500, 6, 3569.71, 0, 6678.49, 6678.49, 161891.22, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(33, 1, 1, 33, 50000, 25000, 15000, 10000, 0, 0, 0, 3250, 3250, 96750, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(34, 1, 1, 34, 42500, 21250, 12750, 8500, 11, 3371.39, 0, 2668.57, 2668.57, 85702.82, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(35, 1, 1, 35, 25000, 12500, 7500, 5000, 5, 901.44, 0, 795.07, 795.07, 50106.37, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(36, 1, 1, 36, 24000, 12000, 7200, 4800, 4, 692.31, 0, 684.62, 684.62, 48007.69, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(37, 1, 1, 37, 22500, 11250, 6750, 4500, 5, 811.3, 0, 540.57, 540.57, 45270.73, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(38, 1, 1, 38, 37500, 18750, 11250, 7500, 9, 2433.89, 0, 2121.69, 2121.69, 75312.2, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(39, 1, 1, 39, 30000, 15000, 9000, 6000, 10, 2163.46, 0, 1358.17, 1358.17, 60805.29, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(40, 1, 1, 40, 22500, 11250, 6750, 4500, 5, 811.3, 0, 540.57, 540.57, 45270.73, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(41, 1, 1, 41, 25000, 12500, 7500, 5000, 5, 901.44, 0, 795.07, 795.07, 50106.37, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(42, 1, 1, 42, 21000, 10500, 6300, 4200, 7, 1060.1, 0, 403.01, 403.01, 42657.09, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(43, 1, 1, 43, 24000, 12000, 7200, 4800, 10, 1730.77, 0, 736.54, 736.54, 48994.23, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(44, 1, 1, 44, 35000, 17500, 10500, 7000, 3, 757.21, 0, 1787.86, 1787.86, 68969.35, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(45, 1, 1, 45, 20000, 10000, 6000, 4000, 12, 1730.77, 0, 336.54, 336.54, 41394.23, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(46, 1, 1, 46, 24000, 12000, 7200, 4800, 5, 865.38, 0, 693.27, 693.27, 48172.11, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(47, 1, 1, 47, 23000, 11500, 6900, 4600, 10, 1658.65, 0, 632.93, 632.93, 47025.72, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(48, 1, 1, 48, 24000, 12000, 7200, 4800, 3, 519.23, 0, 675.96, 675.96, 47843.27, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(49, 1, 1, 49, 23500, 11750, 7050, 4700, 5, 847.36, 0, 642.37, 642.37, 47204.99, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22'),
(50, 1, 1, 50, 34000, 17000, 10200, 6800, 11, 2697.12, 0, 1784.86, 1784.86, 68912.26, 'paid', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `payroll_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `helpdesk_tickets`
--
DROP TABLE IF EXISTS `helpdesk_tickets`;
CREATE TABLE `helpdesk_tickets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `assigned_to` bigint unsigned DEFAULT NULL,
  `ticket_number` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` enum('payroll','leave','workplace','it_support','general') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `priority` enum('low','medium','high','urgent') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `status` enum('open','in_progress','resolved','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tickets_org_idx` (`organization_id`),
  KEY `tickets_emp_idx` (`employee_id`),
  KEY `tickets_assign_idx` (`assigned_to`),
  CONSTRAINT `fk_tickets_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_tickets_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_tickets_user` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `helpdesk_tickets` (1 records)
--
LOCK TABLES `helpdesk_tickets` WRITE;
/*!40000 ALTER TABLE `helpdesk_tickets` DISABLE KEYS */;
INSERT INTO `helpdesk_tickets` (`id`, `organization_id`, `employee_id`, `assigned_to`, `ticket_number`, `subject`, `description`, `category`, `priority`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 3, NULL, 'TICK-48192', 'Tax deduction computation inquiry for festive bonus', 'Kindly provide clarification regarding source tax withheld on this quarter bonus.', 'payroll', 'medium', 'open', '2026-10-28 12:27:22', '2026-10-28 12:27:22');
/*!40000 ALTER TABLE `helpdesk_tickets` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `helpdesk_comments`
--
DROP TABLE IF EXISTS `helpdesk_comments`;
CREATE TABLE `helpdesk_comments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `helpdesk_ticket_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_internal` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_comments_ticket_idx` (`helpdesk_ticket_id`),
  KEY `ticket_comments_user_idx` (`user_id`),
  CONSTRAINT `fk_comments_ticket` FOREIGN KEY (`helpdesk_ticket_id`) REFERENCES `helpdesk_tickets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_comments_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `audit_logs`
--
DROP TABLE IF EXISTS `audit_logs`;
CREATE TABLE `audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `actor_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `actor_role` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `record_identifier` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `audit_entity_identifier_idx` (`entity_type`,`record_identifier`),
  KEY `audit_user_idx` (`user_id`),
  KEY `audit_action_idx` (`action`),
  KEY `audit_created_at_idx` (`created_at`),
  KEY `audit_org_idx` (`organization_id`),
  CONSTRAINT `fk_audit_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_audit_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `settings`
--
DROP TABLE IF EXISTS `settings`;
CREATE TABLE `settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organization_id` bigint unsigned DEFAULT NULL,
  `key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `group` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'string',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `settings_org_idx` (`organization_id`),
  CONSTRAINT `fk_settings_org` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed successfully.