-- MariaDB dump 10.19  Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: localhost    Database: capeonn_db
-- ------------------------------------------------------
-- Server version	10.4.32-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00: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 */;

--
-- Table structure for table `attendance_regularizations`
--

DROP TABLE IF EXISTS `attendance_regularizations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attendance_regularizations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `attendance_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `company_id` bigint(20) unsigned NOT NULL,
  `date` date NOT NULL,
  `requested_clock_in` datetime NOT NULL,
  `requested_clock_out` datetime NOT NULL,
  `reason` text NOT NULL,
  `status` varchar(30) NOT NULL DEFAULT 'pending',
  `actioned_by_id` bigint(20) unsigned DEFAULT NULL,
  `rejection_reason` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendance_regularizations_attendance_id_foreign` (`attendance_id`),
  KEY `attendance_regularizations_user_id_foreign` (`user_id`),
  KEY `attendance_regularizations_actioned_by_id_foreign` (`actioned_by_id`),
  KEY `attendance_regularizations_company_id_status_index` (`company_id`,`status`),
  KEY `attendance_regularizations_company_id_user_id_date_index` (`company_id`,`user_id`,`date`),
  CONSTRAINT `attendance_regularizations_actioned_by_id_foreign` FOREIGN KEY (`actioned_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_regularizations_attendance_id_foreign` FOREIGN KEY (`attendance_id`) REFERENCES `attendances` (`id`) ON DELETE SET NULL,
  CONSTRAINT `attendance_regularizations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendance_regularizations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `attendance_regularizations`
--

