--
-- Host: localhost    Database: crm_sendo
-- ------------------------------------------------------


--
-- Table structure for table `attendances`
--

CREATE TABLE `attendances` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `technician_name` varchar(255) NOT NULL,
  `work_date` date NOT NULL,
  `check_in_time` datetime DEFAULT NULL,
  `check_out_time` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attendances`
--


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

CREATE TABLE `jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_name` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `job_type` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `customer_type` varchar(255) NOT NULL DEFAULT 'Khách sửa mới',
  `status` varchar(255) NOT NULL DEFAULT 'Mới',
  `technician` varchar(255) DEFAULT NULL,
  `appointment_date` varchar(255) DEFAULT NULL,
  `revenue` int(11) NOT NULL DEFAULT 0,
  `check_in_time` varchar(255) DEFAULT NULL,
  `check_out_time` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `material_cost` decimal(12,2) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `jobs` VALUES (1,'Anh Hùng','121212','121212','Sửa tủ đông / tủ mát',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 02:19:32','2026-05-22 02:35:50',0.00),(2,'test2','3333333','3333333','Vệ sinh máy giặt',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 02:45:56','2026-05-22 02:46:03',0.00),(3,'tétts3','2222222','2222222','Sửa tủ lạnh',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 02:50:48','2026-05-22 02:50:48',0.00),(4,'anh tết 4','5555555','55555','Sửa tủ đông / tủ mát',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 02:51:16','2026-05-22 02:51:21',0.00),(5,'test 99999','99999','999999','Sửa máy làm đá',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 02:56:24','2026-05-22 02:56:29',0.00),(6,'fdffsddf999999','34444444','fgdfgsggsdfgdf','Lắp máy lạnh',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 03:10:25','2026-05-22 03:10:31',0.00),(7,'được ko','5555555','4545555','Sửa máy giặt',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 03:13:30','2026-05-22 03:13:36',0.00),(8,'lần phát','888888888','8888888','Sửa máy làm đá',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 03:17:35','2026-05-22 03:17:41',0.00),(9,'1111111','1111111','111111','Sửa tủ lạnh',NULL,'Khách sửa mới','Mới','Thợ Chính 1','2026-05-22',0,NULL,NULL,'2026-05-22 03:18:06','2026-05-22 03:18:06',0.00);

--
-- Table structure for table `leave_requests`
--

CREATE TABLE `leave_requests` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `technician` varchar(255) NOT NULL,
  `leave_date` varchar(255) NOT NULL,
  `reason` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'Chờ duyệt',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leave_requests`
--


--
-- Table structure for table `migrations`
--

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=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

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,'2026_05_21_095545_create_personal_access_tokens_table',1),(5,'2026_05_21_102926_add_role_to_users_table',1),(6,'2026_05_21_121259_create_attendances_table',1),(7,'2026_05_21_130638_add_material_cost_to_jobs_table',1);

--
-- Table structure for table `sessions`
--

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;

--
-- Dumping data for table `sessions`
--