LOCK TABLES `attendance_regularizations` WRITE;
/*!40000 ALTER TABLE `attendance_regularizations` DISABLE KEYS */;
INSERT INTO `attendance_regularizations` VALUES (1,1,2,1,'2026-10-01','2026-10-01 09:00:00','2026-10-01 18:00:00','late','rejected',2,'Rejected by manager','2026-10-01 01:13:47','2026-10-01 01:14:14');
/*!40000 ALTER TABLE `attendance_regularizations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `attendances`
--

DROP TABLE IF EXISTS `attendances`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attendances` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `company_id` bigint(20) unsigned NOT NULL,
  `date` date NOT NULL,
  `clock_in_at` datetime NOT NULL,
  `clock_out_at` datetime DEFAULT NULL,
  `clock_in_ip` varchar(45) DEFAULT NULL,
  `clock_out_ip` varchar(45) DEFAULT NULL,
  `clock_in_latitude` decimal(10,7) DEFAULT NULL,
  `clock_in_longitude` decimal(10,7) DEFAULT NULL,
  `clock_out_latitude` decimal(10,7) DEFAULT NULL,
  `clock_out_longitude` decimal(10,7) DEFAULT NULL,
  `clock_in_location_name` varchar(255) DEFAULT NULL,
  `clock_out_location_name` varchar(255) DEFAULT NULL,
  `is_flagged` tinyint(1) NOT NULL DEFAULT 0,
  `flagged_reason` varchar(255) DEFAULT NULL,
  `geofence_status` varchar(30) NOT NULL DEFAULT 'inside',
  `status` varchar(30) NOT NULL DEFAULT 'present',
  `total_minutes` int(10) unsigned NOT NULL DEFAULT 0,
  `break_minutes` int(10) unsigned NOT NULL DEFAULT 0,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attendances_user_id_date_unique` (`user_id`,`date`),
  KEY `attendances_company_id_date_index` (`company_id`,`date`),
  KEY `attendances_company_id_is_flagged_index` (`company_id`,`is_flagged`),
  CONSTRAINT `attendances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `attendances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `attendances`
--

LOCK TABLES `attendances` WRITE;
/*!40000 ALTER TABLE `attendances` DISABLE KEYS */;
INSERT INTO `attendances` VALUES (1,2,1,'2026-10-01','2026-10-01 06:43:25',NULL,'127.0.0.1',NULL,12.9716000,77.5946000,NULL,NULL,'Bangalore Office',NULL,0,NULL,'inside','present',0,0,NULL,'2026-10-01 01:13:25','2026-10-01 01:13:25');
/*!40000 ALTER TABLE `attendances` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache`
--

DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache`
--

LOCK TABLES `cache` WRITE;
/*!40000 ALTER TABLE `cache` DISABLE KEYS */;
INSERT INTO `cache` VALUES ('laravel-cache-5d4ffb6b2386469093a462804f55b028','i:1;',1790762842),('laravel-cache-5d4ffb6b2386469093a462804f55b028:timer','i:1790762842;',1790762842),('laravel-cache-6b7966734015ff54621c218ff8e5fda0','i:1;',1790836991),('laravel-cache-6b7966734015ff54621c218ff8e5fda0:timer','i:1790836991;',1790836991),('laravel-cache-87c1bf7ed77de3d8ce46df7c40a280c2','i:1;',1790756330),('laravel-cache-87c1bf7ed77de3d8ce46df7c40a280c2:timer','i:1790756330;',1790756330),('laravel-cache-a40c5fd7d637b4f4cf3b8c39bb1f1aa8','i:1;',1790757442),('laravel-cache-a40c5fd7d637b4f4cf3b8c39bb1f1aa8:timer','i:1790757442;',1790757442),('laravel-cache-a84631ce634cecaf9a59d86591903b6e','i:1;',1790837050),('laravel-cache-a84631ce634cecaf9a59d86591903b6e:timer','i:1790837050;',1790837050),('laravel-cache-e1511ff4907e8cfb1d74a00d910c6834','i:1;',1790836979),('laravel-cache-e1511ff4907e8cfb1d74a00d910c6834:timer','i:1790836979;',1790836979),('laravel-cache-fb0e0f6f18e0cc421053909e4d4c80f0','i:1;',1790757421),('laravel-cache-fb0e0f6f18e0cc421053909e4d4c80f0:timer','i:1790757421;',1790757421);
/*!40000 ALTER TABLE `cache` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache_locks`
--

DROP TABLE IF EXISTS `cache_locks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_locks_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache_locks`
--

LOCK TABLES `cache_locks` WRITE;
/*!40000 ALTER TABLE `cache_locks` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache_locks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `companies`
--

DROP TABLE IF EXISTS `companies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `companies` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(20) NOT NULL,
  `legal_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `logo_path` varchar(255) DEFAULT NULL,
  `timezone` varchar(64) NOT NULL DEFAULT 'Asia/Kolkata',
  `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`),
  UNIQUE KEY `companies_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `companies`
--

LOCK TABLES `companies` WRITE;
/*!40000 ALTER TABLE `companies` DISABLE KEYS */;
INSERT INTO `companies` VALUES (1,'Capeonn','CAP',NULL,'capeonn@gmail.com','985741230','123, sivakasi',NULL,'Asia/Kolkata',1,'2026-09-29 06:20:58','2026-09-30 02:31:44',NULL);
/*!40000 ALTER TABLE `companies` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `departments`
--

DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `departments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(20) NOT NULL,
  `description` text DEFAULT NULL,
  `head_user_id` bigint(20) 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`),
  UNIQUE KEY `departments_company_id_code_unique` (`company_id`,`code`),
  KEY `departments_head_user_id_foreign` (`head_user_id`),
  CONSTRAINT `departments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
  CONSTRAINT `departments_head_user_id_foreign` FOREIGN KEY (`head_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `departments`
--

LOCK TABLES `departments` WRITE;
/*!40000 ALTER TABLE `departments` DISABLE KEYS */;
INSERT INTO `departments` VALUES (1,1,'Engineering','ENG',NULL,2,1,'2026-09-29 06:20:58','2026-09-29 06:20:59',NULL),(2,1,'Development','DEV',NULL,2,1,'2026-09-30 02:28:15','2026-09-30 02:28:15',NULL);
/*!40000 ALTER TABLE `departments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `designations`
--

DROP TABLE IF EXISTS `designations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `designations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT 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 `designations_company_id_name_unique` (`company_id`,`name`),
  CONSTRAINT `designations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `designations`
--

LOCK TABLES `designations` WRITE;
/*!40000 ALTER TABLE `designations` DISABLE KEYS */;
INSERT INTO `designations` VALUES (1,1,'Engineering Manager',1,'2026-09-29 06:20:58','2026-09-29 06:20:58'),(2,1,'Team Lead',1,'2026-09-29 06:20:58','2026-09-29 06:20:58'),(3,1,'Software Engineer',1,'2026-09-29 06:20:58','2026-09-29 06:20:58'),(4,1,'Development Manager',1,'2026-09-30 02:28:55','2026-09-30 02:28:55');
/*!40000 ALTER TABLE `designations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_documents`
--

DROP TABLE IF EXISTS `employee_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `company_id` bigint(20) unsigned NOT NULL,
  `title` varchar(255) NOT NULL,
  `document_type` varchar(50) NOT NULL DEFAULT 'other',
  `file_path` varchar(255) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_size` bigint(20) unsigned NOT NULL DEFAULT 0,
  `mime_type` varchar(100) DEFAULT NULL,
  `uploaded_by_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_documents_user_id_foreign` (`user_id`),
  KEY `employee_documents_uploaded_by_id_foreign` (`uploaded_by_id`),
  KEY `employee_documents_company_id_user_id_index` (`company_id`,`user_id`),
  CONSTRAINT `employee_documents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `employee_documents_uploaded_by_id_foreign` FOREIGN KEY (`uploaded_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employee_documents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_documents`
--

LOCK TABLES `employee_documents` WRITE;
/*!40000 ALTER TABLE `employee_documents` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_histories`
--

DROP TABLE IF EXISTS `employee_histories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee_histories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `company_id` bigint(20) unsigned NOT NULL,
  `event_type` varchar(50) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `effective_date` date NOT NULL,
  `performed_by_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_histories_user_id_foreign` (`user_id`),
  KEY `employee_histories_performed_by_id_foreign` (`performed_by_id`),
  KEY `employee_histories_company_id_user_id_effective_date_index` (`company_id`,`user_id`,`effective_date`),
  CONSTRAINT `employee_histories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `employee_histories_performed_by_id_foreign` FOREIGN KEY (`performed_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employee_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_histories`
--

LOCK TABLES `employee_histories` WRITE;
/*!40000 ALTER TABLE `employee_histories` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_histories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `failed_jobs`
--

DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `failed_jobs`
--

LOCK TABLES `failed_jobs` WRITE;
/*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `holidays`
--

DROP TABLE IF EXISTS `holidays`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `holidays` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `holiday_type` varchar(30) NOT NULL DEFAULT 'company',
  `description` text DEFAULT NULL,
  `is_optional` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `holidays_company_id_date_unique` (`company_id`,`date`),
  KEY `holidays_company_id_date_index` (`company_id`,`date`),
  CONSTRAINT `holidays_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `holidays`
--

LOCK TABLES `holidays` WRITE;
/*!40000 ALTER TABLE `holidays` DISABLE KEYS */;
INSERT INTO `holidays` VALUES (1,1,'New Year\'s Day','2026-01-01','national',NULL,0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(2,1,'Republic Day','2026-01-26','national',NULL,0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(3,1,'Labour Day','2026-05-01','national',NULL,0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(4,1,'Independence Day','2026-08-15','national',NULL,0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(5,1,'Gandhi Jayanti','2026-10-02','national',NULL,0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(6,1,'Diwali / Deepavali','2026-11-08','festival',NULL,0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(7,1,'Christmas','2026-12-25','festival',NULL,0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(8,1,'Maharam','2026-10-20','festival',NULL,0,'2026-10-01 01:09:12','2026-10-01 01:09:12');
/*!40000 ALTER TABLE `holidays` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_batches`
--

DROP TABLE IF EXISTS `job_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `job_batches`
--

LOCK TABLES `job_batches` WRITE;
/*!40000 ALTER TABLE `job_batches` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_batches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `jobs`
--

DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) unsigned NOT NULL,
  `reserved_at` int(10) unsigned DEFAULT NULL,
  `available_at` int(10) unsigned NOT NULL,
  `created_at` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `jobs`
--

LOCK TABLES `jobs` WRITE;
/*!40000 ALTER TABLE `jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_balances`
--

DROP TABLE IF EXISTS `leave_balances`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leave_balances` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `company_id` bigint(20) unsigned NOT NULL,
  `leave_type_id` bigint(20) unsigned NOT NULL,
  `year` smallint(5) unsigned NOT NULL,
  `total_days` decimal(4,1) NOT NULL DEFAULT 0.0,
  `used_days` decimal(4,1) NOT NULL DEFAULT 0.0,
  `pending_days` decimal(4,1) NOT NULL DEFAULT 0.0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `leave_balances_user_id_leave_type_id_year_unique` (`user_id`,`leave_type_id`,`year`),
  KEY `leave_balances_leave_type_id_foreign` (`leave_type_id`),
  KEY `leave_balances_company_id_year_index` (`company_id`,`year`),
  CONSTRAINT `leave_balances_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `leave_balances_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE,
  CONSTRAINT `leave_balances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `leave_balances`
--

LOCK TABLES `leave_balances` WRITE;
/*!40000 ALTER TABLE `leave_balances` DISABLE KEYS */;
INSERT INTO `leave_balances` VALUES (1,1,1,1,2026,12.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(2,1,1,2,2026,10.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(3,1,1,3,2026,15.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(4,1,1,4,2026,0.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(5,2,1,1,2026,12.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(6,2,1,2,2026,10.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(7,2,1,3,2026,15.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(8,2,1,4,2026,0.0,0.0,0.0,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(9,3,1,1,2026,12.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(10,3,1,2,2026,10.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(11,3,1,3,2026,15.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(12,3,1,4,2026,0.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(13,4,1,1,2026,12.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(14,4,1,2,2026,10.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(15,4,1,3,2026,15.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(16,4,1,4,2026,0.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(17,5,1,1,2026,12.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(18,5,1,2,2026,10.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(19,5,1,3,2026,15.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(20,5,1,4,2026,0.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(21,6,1,1,2026,12.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(22,6,1,2,2026,10.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(23,6,1,3,2026,15.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(24,6,1,4,2026,0.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(25,7,1,1,2026,12.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(26,7,1,2,2026,10.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(27,7,1,3,2026,15.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14'),(28,7,1,4,2026,0.0,0.0,0.0,'2026-09-30 07:14:14','2026-09-30 07:14:14');
/*!40000 ALTER TABLE `leave_balances` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_requests`
--

DROP TABLE IF EXISTS `leave_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leave_requests` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `company_id` bigint(20) unsigned NOT NULL,
  `leave_type_id` bigint(20) unsigned NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `is_half_day` tinyint(1) NOT NULL DEFAULT 0,
  `half_day_type` varchar(20) DEFAULT NULL,
  `days_count` decimal(4,1) NOT NULL DEFAULT 1.0,
  `reason` text NOT NULL,
  `status` varchar(30) NOT NULL DEFAULT 'pending',
  `actioned_by_id` bigint(20) unsigned DEFAULT NULL,
  `action_remarks` text DEFAULT NULL,
  `attachment_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leave_requests_leave_type_id_foreign` (`leave_type_id`),
  KEY `leave_requests_actioned_by_id_foreign` (`actioned_by_id`),
  KEY `leave_requests_company_id_status_index` (`company_id`,`status`),
  KEY `leave_requests_user_id_status_index` (`user_id`,`status`),
  KEY `leave_requests_company_id_start_date_end_date_index` (`company_id`,`start_date`,`end_date`),
  CONSTRAINT `leave_requests_actioned_by_id_foreign` FOREIGN KEY (`actioned_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `leave_requests_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `leave_requests_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`),
  CONSTRAINT `leave_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `leave_requests`
--

LOCK TABLES `leave_requests` WRITE;
/*!40000 ALTER TABLE `leave_requests` DISABLE KEYS */;
/*!40000 ALTER TABLE `leave_requests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_types`
--

DROP TABLE IF EXISTS `leave_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leave_types` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(20) NOT NULL,
  `description` text DEFAULT NULL,
  `annual_days` decimal(4,1) NOT NULL DEFAULT 12.0,
  `is_paid` tinyint(1) NOT NULL DEFAULT 1,
  `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 `leave_types_company_id_code_unique` (`company_id`,`code`),
  CONSTRAINT `leave_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `leave_types`
--

LOCK TABLES `leave_types` WRITE;
/*!40000 ALTER TABLE `leave_types` DISABLE KEYS */;
INSERT INTO `leave_types` VALUES (1,1,'Casual Leave','CL',NULL,12.0,1,1,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(2,1,'Sick Leave','SL',NULL,10.0,1,1,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(3,1,'Privilege Leave','PL',NULL,15.0,1,1,'2026-09-30 07:14:13','2026-09-30 07:14:13'),(4,1,'Loss of Pay','LOP',NULL,0.0,0,1,'2026-09-30 07:14:13','2026-09-30 07:14:13');
/*!40000 ALTER TABLE `leave_types` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `migrations`
--

DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `migrations`
--

LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'0001_01_01_000000_create_users_table',1),(2,'0001_01_01_000001_create_cache_table',1),(3,'0001_01_01_000002_create_jobs_table',1),(4,'0001_01_01_000003_create_personal_access_tokens',1),(5,'2026_09_29_000002_create_companies_table',1),(6,'2026_09_29_000003_create_roles_and_permissions_tables',1),(7,'2026_09_29_000004_create_departments_and_designations_tables',1),(8,'2026_09_29_000005_add_organization_fields_to_users_table',1),(9,'2026_09_30_000001_add_profile_fields_to_users_table',2),(10,'2026_09_30_000002_create_employee_documents_table',2),(11,'2026_09_30_000003_create_employee_histories_table',2),(12,'2026_09_30_000004_create_office_locations_table',2),(13,'2026_09_30_000005_create_attendances_table',2),(14,'2026_09_30_000006_create_attendance_regularizations_table',2),(15,'2026_09_30_000007_create_leave_tables',2),(16,'2026_09_30_000008_create_holidays_table',2);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `office_locations`
--

DROP TABLE IF EXISTS `office_locations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `office_locations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `address` varchar(255) DEFAULT NULL,
  `latitude` decimal(10,7) NOT NULL,
  `longitude` decimal(10,7) NOT NULL,
  `radius_meters` int(10) unsigned NOT NULL DEFAULT 500,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `office_locations_company_id_is_active_index` (`company_id`,`is_active`),
  CONSTRAINT `office_locations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `office_locations`
--

LOCK TABLES `office_locations` WRITE;
/*!40000 ALTER TABLE `office_locations` DISABLE KEYS */;
INSERT INTO `office_locations` VALUES (1,1,'Capeonn HQ - Tech Park','100 Innovation Boulevard, Bangalore, KA, India',12.9716000,77.5946000,1000,1,'2026-09-30 07:14:13','2026-09-30 07:14:13');
/*!40000 ALTER TABLE `office_locations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_reset_tokens`
--

DROP TABLE IF EXISTS `password_reset_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_reset_tokens`
--

LOCK TABLES `password_reset_tokens` WRITE;
/*!40000 ALTER TABLE `password_reset_tokens` DISABLE KEYS */;
INSERT INTO `password_reset_tokens` VALUES ('admin@capeonn.test','$2y$12$bY9wabapvINtkGHSRkQe3.0SjSmtJvKlxqBLJMPiQvju9fVBJbjke','2026-09-29 06:41:48');
/*!40000 ALTER TABLE `password_reset_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `permissions`
--

DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(100) NOT NULL,
  `module` varchar(50) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_slug_unique` (`slug`),
  KEY `permissions_module_index` (`module`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `permissions`
--

LOCK TABLES `permissions` WRITE;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
INSERT INTO `permissions` VALUES (1,'organization.view','organization','View company and departments','2026-09-29 06:20:58','2026-09-29 06:20:58'),(2,'organization.manage','organization','Create/edit company, departments and designations','2026-09-29 06:20:58','2026-09-29 06:20:58'),(3,'employees.view','employees','View employee records','2026-09-29 06:20:58','2026-09-29 06:20:58'),(4,'employees.manage','employees','Create/edit/deactivate employees','2026-09-29 06:20:58','2026-09-29 06:20:58'),(5,'projects.view','projects','View projects','2026-09-29 06:20:58','2026-09-29 06:20:58'),(6,'projects.manage','projects','Create/edit projects','2026-09-29 06:20:58','2026-09-29 06:20:58'),(7,'projects.assign','projects','Assign projects to Team Leads','2026-09-29 06:20:58','2026-09-29 06:20:58'),(8,'tasks.view','tasks','View tasks','2026-09-29 06:20:58','2026-09-29 06:20:58'),(9,'tasks.manage','tasks','Create, assign and manage tasks','2026-09-29 06:20:58','2026-09-29 06:20:58'),(10,'tasks.update','tasks','Update status/progress of tasks','2026-09-29 06:20:58','2026-09-29 06:20:58'),(11,'time.view','time','View time tracking records','2026-09-29 06:20:58','2026-09-29 06:20:58'),(12,'time.track','time','Start/pause/complete own task timer','2026-09-29 06:20:58','2026-09-29 06:20:58'),(13,'chat.use','chat','Use internal chat','2026-09-29 06:20:58','2026-09-29 06:20:58'),(14,'reports.view','reports','View reports and dashboards','2026-09-29 06:20:58','2026-09-29 06:20:58'),(15,'attendance.view','attendance','View attendance records','2026-09-29 06:20:58','2026-09-29 06:20:58'),(16,'attendance.record','attendance','Check in / check out','2026-09-29 06:20:58','2026-09-29 06:20:58'),(17,'leave.view','leave','View leave requests and balances','2026-09-29 06:20:58','2026-09-29 06:20:58'),(18,'leave.apply','leave','Apply for leave','2026-09-29 06:20:58','2026-09-29 06:20:58'),(19,'leave.approve','leave','Approve or reject leave','2026-09-29 06:20:58','2026-09-29 06:20:58'),(20,'attendance.manage','attendance','Manage attendance, regularizations and locations','2026-09-30 07:13:44','2026-09-30 07:13:44'),(21,'leave.manage','leave','Manage leave types and allocations','2026-09-30 07:13:44','2026-09-30 07:13:44'),(22,'holidays.view','holidays','View company holidays','2026-09-30 07:13:44','2026-09-30 07:13:44'),(23,'holidays.manage','holidays','Create and manage company holidays','2026-09-30 07:13:44','2026-09-30 07:13:44'),(24,'documents.view','documents','View employee documents','2026-09-30 07:13:44','2026-09-30 07:13:44'),(25,'documents.manage','documents','Upload and manage employee documents','2026-09-30 07:13:44','2026-09-30 07:13:44');
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `personal_access_tokens`
--

DROP TABLE IF EXISTS `personal_access_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `personal_access_tokens` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(255) NOT NULL,
  `tokenable_id` bigint(20) unsigned NOT NULL,
  `name` text NOT NULL,
  `token` varchar(64) NOT NULL,
  `abilities` text DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`),
  KEY `personal_access_tokens_expires_at_index` (`expires_at`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `personal_access_tokens`
--

LOCK TABLES `personal_access_tokens` WRITE;
/*!40000 ALTER TABLE `personal_access_tokens` DISABLE KEYS */;
INSERT INTO `personal_access_tokens` VALUES (7,'App\\Models\\User',6,'web','4b33f7e38f43bf28a3ecfce34fe20c314e19c9ad5a4ca7a90292bfe41cc306ad','[\"*\"]','2026-09-30 04:15:20','2026-10-07 03:06:23','2026-09-30 03:06:23','2026-09-30 04:15:20'),(8,'App\\Models\\User',2,'windows','8bd649600306e7d9c7502501e85cecbfadcb32a4c21383d3c3bdd1c6883f58b0','[\"*\"]',NULL,'2026-10-07 04:33:37','2026-09-30 04:33:37','2026-09-30 04:33:37'),(9,'App\\Models\\User',2,'windows','2abc8d6dadb81de14e0b3c6b67738f5767e2c7f0ebe4bd619dcf8c419daf6d91','[\"*\"]','2026-09-30 04:34:00','2026-10-07 04:33:52','2026-09-30 04:33:52','2026-09-30 04:34:00'),(10,'App\\Models\\User',2,'windows','496e0ec272ff4be6035a78ad2923584b4d58515aad5da26df679ca50019e5b3a','[\"*\"]','2026-09-30 04:34:22','2026-10-07 04:33:56','2026-09-30 04:33:56','2026-09-30 04:34:22'),(12,'App\\Models\\User',2,'web','ab1a1fa6d52ff02839b5399942a62e92efa81a1972282fae2f28384a79b53a5b','[\"*\"]','2026-09-30 05:11:54','2026-10-07 04:37:56','2026-09-30 04:37:56','2026-09-30 05:11:54'),(13,'App\\Models\\User',2,'web','bd39076a1b16093474f48eb4e4acd6f4082dfeb7ea4553316ad12ae666035761','[\"*\"]','2026-09-30 07:57:15','2026-10-07 07:56:58','2026-09-30 07:56:58','2026-09-30 07:57:15'),(16,'App\\Models\\User',2,'web','6d6cd6d246355a475bfe27b59efbc54f45b33a825dbbcc68f41a5c1c64b1f11e','[\"*\"]','2026-10-01 01:14:55','2026-10-08 01:13:11','2026-10-01 01:13:11','2026-10-01 01:14:55');
/*!40000 ALTER TABLE `personal_access_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `role_permission`
--

DROP TABLE IF EXISTS `role_permission`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role_permission` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) unsigned NOT NULL,
  `permission_id` bigint(20) unsigned NOT NULL,
  `scope` varchar(20) NOT NULL DEFAULT 'all',
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_permission_role_id_permission_id_unique` (`role_id`,`permission_id`),
  KEY `role_permission_permission_id_foreign` (`permission_id`),
  CONSTRAINT `role_permission_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_permission_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `role_permission`
--

LOCK TABLES `role_permission` WRITE;
/*!40000 ALTER TABLE `role_permission` DISABLE KEYS */;
INSERT INTO `role_permission` VALUES (1,1,1,'all'),(2,1,2,'all'),(3,1,3,'all'),(4,1,4,'all'),(5,1,5,'all'),(6,1,6,'all'),(7,1,7,'all'),(8,1,8,'all'),(9,1,9,'all'),(10,1,10,'all'),(11,1,11,'all'),(12,1,13,'all'),(13,1,14,'all'),(14,1,15,'all'),(15,1,16,'self'),(16,1,17,'all'),(17,1,18,'self'),(18,1,19,'all'),(19,2,1,'all'),(20,2,3,'department'),(21,2,4,'department'),(22,2,5,'department'),(23,2,6,'department'),(24,2,7,'department'),(25,2,8,'department'),(26,2,11,'team'),(27,2,13,'all'),(28,2,14,'department'),(29,2,15,'department'),(30,2,16,'self'),(31,2,17,'department'),(32,2,18,'self'),(33,2,19,'department'),(34,3,3,'team'),(35,3,5,'assigned'),(36,3,8,'team'),(37,3,9,'team'),(38,3,10,'team'),(39,3,11,'team'),(40,3,13,'all'),(41,3,14,'team'),(42,3,15,'team'),(43,3,16,'self'),(44,3,17,'team'),(45,3,18,'self'),(46,4,3,'self'),(47,4,5,'assigned'),(48,4,8,'assigned'),(49,4,10,'assigned'),(50,4,12,'self'),(51,4,13,'all'),(52,4,15,'self'),(53,4,16,'self'),(54,4,17,'self'),(55,4,18,'self'),(56,1,20,'all'),(57,1,21,'all'),(58,1,22,'all'),(59,1,23,'all'),(60,1,24,'all'),(61,1,25,'all'),(62,2,20,'department'),(63,2,22,'all'),(64,2,24,'department'),(65,2,25,'department'),(66,3,22,'all'),(67,3,24,'team'),(68,4,22,'all'),(69,4,24,'self'),(70,4,25,'self');
/*!40000 ALTER TABLE `role_permission` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(50) NOT NULL,
  `level` smallint(5) unsigned NOT NULL DEFAULT 0,
  `description` varchar(255) DEFAULT NULL,
  `is_system` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `roles`
--

LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'Admin','admin',100,'Full access to the whole company',1,'2026-09-29 06:20:57','2026-09-29 06:20:57'),(2,'Manager','manager',70,'Manages a department and assigns projects to Team Leads',1,'2026-09-29 06:20:58','2026-09-29 06:20:58'),(3,'Team Lead','team_lead',50,'Splits projects into tasks and assigns them to team members',1,'2026-09-29 06:20:58','2026-09-29 06:20:58'),(4,'Employee','employee',10,'Works on assigned tasks',1,'2026-09-29 06:20:58','2026-09-29 06:20:58');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sessions`
--

DROP TABLE IF EXISTS `sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) 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;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sessions`
--

LOCK TABLES `sessions` WRITE;
/*!40000 ALTER TABLE `sessions` DISABLE KEYS */;
/*!40000 ALTER TABLE `sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) unsigned DEFAULT NULL,
  `department_id` bigint(20) unsigned DEFAULT NULL,
  `designation_id` bigint(20) unsigned DEFAULT NULL,
  `role_id` bigint(20) unsigned DEFAULT NULL,
  `reports_to_id` bigint(20) unsigned DEFAULT NULL,
  `employee_code` varchar(30) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `gender` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `emergency_contact_name` varchar(255) DEFAULT NULL,
  `emergency_contact_phone` varchar(30) DEFAULT NULL,
  `employment_type` varchar(30) NOT NULL DEFAULT 'full_time',
  `probation_end_date` date DEFAULT NULL,
  `skills` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`skills`)),
  `certifications` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`certifications`)),
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `joined_on` date DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_login_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  UNIQUE KEY `users_company_id_employee_code_unique` (`company_id`,`employee_code`),
  KEY `users_department_id_foreign` (`department_id`),
  KEY `users_designation_id_foreign` (`designation_id`),
  KEY `users_role_id_foreign` (`role_id`),
  KEY `users_reports_to_id_foreign` (`reports_to_id`),
  KEY `users_company_id_department_id_index` (`company_id`,`department_id`),
  CONSTRAINT `users_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`),
  CONSTRAINT `users_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `users_designation_id_foreign` FOREIGN KEY (`designation_id`) REFERENCES `designations` (`id`) ON DELETE SET NULL,
  CONSTRAINT `users_reports_to_id_foreign` FOREIGN KEY (`reports_to_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,1,NULL,NULL,1,NULL,'CAP-0001','System Admin','admin@capeonn.test',NULL,NULL,NULL,NULL,NULL,NULL,'full_time',NULL,NULL,NULL,NULL,'$2y$12$ZX2qD6MYOFYGgI173cAu5uL8YYbh4EwEjdsB7OCIdKBEBhwI7UefK',NULL,'2026-09-29 06:20:58','2026-10-01 01:12:12','2026-09-29',1,'2026-10-01 01:12:12',NULL),(2,1,1,1,2,1,'CAP-0002','Meera Manager','manager@capeonn.test',NULL,NULL,NULL,NULL,NULL,NULL,'full_time',NULL,NULL,NULL,NULL,'$2y$12$pXs1EjC7r4cQ/4nks37xa.4ch5iy/HDRbzjqLCC1L/jR78PYKbHSC',NULL,'2026-09-29 06:20:58','2026-10-01 01:13:11','2026-09-29',1,'2026-10-01 01:13:11',NULL),(3,1,1,2,3,2,'CAP-0003','Tara Lead','tl@capeonn.test',NULL,NULL,NULL,NULL,NULL,NULL,'full_time',NULL,NULL,NULL,NULL,'$2y$12$pp08./l3hjekScejkR4kMOqzLbAGP6G0B3lmWAnW2JbgfKrjPkFQC',NULL,'2026-09-29 06:20:59','2026-09-30 04:36:23','2026-09-29',1,'2026-09-30 04:36:23',NULL),(4,1,1,3,4,3,'CAP-0004','Eli Employee','employee1@capeonn.test',NULL,NULL,NULL,NULL,NULL,NULL,'full_time',NULL,NULL,NULL,NULL,'$2y$12$WW2wI3FMHqRZtDypSuDR7OJXScd5rnudNntvNOAHFPqTjl6D0Piea',NULL,'2026-09-29 06:20:59','2026-10-01 01:11:36','2026-09-29',0,NULL,NULL),(5,1,1,3,4,3,'CAP-0005','Esha Employee','employee2@capeonn.test',NULL,NULL,NULL,NULL,NULL,NULL,'full_time',NULL,NULL,NULL,NULL,'$2y$12$2t/gA/e/7UNsYdpnoiNm8ubeji33vTlFs5KK0O2pNQUQ8arH60k.u',NULL,'2026-09-29 06:20:59','2026-09-29 06:20:59','2026-09-29',1,NULL,NULL),(6,1,2,4,3,2,'CAP-007','Jegadeesh','jegadeesh2242@gmail.com','8270008610',NULL,NULL,NULL,NULL,NULL,'full_time',NULL,NULL,NULL,NULL,'$2y$12$nT46CWpV57JjJJJweYX7PeVXQ/k7ZzEhCzLK8XIAigGs6vLldcwE2','XbZhsZcvWhPIU2SA1XdQbyLUyquMZuzn4yTcXLan1bOtaOlKU6lcts5bhrHv','2026-09-30 02:26:55','2026-09-30 03:06:23','2026-09-30',1,'2026-09-30 03:06:23',NULL),(7,1,2,3,4,6,'CAP-008','Jagan','jagan@gmail.com','9876543210',NULL,NULL,NULL,NULL,NULL,'full_time',NULL,NULL,NULL,NULL,'$2y$12$9n7Xo/1lmSZmEyTStWvLDO150cyM0LNq5Xd51TJBDDq1qMC0qv2Zm',NULL,'2026-09-30 02:33:49','2026-09-30 02:35:20','2026-09-30',1,'2026-09-30 02:35:20',NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!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 on 2026-10-01 12:50:44
