--
-- Host: localhost    Database: bondacare
-- ------------------------------------------------------

SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;

--
-- GTID state at the beginning of the backup 
--


--
-- Table structure for table `appointment_quotas`
--

CREATE TABLE `appointment_quotas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `clinic_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `day_of_week` tinyint NOT NULL COMMENT '1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday',
  `time_slot` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quota` int NOT NULL DEFAULT '0',
  `booked` int NOT NULL DEFAULT '0',
  `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 `appointment_quotas_clinic_id_date_time_slot_unique` (`clinic_id`,`date`,`time_slot`),
  CONSTRAINT `appointment_quotas_clinic_id_foreign` FOREIGN KEY (`clinic_id`) REFERENCES `clinics` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `appointment_quotas`
--

INSERT INTO `appointment_quotas` VALUES (1,2,'2026-01-12',1,'08:00-09:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(2,2,'2026-01-12',1,'09:00-10:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(3,2,'2026-01-12',1,'10:00-11:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(4,2,'2026-01-12',1,'11:00-12:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(5,2,'2026-01-12',1,'12:00-13:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(6,2,'2026-01-12',1,'13:00-14:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(7,2,'2026-01-12',1,'14:00-15:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(8,2,'2026-01-12',1,'15:00-16:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(9,2,'2026-01-12',1,'16:00-17:00',5,0,1,'2026-01-10 05:10:59','2026-01-10 05:10:59'),(10,2,'2026-01-05',1,'08:00-09:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(11,2,'2026-01-05',1,'09:00-10:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(12,2,'2026-01-05',1,'10:00-11:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(13,2,'2026-01-05',1,'11:00-12:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(14,2,'2026-01-05',1,'12:00-13:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(15,2,'2026-01-05',1,'13:00-14:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(16,2,'2026-01-05',1,'14:00-15:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(17,2,'2026-01-05',1,'15:00-16:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(18,2,'2026-01-05',1,'16:00-17:00',0,0,1,'2026-01-10 08:14:09','2026-01-10 08:14:09'),(19,2,'2026-01-13',2,'08:00-09:00',5,0,1,'2026-01-10 08:16:51','2026-01-10 08:16:51'),(20,2,'2026-01-13',2,'09:00-10:00',5,0,1,'2026-01-10 08:16:51','2026-01-10 08:16:51'),(21,2,'2026-01-13',2,'10:00-11:00',5,0,1,'2026-01-10 08:16:51','2026-01-10 08:16:51'),(22,2,'2026-01-13',2,'11:00-12:00',5,0,1,'2026-01-10 08:16:51','2026-01-10 08:16:51'),(23,2,'2026-01-13',2,'12:00-13:00',5,1,1,'2026-01-10 08:16:51','2026-01-13 03:17:53'),(24,2,'2026-01-13',2,'13:00-14:00',5,1,1,'2026-01-10 08:16:51','2026-01-13 03:33:14'),(25,2,'2026-01-13',2,'14:00-15:00',5,0,1,'2026-01-10 08:16:51','2026-01-10 08:16:51'),(26,2,'2026-01-13',2,'15:00-16:00',5,0,1,'2026-01-10 08:16:51','2026-01-10 08:16:51'),(27,2,'2026-01-13',2,'16:00-17:00',5,0,1,'2026-01-10 08:16:51','2026-01-10 08:16:51'),(28,2,'2026-01-14',3,'08:00-09:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(29,2,'2026-01-14',3,'09:00-10:00',5,1,1,'2026-01-10 08:17:06','2026-01-13 15:36:55'),(30,2,'2026-01-14',3,'10:00-11:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(31,2,'2026-01-14',3,'11:00-12:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(32,2,'2026-01-14',3,'12:00-13:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(33,2,'2026-01-14',3,'13:00-14:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(34,2,'2026-01-14',3,'14:00-15:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(35,2,'2026-01-14',3,'15:00-16:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(36,2,'2026-01-14',3,'16:00-17:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(37,2,'2026-01-15',4,'08:00-09:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(38,2,'2026-01-15',4,'09:00-10:00',5,1,1,'2026-01-10 08:17:06','2026-01-14 03:03:05'),(39,2,'2026-01-15',4,'10:00-11:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(40,2,'2026-01-15',4,'11:00-12:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(41,2,'2026-01-15',4,'12:00-13:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(42,2,'2026-01-15',4,'13:00-14:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(43,2,'2026-01-15',4,'14:00-15:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(44,2,'2026-01-15',4,'15:00-16:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(45,2,'2026-01-15',4,'16:00-17:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(46,2,'2026-01-16',5,'08:00-09:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(47,2,'2026-01-16',5,'09:00-10:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(48,2,'2026-01-16',5,'10:00-11:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(49,2,'2026-01-16',5,'11:00-12:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(50,2,'2026-01-16',5,'12:00-13:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(51,2,'2026-01-16',5,'13:00-14:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(52,2,'2026-01-16',5,'14:00-15:00',5,0,1,'2026-01-10 08:17:06','2026-01-10 08:17:06'),(53,2,'2026-01-16',5,'15:00-16:00',5,1,1,'2026-01-10 08:17:06','2026-01-16 06:56:48'),(54,2,'2026-01-16',5,'16:00-17:00',5,1,1,'2026-01-10 08:17:07','2026-01-16 07:03:52'),(55,2,'2026-01-19',1,'08:00-09:00',5,1,1,'2026-01-10 08:17:07','2026-01-17 18:30:10'),(56,2,'2026-01-19',1,'09:00-10:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07'),(57,2,'2026-01-19',1,'10:00-11:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07'),(58,2,'2026-01-19',1,'11:00-12:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07'),(59,2,'2026-01-19',1,'12:00-13:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07'),(60,2,'2026-01-19',1,'13:00-14:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07'),(61,2,'2026-01-19',1,'14:00-15:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07'),(62,2,'2026-01-19',1,'15:00-16:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07'),(63,2,'2026-01-19',1,'16:00-17:00',5,0,1,'2026-01-10 08:17:07','2026-01-10 08:17:07');

--
-- Table structure for table `audit_events`
--

CREATE TABLE `audit_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `actor_id` bigint unsigned NOT NULL,
  `entity_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` bigint unsigned NOT NULL,
  `action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `metadata` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `audit_events_entity_type_entity_id_index` (`entity_type`,`entity_id`),
  KEY `audit_events_actor_id_created_at_index` (`actor_id`,`created_at`),
  CONSTRAINT `audit_events_actor_id_foreign` FOREIGN KEY (`actor_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `audit_events`
--

INSERT INTO `audit_events` VALUES (1,10,'change_clinic_request',1,'withdrawn','[]','2026-01-18 06:15:45','2026-01-18 06:15:45');

--
-- Table structure for table `babies`
--

CREATE TABLE `babies` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mother_id` bigint unsigned NOT NULL,
  `year_of_birth` int NOT NULL,
  `month_of_birth` int NOT NULL,
  `pregnancy_outcome` enum('full-term','preterm','miscarriage') COLLATE utf8mb4_unicode_ci NOT NULL,
  `type_of_deliver` enum('Normal','C-section','Forcep','Vacum') COLLATE utf8mb4_unicode_ci NOT NULL,
  `deliver_place` enum('Government Hospital','Private Hospital','Clinic','House') COLLATE utf8mb4_unicode_ci NOT NULL,
  `gender` enum('Boy','Girl') COLLATE utf8mb4_unicode_ci NOT NULL,
  `weight` decimal(5,2) NOT NULL,
  `breastfeeding` enum('Less than 6 months','more than 6 months','1 year - 2 years') COLLATE utf8mb4_unicode_ci NOT NULL,
  `baby_condition` enum('Healty','Unhealthy') COLLATE utf8mb4_unicode_ci NOT NULL,
  `condition_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `babies_mother_id_year_of_birth_month_of_birth_index` (`mother_id`,`year_of_birth`,`month_of_birth`),
  CONSTRAINT `babies_mother_id_foreign` FOREIGN KEY (`mother_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `babies`
--

INSERT INTO `babies` VALUES (1,10,2024,12,'full-term','C-section','Government Hospital','Boy',3.70,'more than 6 months','Healty',NULL,'2026-01-17 18:32:04','2026-01-17 18:32:04');

--
-- Table structure for table `clinic_appointments`
--

CREATE TABLE `clinic_appointments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mother_id` bigint unsigned NOT NULL,
  `clinic_id` bigint unsigned NOT NULL,
  `assigned_nurse_id` bigint unsigned DEFAULT NULL,
  `date` date NOT NULL,
  `slot_label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_at` datetime NOT NULL,
  `end_at` datetime NOT NULL,
  `status` enum('confirmed','cancelled','completed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'confirmed',
  `reminders_sent` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_mother_clinic_slot` (`mother_id`,`clinic_id`,`date`,`slot_label`),
  KEY `clinic_appointments_clinic_id_foreign` (`clinic_id`),
  KEY `clinic_appointments_assigned_nurse_id_foreign` (`assigned_nurse_id`),
  CONSTRAINT `clinic_appointments_assigned_nurse_id_foreign` FOREIGN KEY (`assigned_nurse_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `clinic_appointments_clinic_id_foreign` FOREIGN KEY (`clinic_id`) REFERENCES `clinics` (`id`) ON DELETE CASCADE,
  CONSTRAINT `clinic_appointments_mother_id_foreign` FOREIGN KEY (`mother_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `clinic_appointments`
--

INSERT INTO `clinic_appointments` VALUES (10,10,2,6,'2026-01-13','15:00-16:00','2026-01-13 12:00:00','2026-01-13 13:00:00','cancelled',NULL,'2026-01-13 03:17:53','2026-01-13 03:23:48'),(11,10,2,6,'2026-01-13','14:00-15:00','2026-01-13 13:00:00','2026-01-13 14:00:00','confirmed',NULL,'2026-01-13 03:33:14','2026-01-13 03:34:25'),(12,10,2,6,'2026-01-14','10:00-11:00','2026-01-14 09:00:00','2026-01-14 10:00:00','confirmed',NULL,'2026-01-13 15:36:55','2026-01-14 00:13:24'),(13,10,2,6,'2026-01-15','09:00-10:00','2026-01-15 09:00:00','2026-01-15 10:00:00','confirmed',NULL,'2026-01-14 03:03:05','2026-01-14 03:03:05'),(14,10,2,6,'2026-01-16','16:00-17:00','2026-01-16 16:00:00','2026-01-16 17:00:00','confirmed',NULL,'2026-01-16 06:56:48','2026-01-16 07:03:52'),(15,10,2,6,'2026-01-19','08:00-09:00','2026-01-19 08:00:00','2026-01-19 09:00:00','confirmed',NULL,'2026-01-17 18:30:10','2026-01-17 18:30:10');

--
-- Table structure for table `clinic_change_attachments`
--

CREATE TABLE `clinic_change_attachments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `request_id` bigint unsigned NOT NULL,
  `path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mime_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `size` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `clinic_change_attachments_request_id_index` (`request_id`),
  CONSTRAINT `clinic_change_attachments_request_id_foreign` FOREIGN KEY (`request_id`) REFERENCES `clinic_change_requests` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `clinic_change_attachments`
--


--
-- Table structure for table `clinic_change_messages`
--

CREATE TABLE `clinic_change_messages` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `request_id` bigint unsigned NOT NULL,
  `author_id` bigint unsigned NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `clinic_change_messages_author_id_foreign` (`author_id`),
  KEY `clinic_change_messages_request_id_created_at_index` (`request_id`,`created_at`),
  CONSTRAINT `clinic_change_messages_author_id_foreign` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `clinic_change_messages_request_id_foreign` FOREIGN KEY (`request_id`) REFERENCES `clinic_change_requests` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `clinic_change_messages`
--


--
-- Table structure for table `clinic_change_requests`
--

CREATE TABLE `clinic_change_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `current_clinic_id` bigint unsigned NOT NULL,
  `requested_clinic_id` bigint unsigned NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `supporting_documents` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preferred_effective_date` date DEFAULT NULL,
  `urgency` enum('NORMAL','URGENT') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NORMAL',
  `urgency_justification` text COLLATE utf8mb4_unicode_ci,
  `status` enum('DRAFT','PENDING','INFO_REQUESTED','APPROVED','REJECTED','WITHDRAWN') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DRAFT',
  `decision_effective_date` date DEFAULT NULL,
  `decision_note` text COLLATE utf8mb4_unicode_ci,
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `reviewed_by_old` bigint unsigned DEFAULT NULL,
  `reviewed_at_old` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `decision_by` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_pending_request` (`user_id`),
  UNIQUE KEY `clinic_change_requests_uuid_unique` (`uuid`),
  KEY `clinic_change_requests_current_clinic_id_foreign` (`current_clinic_id`),
  KEY `clinic_change_requests_requested_clinic_id_foreign` (`requested_clinic_id`),
  KEY `clinic_change_requests_reviewed_by_foreign` (`reviewed_by_old`),
  KEY `clinic_change_requests_decision_by_foreign` (`decision_by`),
  KEY `idx_user_status` (`user_id`,`status`),
  KEY `idx_user_active_requests` (`user_id`,`status`),
  CONSTRAINT `clinic_change_requests_current_clinic_id_foreign` FOREIGN KEY (`current_clinic_id`) REFERENCES `clinics` (`id`) ON DELETE CASCADE,
  CONSTRAINT `clinic_change_requests_decision_by_foreign` FOREIGN KEY (`decision_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `clinic_change_requests_requested_clinic_id_foreign` FOREIGN KEY (`requested_clinic_id`) REFERENCES `clinics` (`id`) ON DELETE CASCADE,
  CONSTRAINT `clinic_change_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by_old`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `clinic_change_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `clinic_change_requests`
--

INSERT INTO `clinic_change_requests` VALUES (1,'a0bd7ce7-1f70-424e-a1a8-c11f33a49055',10,2,5,'saya kerja nii',NULL,'2026-01-19','NORMAL','','WITHDRAWN',NULL,NULL,NULL,NULL,NULL,'2026-01-14 00:18:46','2026-01-18 06:15:45',NULL);

--
-- Table structure for table `clinics`
--

CREATE TABLE `clinics` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lat` decimal(10,8) DEFAULT NULL,
  `lng` decimal(11,8) DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `clinics`
--

INSERT INTO `clinics` VALUES (1,'Klinik Kesihatan Indera Mahkota',3.82000000,103.31000000,'Jalan IM 7/1, Bandar Indera Mahkota, 25200 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(2,'Klinik Kesihatan Paya Besar',3.78623000,103.23334000,'Taman Pandan Damai, 25150 Kuantan, Pahang',1,'2026-01-07 15:59:20','2026-01-16 15:25:09'),(3,'Klinik Kesihatan Kurnia',3.81000000,103.32000000,'Jalan Kurnia 1, Taman Kurnia Jaya, 25300 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(4,'Klinik Kesihatan Permatang Badak',3.78000000,103.33000000,'Jalan Permatang Badak, Kampung Permatang Badak, 25200 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(5,'Klinik Kesihatan Kuantan',3.80770000,103.32600000,'Jalan Mahkota, Pusat Bandar Kuantan, 25000 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(6,'Klinik Kesihatan Bukit Goh (Felda)',3.77000000,103.35000000,'Felda Bukit Goh, Jalan Felda Bukit Goh, 26050 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(7,'Klinik Kesihatan Jaya Gading',3.83000000,103.30000000,'Jalan Jaya Gading 1/1, Taman Jaya Gading, 25200 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(8,'Klinik Kesihatan Sungai Lembing',3.92000000,103.43000000,'Jalan Besar Sungai Lembing, 26200 Sungai Lembing, Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(9,'Klinik Kesihatan Balok',3.97000000,103.39000000,'Jalan Pantai Balok, Kampung Balok, 26100 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(10,'Klinik Kesihatan Beserah',3.95000000,103.42000000,'Jalan Beserah, Kampung Beserah, 26100 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20'),(11,'Klinik Kesihatan Gambang',3.71000000,103.12000000,'Jalan Gambang, Pekan Gambang, 26300 Kuantan, Pahang Darul Makmur, Malaysia',1,'2026-01-07 15:59:20','2026-01-07 15:59:20');

--
-- Table structure for table `color_code_histories`
--

CREATE TABLE `color_code_histories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mother_id` bigint unsigned NOT NULL,
  `color_code` enum('red','yellow','green','white') COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `pic_id` bigint unsigned NOT NULL,
  `pic_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `changed_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `color_code_histories_mother_id_changed_at_index` (`mother_id`,`changed_at`),
  KEY `color_code_histories_color_code_index` (`color_code`),
  KEY `color_code_histories_pic_id_index` (`pic_id`),
  CONSTRAINT `color_code_histories_mother_id_foreign` FOREIGN KEY (`mother_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `color_code_histories_pic_id_foreign` FOREIGN KEY (`pic_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `color_code_histories`
--

INSERT INTO `color_code_histories` VALUES (1,10,'green','darah tinggi sikit',6,'PHN Kasimas binti Hussin','2026-01-13 05:38:40','2026-01-13 05:38:40','2026-01-13 05:38:40'),(2,10,'red','ibu pengsan',6,'PHN Kasimas binti Hussin','2026-01-14 02:41:04','2026-01-14 02:41:04','2026-01-14 02:41:04');

--
-- Table structure for table `email_notifications`
--

CREATE TABLE `email_notifications` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `appointment_id` bigint unsigned NOT NULL,
  `type` enum('confirmation','reminder_7d','reminder_1d','cancellation','reschedule') COLLATE utf8mb4_unicode_ci NOT NULL,
  `scheduled_for` timestamp NOT NULL,
  `status` enum('pending','sent','failed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `email_notifications_appointment_id_type_index` (`appointment_id`,`type`),
  KEY `email_notifications_scheduled_for_status_index` (`scheduled_for`,`status`),
  CONSTRAINT `email_notifications_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `clinic_appointments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `email_notifications`
--

INSERT INTO `email_notifications` VALUES (19,10,'confirmation','2026-01-13 03:17:53','sent',NULL,'2026-01-13 03:17:53','2026-01-13 03:17:53'),(20,10,'reminder_7d','2026-01-06 04:00:00','failed','Appointment cancelled or not found','2026-01-13 03:17:53','2026-01-13 03:31:58'),(21,10,'reminder_1d','2026-01-12 04:00:00','failed','Appointment cancelled or not found','2026-01-13 03:17:53','2026-01-13 03:31:58'),(22,10,'reschedule','2026-01-13 03:23:09','sent',NULL,'2026-01-13 03:23:09','2026-01-13 03:23:09'),(23,10,'reschedule','2026-01-13 03:23:38','sent',NULL,'2026-01-13 03:23:38','2026-01-13 03:23:38'),(24,10,'cancellation','2026-01-13 03:23:48','sent',NULL,'2026-01-13 03:23:48','2026-01-13 03:23:48'),(25,11,'confirmation','2026-01-13 03:33:14','sent',NULL,'2026-01-13 03:33:14','2026-01-13 03:33:14'),(26,11,'reminder_7d','2026-01-06 05:00:00','sent',NULL,'2026-01-13 03:33:14','2026-01-13 03:33:18'),(27,11,'reminder_1d','2026-01-12 05:00:00','sent',NULL,'2026-01-13 03:33:14','2026-01-13 03:33:18'),(28,11,'reschedule','2026-01-13 03:34:25','sent',NULL,'2026-01-13 03:34:25','2026-01-13 03:34:25'),(29,12,'confirmation','2026-01-13 15:36:55','sent',NULL,'2026-01-13 15:36:55','2026-01-13 15:36:55'),(30,12,'reminder_7d','2026-01-07 01:00:00','sent',NULL,'2026-01-13 15:36:55','2026-01-13 15:37:01'),(31,12,'reminder_1d','2026-01-13 01:00:00','sent',NULL,'2026-01-13 15:36:55','2026-01-13 15:37:01'),(32,12,'reschedule','2026-01-14 00:13:24','sent',NULL,'2026-01-14 00:13:24','2026-01-14 00:13:24'),(33,13,'confirmation','2026-01-14 03:03:05','sent',NULL,'2026-01-14 03:03:05','2026-01-14 03:03:05'),(34,13,'reminder_7d','2026-01-08 01:00:00','sent',NULL,'2026-01-14 03:03:05','2026-01-14 03:03:08'),(35,13,'reminder_1d','2026-01-14 01:00:00','sent',NULL,'2026-01-14 03:03:05','2026-01-14 03:03:08'),(36,14,'confirmation','2026-01-16 06:56:48','sent',NULL,'2026-01-16 06:56:48','2026-01-16 06:56:48'),(37,14,'reminder_7d','2026-01-09 07:00:00','sent',NULL,'2026-01-16 06:56:48','2026-01-16 06:56:54'),(38,14,'reminder_1d','2026-01-15 07:00:00','sent',NULL,'2026-01-16 06:56:48','2026-01-16 06:56:54'),(39,14,'reschedule','2026-01-16 06:58:19','sent',NULL,'2026-01-16 06:58:19','2026-01-16 06:58:19'),(40,14,'cancellation','2026-01-16 06:58:43','sent',NULL,'2026-01-16 06:58:43','2026-01-16 06:58:43'),(41,14,'confirmation','2026-01-16 07:03:52','sent',NULL,'2026-01-16 07:03:52','2026-01-16 07:03:52'),(42,14,'reminder_7d','2026-01-09 08:00:00','sent',NULL,'2026-01-16 07:03:52','2026-01-16 07:03:55'),(43,14,'reminder_1d','2026-01-15 08:00:00','sent',NULL,'2026-01-16 07:03:52','2026-01-16 07:03:55'),(44,15,'confirmation','2026-01-17 18:30:10','sent',NULL,'2026-01-17 18:30:10','2026-01-17 18:30:10'),(45,15,'reminder_7d','2026-01-12 00:00:00','pending',NULL,'2026-01-17 18:30:10','2026-01-17 18:30:10'),(46,15,'reminder_1d','2026-01-18 00:00:00','pending',NULL,'2026-01-17 18:30:10','2026-01-17 18:30:10');

--
-- Table structure for table `expectant_mothers`
--

CREATE TABLE `expectant_mothers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `series_number` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `registration_completed` tinyint(1) NOT NULL DEFAULT '0',
  `zone_assignment_pending` tinyint(1) NOT NULL DEFAULT '0',
  `ic_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mother_full_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ethnicity` enum('Malay','Chinese','Indian','Orang Asli','Kadazan-Dusun','Majau','Murut','Suluk','Iban','Bidayuh','Melanau') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nationality` enum('Malaysian','Foreigner') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nationality_other` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `educational_level` enum('elementary school','secondary school','diploma','bachelor degree','master degree','doctor of philosophy') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `occupation` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `home_address` text COLLATE utf8mb4_unicode_ci,
  `family_home_address` text COLLATE utf8mb4_unicode_ci,
  `work_address` text COLLATE utf8mb4_unicode_ci,
  `postnatal_address` text COLLATE utf8mb4_unicode_ci,
  `husband_full_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `husband_ic_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `husband_occupation` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `husband_work_address` text COLLATE utf8mb4_unicode_ci,
  `husband_phone_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `number_of_fetus` int DEFAULT NULL,
  `number_of_living_children` int DEFAULT NULL,
  `marriage_date` date DEFAULT NULL,
  `menache` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `family_planning_method` tinyint(1) DEFAULT NULL,
  `family_planning_method_specify` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mother_smoking_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `husband_smoking_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tibi_screening_cough` tinyint(1) DEFAULT NULL,
  `mother_diabetes` tinyint(1) NOT NULL DEFAULT '0',
  `mother_hipertension` tinyint(1) NOT NULL DEFAULT '0',
  `mother_allergy` tinyint(1) NOT NULL DEFAULT '0',
  `mother_psychiatry` tinyint(1) NOT NULL DEFAULT '0',
  `mother_asthma` tinyint(1) NOT NULL DEFAULT '0',
  `mother_heart_disease` tinyint(1) NOT NULL DEFAULT '0',
  `mother_tibi` tinyint(1) NOT NULL DEFAULT '0',
  `mother_anemia` tinyint(1) NOT NULL DEFAULT '0',
  `mother_thalasemia` tinyint(1) NOT NULL DEFAULT '0',
  `mother_tiroid` tinyint(1) NOT NULL DEFAULT '0',
  `mother_cancer` tinyint(1) NOT NULL DEFAULT '0',
  `mother_other` tinyint(1) NOT NULL DEFAULT '0',
  `mother_other_specify` text COLLATE utf8mb4_unicode_ci,
  `father_diabetes` tinyint(1) NOT NULL DEFAULT '0',
  `father_hipertension` tinyint(1) NOT NULL DEFAULT '0',
  `father_allergy` tinyint(1) NOT NULL DEFAULT '0',
  `father_psychiatry` tinyint(1) NOT NULL DEFAULT '0',
  `father_asthma` tinyint(1) NOT NULL DEFAULT '0',
  `father_heart_disease` tinyint(1) NOT NULL DEFAULT '0',
  `father_tibi` tinyint(1) NOT NULL DEFAULT '0',
  `father_anemia` tinyint(1) NOT NULL DEFAULT '0',
  `father_thalasemia` tinyint(1) NOT NULL DEFAULT '0',
  `father_tiroid` tinyint(1) NOT NULL DEFAULT '0',
  `father_cancer` tinyint(1) NOT NULL DEFAULT '0',
  `father_other` tinyint(1) NOT NULL DEFAULT '0',
  `father_other_specify` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `avatar_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_color_code` enum('red','yellow','green','white') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'white',
  `clinic_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `expectant_mothers_series_number_unique` (`series_number`),
  KEY `expectant_mothers_user_id_foreign` (`user_id`),
  KEY `expectant_mothers_current_color_code_index` (`current_color_code`),
  KEY `expectant_mothers_clinic_id_foreign` (`clinic_id`),
  CONSTRAINT `expectant_mothers_clinic_id_foreign` FOREIGN KEY (`clinic_id`) REFERENCES `clinics` (`id`) ON DELETE SET NULL,
  CONSTRAINT `expectant_mothers_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;

--
-- Dumping data for table `expectant_mothers`
--

INSERT INTO `expectant_mothers` VALUES (1,10,'82668',1,1,'031219050419','MIRZA RUSYAIDI BIN RAHAMAT','Malay','Malaysian',NULL,'bachelor degree','LECTURER','01123101568','NO. 90, JALAN TAS 22, TAMAN TAS, KUANTAN PAHANG','356 BK10 TAMAN BUKIT KEMPAS','UMPSA GAMBANG','NO. 90, JALAN TAS 22, TAMAN TAS, KUANTAN PAHANG','MUHAMMAD SYAHMI BIN ISMAIL','031019050427','TEACHER','SMK MAT KILAU','0172719784',1,0,'2024-12-19','12',0,NULL,'Non-smoker','Non-smoker',0,0,0,1,0,1,0,0,0,0,0,0,0,NULL,0,0,0,0,1,0,0,0,0,1,0,0,NULL,'2026-01-08 07:17:03','2026-01-17 14:41:50','avatars/MV1IrB54vC7YAQ1bYqSSUnq4snggINXZzbSVU8Ip.jpg','red',2);

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci 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;

--
-- Dumping data for table `failed_jobs`
--


--
-- Table structure for table `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `job_batches`
--


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

CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `jobs` VALUES (50,'default','{\"uuid\":\"6d6cd9b2-d8ba-4c8c-b80b-4260488bff0f\",\"displayName\":\"App\\\\Notifications\\\\AppointmentConfirmation\",\"job\":\"Illuminate\\\\Queue\\\\CallQueuedHandler@call\",\"maxTries\":null,\"maxExceptions\":null,\"failOnTimeout\":false,\"backoff\":null,\"timeout\":null,\"retryUntil\":null,\"data\":{\"commandName\":\"Illuminate\\\\Notifications\\\\SendQueuedNotifications\",\"command\":\"O:48:\\\"Illuminate\\\\Notifications\\\\SendQueuedNotifications\\\":3:{s:11:\\\"notifiables\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":5:{s:5:\\\"class\\\";s:15:\\\"App\\\\Models\\\\User\\\";s:2:\\\"id\\\";a:1:{i:0;i:10;}s:9:\\\"relations\\\";a:0:{}s:10:\\\"connection\\\";s:5:\\\"mysql\\\";s:15:\\\"collectionClass\\\";N;}s:12:\\\"notification\\\";O:41:\\\"App\\\\Notifications\\\\AppointmentConfirmation\\\":2:{s:14:\\\"\\u0000*\\u0000appointment\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":5:{s:5:\\\"class\\\";s:28:\\\"App\\\\Models\\\\ClinicAppointment\\\";s:2:\\\"id\\\";i:15;s:9:\\\"relations\\\";a:1:{i:0;s:6:\\\"mother\\\";}s:10:\\\"connection\\\";s:5:\\\"mysql\\\";s:15:\\\"collectionClass\\\";N;}s:2:\\\"id\\\";s:36:\\\"e876d83c-7bbc-4d5d-a085-1a058c29a552\\\";}s:8:\\\"channels\\\";a:1:{i:0;s:4:\\\"mail\\\";}}\"},\"createdAt\":1768674610,\"delay\":null}',0,NULL,1768674610,1768674610),(51,'default','{\"uuid\":\"9b534f2f-17b9-4340-9bd2-070fe8faf891\",\"displayName\":\"App\\\\Jobs\\\\SendEmailNotification\",\"job\":\"Illuminate\\\\Queue\\\\CallQueuedHandler@call\",\"maxTries\":null,\"maxExceptions\":null,\"failOnTimeout\":false,\"backoff\":null,\"timeout\":null,\"retryUntil\":null,\"data\":{\"commandName\":\"App\\\\Jobs\\\\SendEmailNotification\",\"command\":\"O:30:\\\"App\\\\Jobs\\\\SendEmailNotification\\\":3:{s:20:\\\"\\u0000*\\u0000emailNotification\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":5:{s:5:\\\"class\\\";s:28:\\\"App\\\\Models\\\\EmailNotification\\\";s:2:\\\"id\\\";i:45;s:9:\\\"relations\\\";a:0:{}s:10:\\\"connection\\\";s:5:\\\"mysql\\\";s:15:\\\"collectionClass\\\";N;}s:15:\\\"\\u0000*\\u0000notification\\\";O:37:\\\"App\\\\Notifications\\\\AppointmentReminder\\\":2:{s:14:\\\"\\u0000*\\u0000appointment\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":5:{s:5:\\\"class\\\";s:28:\\\"App\\\\Models\\\\ClinicAppointment\\\";s:2:\\\"id\\\";i:15;s:9:\\\"relations\\\";a:1:{i:0;s:6:\\\"mother\\\";}s:10:\\\"connection\\\";s:5:\\\"mysql\\\";s:15:\\\"collectionClass\\\";N;}s:15:\\\"\\u0000*\\u0000reminderType\\\";s:2:\\\"7d\\\";}s:5:\\\"delay\\\";O:25:\\\"Illuminate\\\\Support\\\\Carbon\\\":3:{s:4:\\\"date\\\";s:26:\\\"2026-01-12 08:00:00.000000\\\";s:13:\\\"timezone_type\\\";i:3;s:8:\\\"timezone\\\";s:17:\\\"Asia\\/Kuala_Lumpur\\\";}}\"},\"createdAt\":1768674610,\"delay\":0}',0,NULL,1768176000,1768674610),(52,'default','{\"uuid\":\"69277f48-81d7-418c-aadb-268a222db9d8\",\"displayName\":\"App\\\\Jobs\\\\SendEmailNotification\",\"job\":\"Illuminate\\\\Queue\\\\CallQueuedHandler@call\",\"maxTries\":null,\"maxExceptions\":null,\"failOnTimeout\":false,\"backoff\":null,\"timeout\":null,\"retryUntil\":null,\"data\":{\"commandName\":\"App\\\\Jobs\\\\SendEmailNotification\",\"command\":\"O:30:\\\"App\\\\Jobs\\\\SendEmailNotification\\\":3:{s:20:\\\"\\u0000*\\u0000emailNotification\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":5:{s:5:\\\"class\\\";s:28:\\\"App\\\\Models\\\\EmailNotification\\\";s:2:\\\"id\\\";i:46;s:9:\\\"relations\\\";a:0:{}s:10:\\\"connection\\\";s:5:\\\"mysql\\\";s:15:\\\"collectionClass\\\";N;}s:15:\\\"\\u0000*\\u0000notification\\\";O:37:\\\"App\\\\Notifications\\\\AppointmentReminder\\\":2:{s:14:\\\"\\u0000*\\u0000appointment\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":5:{s:5:\\\"class\\\";s:28:\\\"App\\\\Models\\\\ClinicAppointment\\\";s:2:\\\"id\\\";i:15;s:9:\\\"relations\\\";a:1:{i:0;s:6:\\\"mother\\\";}s:10:\\\"connection\\\";s:5:\\\"mysql\\\";s:15:\\\"collectionClass\\\";N;}s:15:\\\"\\u0000*\\u0000reminderType\\\";s:2:\\\"1d\\\";}s:5:\\\"delay\\\";O:25:\\\"Illuminate\\\\Support\\\\Carbon\\\":3:{s:4:\\\"date\\\";s:26:\\\"2026-01-18 08:00:00.000000\\\";s:13:\\\"timezone_type\\\";i:3;s:8:\\\"timezone\\\";s:17:\\\"Asia\\/Kuala_Lumpur\\\";}}\"},\"createdAt\":1768674610,\"delay\":19790}',0,NULL,1768694400,1768674610);

--
-- Table structure for table `kick_hiccup_entries`
--

CREATE TABLE `kick_hiccup_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mother_id` bigint unsigned NOT NULL,
  `type` enum('kick','hiccup') COLLATE utf8mb4_unicode_ci NOT NULL,
  `occurred_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kick_hiccup_entries_mother_id_occurred_at_index` (`mother_id`,`occurred_at`),
  KEY `kick_hiccup_entries_mother_id_type_occurred_at_index` (`mother_id`,`type`,`occurred_at`),
  CONSTRAINT `kick_hiccup_entries_mother_id_foreign` FOREIGN KEY (`mother_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kick_hiccup_entries`
--

INSERT INTO `kick_hiccup_entries` VALUES (1,10,'kick','2026-01-08 07:35:56','2026-01-08 07:35:56','2026-01-08 07:35:56',NULL),(2,10,'hiccup','2026-01-08 07:35:56','2026-01-08 07:35:56','2026-01-08 07:35:56',NULL),(3,10,'hiccup','2026-01-08 07:36:04','2026-01-08 07:36:04','2026-01-08 07:36:04',NULL),(4,10,'kick','2026-01-10 05:30:38','2026-01-10 05:30:38','2026-01-10 05:30:38',NULL),(5,10,'hiccup','2026-01-10 05:30:39','2026-01-10 05:30:39','2026-01-10 05:30:39',NULL),(6,10,'hiccup','2026-01-10 05:30:40','2026-01-10 05:30:40','2026-01-10 05:30:40',NULL),(7,10,'kick','2026-01-13 02:52:25','2026-01-13 02:52:25','2026-01-13 02:52:25',NULL),(8,10,'kick','2026-01-13 02:52:27','2026-01-13 02:52:27','2026-01-13 02:52:27',NULL),(9,10,'hiccup','2026-01-13 02:52:28','2026-01-13 02:52:28','2026-01-13 02:52:28',NULL),(10,10,'hiccup','2026-01-13 03:10:27','2026-01-13 03:10:27','2026-01-13 03:10:27',NULL),(11,10,'hiccup','2026-01-13 03:10:28','2026-01-13 03:10:28','2026-01-13 03:10:28',NULL),(12,10,'hiccup','2026-01-13 03:10:28','2026-01-13 03:10:28','2026-01-13 03:10:28',NULL),(13,10,'hiccup','2026-01-13 05:41:17','2026-01-13 05:41:17','2026-01-13 05:41:17',NULL),(14,10,'kick','2026-01-14 00:15:04','2026-01-14 00:15:04','2026-01-14 00:15:04',NULL),(15,10,'hiccup','2026-01-14 00:15:05','2026-01-14 00:15:05','2026-01-14 00:15:05',NULL),(16,10,'hiccup','2026-01-14 00:15:07','2026-01-14 00:15:07','2026-01-14 00:15:07',NULL),(17,10,'kick','2026-01-14 03:21:17','2026-01-14 03:21:17','2026-01-14 03:21:17',NULL),(18,10,'kick','2026-01-14 03:21:20','2026-01-14 03:21:20','2026-01-14 03:21:20',NULL),(19,10,'kick','2026-01-14 03:21:43','2026-01-14 03:21:43','2026-01-14 03:21:43',NULL),(20,10,'hiccup','2026-01-14 03:21:44','2026-01-14 03:21:44','2026-01-14 03:21:44',NULL),(21,10,'kick','2026-01-15 05:55:21','2026-01-15 05:55:21','2026-01-15 05:55:21',NULL),(22,10,'hiccup','2026-01-15 05:55:22','2026-01-15 05:55:22','2026-01-15 05:55:22',NULL),(23,10,'kick','2026-01-15 05:55:23','2026-01-15 05:55:23','2026-01-15 05:55:23',NULL),(24,10,'hiccup','2026-01-16 07:08:47','2026-01-16 07:08:47','2026-01-16 07:08:47',NULL),(25,10,'kick','2026-01-16 07:08:48','2026-01-16 07:08:48','2026-01-16 07:08:48',NULL),(26,10,'kick','2026-01-16 07:08:49','2026-01-16 07:08:49','2026-01-16 07:08:49',NULL),(27,10,'kick','2026-01-16 07:08:49','2026-01-16 07:08:49','2026-01-16 07:08:49',NULL),(28,10,'hiccup','2026-01-16 16:02:07','2026-01-16 16:02:07','2026-01-16 16:02:07',NULL),(29,10,'hiccup','2026-01-16 16:16:38','2026-01-16 16:16:38','2026-01-16 16:16:38',NULL),(30,10,'kick','2026-01-16 16:16:51','2026-01-16 16:16:51','2026-01-16 16:16:51',NULL),(31,10,'hiccup','2026-01-16 16:17:58','2026-01-16 16:17:58','2026-01-16 16:17:58',NULL),(32,10,'kick','2026-01-16 16:37:20','2026-01-16 16:37:20','2026-01-16 16:37:20',NULL),(33,10,'kick','2026-01-17 04:09:06','2026-01-17 04:09:06','2026-01-17 04:09:06',NULL),(34,10,'hiccup','2026-01-17 04:36:13','2026-01-17 04:36:13','2026-01-17 04:36:13',NULL),(35,10,'hiccup','2026-01-17 04:36:45','2026-01-17 04:36:45','2026-01-17 04:36:45',NULL),(36,10,'hiccup','2026-01-17 04:39:11','2026-01-17 04:39:11','2026-01-17 04:39:11',NULL),(37,10,'kick','2026-01-17 05:38:47','2026-01-17 05:38:47','2026-01-17 05:38:47',NULL),(38,10,'kick','2026-01-17 06:03:55','2026-01-17 06:03:55','2026-01-17 06:03:55',NULL),(39,10,'kick','2026-01-17 06:44:41','2026-01-17 06:44:41','2026-01-17 06:44:41',NULL),(40,10,'kick','2026-01-17 18:24:22','2026-01-17 18:24:22','2026-01-17 18:24:22',NULL),(41,10,'kick','2026-01-17 18:24:25','2026-01-17 18:24:25','2026-01-17 18:24:25',NULL),(42,10,'kick','2026-01-17 18:24:25','2026-01-17 18:24:25','2026-01-17 18:24:25',NULL),(43,10,'kick','2026-01-17 18:24:25','2026-01-17 18:24:25','2026-01-17 18:24:25',NULL),(44,10,'kick','2026-01-17 18:24:26','2026-01-17 18:24:26','2026-01-17 18:24:26',NULL),(45,10,'kick','2026-01-17 18:24:26','2026-01-17 18:24:26','2026-01-17 18:24:26',NULL),(46,10,'kick','2026-01-17 18:24:26','2026-01-17 18:24:26','2026-01-17 18:24:26',NULL),(47,10,'kick','2026-01-17 18:24:26','2026-01-17 18:24:26','2026-01-17 18:24:26',NULL),(48,10,'kick','2026-01-17 18:24:26','2026-01-17 18:24:26','2026-01-17 18:24:26',NULL),(49,10,'kick','2026-01-17 18:24:26','2026-01-17 18:24:26','2026-01-17 18:24:26',NULL),(50,10,'kick','2026-01-17 18:24:26','2026-01-17 18:24:26','2026-01-17 18:24:26',NULL),(51,10,'hiccup','2026-01-17 18:30:38','2026-01-17 18:30:38','2026-01-17 18:30:38',NULL),(52,10,'hiccup','2026-01-17 18:30:39','2026-01-17 18:30:39','2026-01-17 18:30:39',NULL);

--
-- Table structure for table `maternal_health_records`
--

CREATE TABLE `maternal_health_records` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `expectant_mother_id` bigint unsigned NOT NULL,
  `nurse_id` bigint unsigned DEFAULT NULL,
  `record_date` date NOT NULL,
  `gestational_week` int DEFAULT NULL,
  `weight` decimal(5,2) DEFAULT NULL,
  `blood_pressure` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fundal_height` decimal(4,1) DEFAULT NULL,
  `fetal_heart_rate` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fetal_position` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `symptoms` text COLLATE utf8mb4_unicode_ci,
  `medications` text COLLATE utf8mb4_unicode_ci,
  `recommendations` text COLLATE utf8mb4_unicode_ci,
  `next_appointment_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `clinic_appointment_id` bigint unsigned DEFAULT NULL,
  `status` enum('draft','completed','reviewed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `visit_number` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_clinic_appointment_health_record` (`clinic_appointment_id`),
  KEY `maternal_health_records_nurse_id_foreign` (`nurse_id`),
  KEY `maternal_health_records_expectant_mother_id_record_date_index` (`expectant_mother_id`,`record_date`),
  CONSTRAINT `maternal_health_records_clinic_appointment_id_foreign` FOREIGN KEY (`clinic_appointment_id`) REFERENCES `clinic_appointments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `maternal_health_records_expectant_mother_id_foreign` FOREIGN KEY (`expectant_mother_id`) REFERENCES `expectant_mothers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `maternal_health_records_nurse_id_foreign` FOREIGN KEY (`nurse_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `maternal_health_records`
--

INSERT INTO `maternal_health_records` VALUES (19,1,6,'2026-01-13',24,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-01-13 05:33:08','2026-01-13 05:39:34',NULL,'completed',1),(24,1,6,'2026-01-14',24,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-01-14 01:42:30','2026-01-14 01:42:30',12,'draft',2),(25,1,6,'2026-01-16',24,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-01-16 07:10:49','2026-01-16 07:32:52',14,'completed',3);

--
-- Table structure for table `maternal_test_results`
--

CREATE TABLE `maternal_test_results` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `health_record_id` bigint unsigned NOT NULL,
  `test_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'antenatal_blood, immunization, medical_checkup, etc.',
  `test_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Display name of the test',
  `test_data` json NOT NULL COMMENT 'Flexible JSON structure for each test type',
  `performed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `performed_by_nurse_id` bigint unsigned NOT NULL,
  `signature_data` text COLLATE utf8mb4_unicode_ci COMMENT 'Base64 encoded signature image',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `maternal_test_results_health_record_id_index` (`health_record_id`),
  KEY `maternal_test_results_test_type_index` (`test_type`),
  KEY `maternal_test_results_performed_at_index` (`performed_at`),
  KEY `maternal_test_results_performed_by_nurse_id_index` (`performed_by_nurse_id`),
  CONSTRAINT `maternal_test_results_health_record_id_foreign` FOREIGN KEY (`health_record_id`) REFERENCES `maternal_health_records` (`id`) ON DELETE CASCADE,
  CONSTRAINT `maternal_test_results_performed_by_nurse_id_foreign` FOREIGN KEY (`performed_by_nurse_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `maternal_test_results`
--

INSERT INTO `maternal_test_results` VALUES (6,19,'medical_checkup','Medical Checkup (RME)','{\"bmi\": \"22\", \"height\": \"167\", \"rme1_bp\": \"120/80\", \"rme1_fhr\": \"32\", \"rme1_jvp\": \"Normal\", \"rme1_sfh\": \"24\", \"rme1_date\": \"2026-01-13\", \"rme1_lungs\": \"Normal\", \"rme1_notes\": \"semua okay\", \"rme1_pulse\": \"4\", \"dental_date\": \"2026-01-13\", \"rme1_breast\": \"Normal\", \"rme1_oedema\": \"Tiada\", \"dental_notes\": \"gigi kayy\", \"rme1_abdomen\": \"Normal\", \"rme1_clubbing\": \"Tiada\", \"rme1_jaundice\": \"1\", \"rme1_apex_beat\": \"Normal\", \"rme1_pink_pallor\": \"1\", \"rme1_heart_sounds\": \"Normal\", \"rme1_neck_swelling\": \"4\", \"dental_officer_name\": \"MAHMUD\", \"medical_officer_name\": \"SAMAD\", \"rme1_calf_tenderness\": \"Tiada\", \"dental_officer_signature\": \"data:image/png;base64,[BLOB]\", \"medical_officer_signature\": \"data:image/png;base64,[BLOB]\"}','2026-01-13 05:34:00',6,NULL,'2026-01-13 05:34:00','2026-01-13 05:34:00'),(7,19,'blood_sugar_monitoring','Blood Sugar Monitoring','{\"date\": \"2026-01-13\", \"lunch\": \"5.2\", \"notes\": \"hmmm ok kot\", \"dinner\": \"5.8\", \"pre_bed\": \"4.2\", \"breakfast\": \"4.8\"}','2026-01-13 05:34:21',6,'data:image/png;base64,[BLOB]','2026-01-13 05:34:21','2026-01-13 05:34:21'),(8,19,'blood_pressure_monitoring','Blood Pressure Monitoring','{\"date\": \"2026-01-13\", \"time\": \"14:00\", \"symptoms\": \"pening kepala\", \"urine_protein\": \"+1\", \"blood_pressure\": \"120/80\", \"fetal_heart_rate\": \"140\"}','2026-01-13 05:34:50',6,'data:image/png;base64,[BLOB]','2026-01-13 05:34:50','2026-01-13 05:34:50'),(13,24,'immunization','Immunization Status','{\"immunization\": {\"dos_1\": {\"batch_no\": \"D1398\", \"expiry_date\": \"2027-01-14\", \"injection_date\": \"2026-01-14\"}, \"dos_2\": {\"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}, \"lain_lain_1\": {\"name\": null, \"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}, \"lain_lain_2\": {\"name\": null, \"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}, \"dos_tambahan\": {\"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}}}','2026-01-17 07:28:05',6,'data:image/png;base64,[BLOB]','2026-01-14 02:02:06','2026-01-17 07:28:05'),(14,24,'antenatal_blood','Antenatal Blood Screening','{\"vdrl_tpha\": {\"result_1\": \"Non-Reactive\", \"result_2\": null, \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}, \"hepatitis_b\": {\"result_1\": \"Negatif\", \"result_2\": null, \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}, \"malaria_bfmp\": {\"result_1\": \"Negatif\", \"result_2\": null, \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}, \"hiv_rapid_ibu\": {\"elisa_1\": \"Negatif\", \"result_1\": \"NR\", \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}, \"hiv_rapid_pasangan\": {\"elisa_1\": \"Negatif\", \"result_1\": \"NR\", \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}, \"rhesus_blood_group\": {\"result_1\": \"O+\", \"result_2\": null, \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}, \"syphilis_rapid_ibu\": {\"result_1\": \"NR\", \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}, \"syphilis_rapid_pasangan\": {\"result_1\": \"NR\", \"taken_at_1\": \"2026-01-14\", \"taken_at_2\": null}}','2026-01-17 07:29:32',6,'data:image/png;base64,[BLOB]','2026-01-14 02:03:01','2026-01-17 07:29:32'),(15,25,'immunization','Immunization Status','{\"immunization\": {\"dos_1\": {\"batch_no\": \"D1398\", \"expiry_date\": \"2027-01-31\", \"injection_date\": \"2026-01-16\"}, \"dos_2\": {\"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}, \"lain_lain_1\": {\"name\": null, \"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}, \"lain_lain_2\": {\"name\": null, \"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}, \"dos_tambahan\": {\"batch_no\": null, \"expiry_date\": null, \"injection_date\": null}}}','2026-01-16 07:11:12',6,'data:image/png;base64,[BLOB]','2026-01-16 07:11:12','2026-01-16 07:11:12'),(16,25,'antenatal_blood','Antenatal Blood Screening','{\"vdrl_tpha\": {\"result_1\": \"A+\", \"result_2\": null, \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}, \"hepatitis_b\": {\"result_1\": \"A-\", \"result_2\": null, \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}, \"malaria_bfmp\": {\"result_1\": \"A+\", \"result_2\": null, \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}, \"hiv_rapid_ibu\": {\"elisa_1\": \"Negatif\", \"result_1\": \"NR\", \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}, \"hiv_rapid_pasangan\": {\"elisa_1\": \"Negatif\", \"result_1\": \"NR\", \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}, \"rhesus_blood_group\": {\"result_1\": \"A+\", \"result_2\": null, \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}, \"syphilis_rapid_ibu\": {\"result_1\": \"NR\", \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}, \"syphilis_rapid_pasangan\": {\"result_1\": \"NR\", \"taken_at_1\": \"2026-01-16\", \"taken_at_2\": null}}','2026-01-16 07:11:54',6,'data:image/png;base64,[BLOB]','2026-01-16 07:11:54','2026-01-16 07:11:54'),(17,25,'medical_checkup','Medical Checkup (RME)','{\"bmi\": null, \"height\": null, \"rme1_bp\": \"120/80\", \"rme1_fhr\": \"32\", \"rme1_jvp\": \"Normal\", \"rme1_sfh\": \"24\", \"rme1_date\": \"2026-01-16\", \"rme1_lungs\": \"Normal\", \"rme1_notes\": \"okkk\", \"rme1_pulse\": \"4\", \"dental_date\": \"2026-01-16\", \"rme1_breast\": \"Normal\", \"rme1_oedema\": \"Tiada\", \"dental_notes\": \"sihat\", \"rme1_abdomen\": \"Normal\", \"rme1_clubbing\": \"Tiada\", \"rme1_jaundice\": \"1\", \"rme1_apex_beat\": \"Normal\", \"rme1_pink_pallor\": \"1\", \"rme1_heart_sounds\": \"Normal\", \"rme1_neck_swelling\": \"5\", \"dental_officer_name\": \"MAHMUD\", \"medical_officer_name\": \"SAMAD\", \"rme1_calf_tenderness\": \"Tiada\", \"dental_officer_signature\": \"data:image/png;base64,[BLOB]\", \"medical_officer_signature\": \"data:image/png;base64,[BLOB]\"}','2026-01-16 07:12:43',6,NULL,'2026-01-16 07:12:43','2026-01-16 07:12:43'),(18,25,'ogtt','OGTT Screening','{\"fbs\": \"4.8\", \"pog\": \"24\", \"2hpp\": \"7.3\", \"date\": \"2026-01-16\", \"criteria\": {\"age_over_25\": \"1\", \"bmi_over_27\": \"1\"}}','2026-01-16 07:13:02',6,'data:image/png;base64,[BLOB]','2026-01-16 07:13:02','2026-01-16 07:13:02'),(19,25,'blood_sugar_monitoring','Blood Sugar Monitoring','{\"date\": \"2026-01-16\", \"lunch\": \"5.2\", \"notes\": \"sihattt\", \"dinner\": \"5.8\", \"pre_bed\": \"4.2\", \"breakfast\": \"4.8\"}','2026-01-16 07:13:32',6,'data:image/png;base64,[BLOB]','2026-01-16 07:13:32','2026-01-16 07:13:32'),(20,25,'blood_pressure_monitoring','Blood Pressure Monitoring','{\"date\": \"2026-01-16\", \"time\": \"16:00\", \"symptoms\": \"sihattt\", \"urine_protein\": \"+1\", \"blood_pressure\": \"120/80\", \"fetal_heart_rate\": \"140\"}','2026-01-16 07:13:55',6,'data:image/png;base64,[BLOB]','2026-01-16 07:13:55','2026-01-16 07:13:55'),(21,25,'pre_eclampsia','Pre-Eclampsia Profile','{\"bp\": \"140/80\", \"date\": \"2026-01-16\", \"urea\": \"4\", \"ast_alt\": \"25,30\", \"poa_pog\": \"28\", \"platelet\": \"300\", \"uric_acid\": \"200\", \"creatinine\": \"80\", \"hemoglobin\": \"12.5\", \"proteinuria\": \"+1\", \"additional_notes\": \"sihatt\"}','2026-01-16 07:14:59',6,'data:image/png;base64,[BLOB]','2026-01-16 07:14:59','2026-01-16 07:14:59'),(22,25,'weight_monitoring','Weight Monitoring (GWG)','{\"bmi\": \"28.7\", \"date\": \"2026-01-16\", \"height\": \"167\", \"weight\": \"65\", \"bmi_status\": \"overweight\", \"weight_gain\": \"5\", \"additional_notes\": \"okayy\", \"gestational_week\": \"24\", \"weight_gain_rate\": \"0.5\", \"pre_pregnancy_weight\": \"80\"}','2026-01-16 07:15:48',6,'data:image/png;base64,[BLOB]','2026-01-16 07:15:48','2026-01-16 07:15:48'),(23,25,'ultrasound_examination','Ultrasound Examination','{\"ac\": \"28.2\", \"fl\": \"6.8\", \"hc\": \"30.5\", \"afi\": \"12.5\", \"bpd\": \"7.6\", \"crl\": \"5.2\", \"edd\": \"2026-01-26\", \"date\": \"2026-01-16\", \"redd\": \"2026-01-31\", \"fh_fm\": \"40/80\", \"remarks\": \"okkkk\", \"placenta\": \"fundal\", \"presentation\": \"breech\", \"estimated_fetal_weight\": \"2400\"}','2026-01-16 07:17:05',6,'data:image/png;base64,[BLOB]','2026-01-16 07:17:05','2026-01-16 07:17:05'),(24,25,'antenatal_color_code','Antenatal Color Code','{\"color_code\": \"merah\", \"red_tarikh\": null, \"red_poa_pog\": null, \"green_tarikh\": null, \"white_tarikh\": null, \"green_poa_pog\": null, \"red_risk_01_2\": \"1\", \"red_risk_05_2\": \"1\", \"red_risk_13_2\": \"1\", \"red_risk_16_2\": \"1\", \"white_poa_pog\": null, \"yellow_tarikh\": null, \"yellow_poa_pog\": null, \"home_birth_date\": null, \"additional_notes\": \"ibu sakit\"}','2026-01-16 07:17:39',6,'data:image/png;base64,[BLOB]','2026-01-16 07:17:39','2026-01-16 07:17:39'),(25,25,'vte_risk_assessment','VTE Risk Assessment','{\"vte_data\": {\"additional_notes\": \"sihat kot\", \"previous_vte_pre\": \"1\", \"family_history_vte_pre\": \"1\", \"ivf_first_trimester_pre\": \"1\", \"long_distance_travel_pre\": \"1\"}, \"assessment_date\": \"2026-01-16\"}','2026-01-16 07:18:19',6,'data:image/png;base64,[BLOB]','2026-01-16 07:18:19','2026-01-16 07:18:19'),(26,25,'antenatal_visits','Antenatal Visits','{\"bp\": \"140/80\", \"lk\": \"32.5\", \"lr\": \"28.5\", \"nadi\": \"70\", \"edema\": \"+\", \"gerak\": \"normal\", \"hb_gdl\": \"13\", \"tarikh\": \"2026-01-16\", \"jantung\": \"140\", \"berat_kg\": \"65.5\", \"booking_bp\": \"120/80\", \"presentasi\": \"breech\", \"urin_sugar\": \"+\", \"booking_bmi\": \"22.5\", \"urin_protein\": \"+\", \"booking_weight\": \"70\", \"tinggi_rahim_cm\": \"29\", \"additional_notes\": \"okayy\", \"tempoh_hamil_minggu\": \"26\"}','2026-01-16 07:19:10',6,'data:image/png;base64,[BLOB]','2026-01-16 07:19:10','2026-01-16 07:19:10'),(27,24,'medical_checkup','Medical Checkup (RME)','{\"bmi\": \"24\", \"height\": \"167\", \"rme1_bp\": \"118/76\", \"rme1_fhr\": \"145\", \"rme1_jvp\": \"Normal\", \"rme1_sfh\": \"24\", \"rme1_date\": \"2026-01-14\", \"rme1_lungs\": \"Normal\", \"rme1_notes\": \"sihat\", \"rme1_pulse\": \"82\", \"dental_date\": \"2026-01-14\", \"rme1_breast\": \"Normal\", \"rme1_oedema\": \"Tiada\", \"dental_notes\": \"semua okay\", \"rme1_abdomen\": \"Normal\", \"rme1_clubbing\": \"Tiada\", \"rme1_jaundice\": \"Tiada\", \"rme1_apex_beat\": \"Normal\", \"rme1_pink_pallor\": \"Pink\", \"rme1_heart_sounds\": \"Normal\", \"rme1_neck_swelling\": \"Tiada\", \"dental_officer_name\": \"MAHMUD\", \"medical_officer_name\": \"SAMAD\", \"rme1_calf_tenderness\": \"Tiada\", \"dental_officer_signature\": \"data:image/png;base64,[BLOB]\", \"medical_officer_signature\": \"data:image/png;base64,[BLOB]\"}','2026-01-17 07:31:39',6,NULL,'2026-01-17 07:31:39','2026-01-17 07:31:39'),(28,24,'ogtt','OGTT Screening','{\"fbs\": \"4.4\", \"pog\": \"25\", \"2hpp\": \"6.2\", \"date\": \"2026-01-14\", \"criteria\": {\"age_over_25\": \"1\"}}','2026-01-17 07:33:17',6,NULL,'2026-01-17 07:33:10','2026-01-17 07:33:17'),(29,24,'blood_sugar_monitoring','Blood Sugar Monitoring','{\"date\": \"2026-01-14\", \"lunch\": \"6.5\", \"notes\": \"bacaan kurang memuaskan\", \"dinner\": \"6.5\", \"pre_bed\": \"5.3\", \"breakfast\": \"5.0\"}','2026-01-17 07:35:20',6,'data:image/png;base64,[BLOB]','2026-01-17 07:35:20','2026-01-17 07:35:20'),(30,24,'blood_pressure_monitoring','Blood Pressure Monitoring','{\"date\": null, \"time\": null, \"symptoms\": null, \"urine_protein\": null, \"blood_pressure\": null, \"fetal_heart_rate\": null}','2026-01-17 07:36:29',6,NULL,'2026-01-17 07:36:29','2026-01-17 07:36:29');

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

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=70 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,'2025_09_08_043220_create_expectant_mothers_table',1),(5,'2025_09_08_043302_create_color_codes_table',1),(6,'2025_09_08_043325_create_appointments_table',1),(7,'2025_09_08_043352_create_maternal_health_records_table',1),(8,'2025_09_08_043413_create_kick_hiccup_trackers_table',1),(9,'2025_09_08_135856_create_clinics_table',1),(10,'2025_09_08_140048_create_clinic_appointments_table',1),(11,'2025_09_08_140059_create_whats_app_notifications_table',1),(12,'2025_09_09_030023_create_kick_hiccup_entries_table',1),(13,'2025_09_09_034756_create_babies_table',1),(14,'2025_09_09_034855_add_avatar_url_to_expectant_mothers_table',1),(15,'2025_09_09_081256_add_current_color_code_to_expectant_mothers_table',1),(16,'2025_09_09_081315_create_color_code_histories_table',1),(17,'2025_09_12_030425_create_maternal_records_table',1),(18,'2025_09_12_030435_create_maternal_record_tests_table',1),(19,'2025_09_12_070812_add_immunization_to_maternal_records_table',1),(20,'2025_09_13_025928_add_medical_checkup_to_maternal_records_table',1),(21,'2025_09_13_033957_add_ogtt_screening_to_maternal_records_table',1),(22,'2025_09_13_034900_add_blood_sugar_monitoring_to_maternal_records_table',1),(23,'2025_09_13_040059_add_blood_pressure_monitoring_to_maternal_records_table',1),(24,'2025_09_13_045120_add_weight_monitoring_to_maternal_records_table',1),(25,'2025_09_18_094356_add_hemoglobin_monitoring_to_maternal_records_table',1),(26,'2025_09_18_100923_add_ultrasound_examination_to_maternal_records_table',1),(27,'2025_09_18_110950_add_antenatal_color_code_to_maternal_records_table',1),(28,'2025_09_18_132311_add_vte_risk_assessment_to_maternal_records_table',1),(29,'2025_09_18_134610_create_antenatal_visits_table',1),(30,'2025_09_22_132412_add_clinic_assignment_to_users_table',1),(31,'2025_09_22_132501_create_appointment_quotas_table',1),(32,'2025_09_22_132535_create_nurse_shifts_table',1),(33,'2025_09_22_132614_modify_appointments_table_for_workflow',1),(34,'2025_09_22_132652_add_clinic_id_to_expectant_mothers_table',1),(35,'2025_09_22_142056_add_status_and_password_fields_to_users_table',1),(36,'2025_09_24_023254_create_clinic_change_requests_table',1),(37,'2025_09_24_040208_enhance_clinic_change_requests_table',1),(38,'2025_09_24_040254_create_clinic_change_attachments_table',1),(39,'2025_09_24_040403_create_clinic_change_messages_table',1),(40,'2025_09_24_040434_create_audit_events_table',1),(41,'2025_09_24_155042_add_unique_active_clinic_change_request_constraint',1),(42,'2025_10_04_031541_add_phone_to_users_table',1),(43,'2025_10_05_150000_create_zones_table',1),(44,'2025_10_05_150001_create_nurse_zone_table',1),(45,'2025_10_05_150002_create_mother_assignment_table',1),(46,'2025_10_05_150003_create_zone_change_logs_table',1),(47,'2025_10_05_160000_add_clinic_admin_role',1),(48,'2025_10_06_000001_update_appointment_quotas_for_time_slots',1),(49,'2025_10_08_004231_add_time_slot_to_appointments_table',1),(50,'2025_10_08_182616_add_coverage_areas_to_zones_table',1),(51,'2025_10_08_220000_add_coverage_areas_to_nurse_zone_table',1),(52,'2025_10_17_161856_add_zone_assignment_pending_to_expectant_mothers_table',1),(53,'2025_10_17_180513_remove_nurse_id_from_appointment_quotas_table',1),(54,'2025_10_17_231144_add_assigned_nurse_id_to_clinic_appointments_table',1),(55,'2025_10_18_065040_create_nurse_duties_table',1),(56,'2025_10_24_120000_create_nurse_duty_history_table',1),(57,'2025_10_31_000001_add_language_preference_to_users_table',1),(58,'2025_11_06_111116_add_clinic_appointment_id_to_maternal_health_records_table',1),(59,'2025_11_06_113427_add_unique_constraint_to_clinic_appointment_id_in_maternal_health_records',1),(60,'2025_11_07_000002_create_maternal_test_results_table',1),(61,'2025_12_01_164125_add_last_login_at_to_users_table',1),(62,'2025_12_04_154024_create_email_notifications_table',1),(63,'2025_12_04_155549_drop_whats_app_notifications_table',1),(64,'2026_01_04_132802_add_reminders_sent_to_clinic_appointments_table',1),(65,'2026_01_04_211530_create_daily_health_checkins_table',1),(66,'2026_01_05_000000_migrate_maternal_records_to_new_system',1),(67,'2026_01_05_232011_drop_old_unused_tables',1),(68,'2026_01_13_133732_add_status_and_visit_number_to_maternal_health_records',2),(69,'2026_01_18_142427_add_supporting_documents_to_clinic_change_requests_table',3);

--
-- Table structure for table `mother_assignment`
--

CREATE TABLE `mother_assignment` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mother_id` bigint unsigned NOT NULL,
  `zone_id` bigint unsigned NOT NULL,
  `nurse_id` bigint unsigned DEFAULT NULL,
  `assigned_at` timestamp NOT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `assignment_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'auto',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mother_assignment_mother_id_ended_at_index` (`mother_id`,`ended_at`),
  KEY `mother_assignment_zone_id_ended_at_index` (`zone_id`,`ended_at`),
  KEY `mother_assignment_nurse_id_ended_at_index` (`nurse_id`,`ended_at`),
  CONSTRAINT `mother_assignment_mother_id_foreign` FOREIGN KEY (`mother_id`) REFERENCES `expectant_mothers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `mother_assignment_nurse_id_foreign` FOREIGN KEY (`nurse_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `mother_assignment_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `mother_assignment`
--

INSERT INTO `mother_assignment` VALUES (1,1,1,6,'2026-01-13 04:00:31',NULL,'initial','','2026-01-13 02:40:44','2026-01-13 04:00:31');

--
-- Table structure for table `nurse_duties`
--

CREATE TABLE `nurse_duties` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nurse_id` bigint unsigned NOT NULL,
  `zone_id` bigint unsigned NOT NULL,
  `clinic_id` bigint unsigned NOT NULL,
  `duty_date` date NOT NULL,
  `day_of_week` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `nurse_duties_nurse_id_zone_id_duty_date_unique` (`nurse_id`,`zone_id`,`duty_date`),
  KEY `nurse_duties_zone_id_foreign` (`zone_id`),
  KEY `nurse_duties_created_by_foreign` (`created_by`),
  KEY `nurse_duties_clinic_id_duty_date_index` (`clinic_id`,`duty_date`),
  KEY `nurse_duties_nurse_id_duty_date_index` (`nurse_id`,`duty_date`),
  CONSTRAINT `nurse_duties_clinic_id_foreign` FOREIGN KEY (`clinic_id`) REFERENCES `clinics` (`id`) ON DELETE CASCADE,
  CONSTRAINT `nurse_duties_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `nurse_duties_nurse_id_foreign` FOREIGN KEY (`nurse_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `nurse_duties_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `nurse_duties`
--

INSERT INTO `nurse_duties` VALUES (7,6,1,2,'2026-01-12','Monday',2,'2026-01-17 19:08:30','2026-01-17 19:08:30'),(8,6,1,2,'2026-01-13','Tuesday',2,'2026-01-17 19:08:30','2026-01-17 19:08:30'),(9,6,1,2,'2026-01-19','Monday',2,'2026-01-17 19:45:26','2026-01-17 19:45:26'),(10,6,1,2,'2026-01-20','Tuesday',2,'2026-01-17 19:45:26','2026-01-17 19:45:26'),(11,6,1,2,'2026-01-21','Wednesday',2,'2026-01-17 19:45:26','2026-01-17 19:45:26'),(12,6,4,2,'2026-01-22','Thursday',2,'2026-01-17 19:45:26','2026-01-17 19:45:26');

--
-- Table structure for table `nurse_duty_history`
--

CREATE TABLE `nurse_duty_history` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nurse_id` bigint unsigned NOT NULL,
  `zone_id` bigint unsigned NOT NULL,
  `clinic_id` bigint unsigned NOT NULL,
  `duty_date` date NOT NULL,
  `day_of_week` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` enum('created','updated','deleted') COLLATE utf8mb4_unicode_ci NOT NULL,
  `performed_by` bigint unsigned NOT NULL,
  `old_values` json DEFAULT NULL,
  `new_values` json DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `performed_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `nurse_duty_history_performed_by_foreign` (`performed_by`),
  KEY `nurse_duty_history_clinic_id_performed_at_index` (`clinic_id`,`performed_at`),
  KEY `nurse_duty_history_nurse_id_performed_at_index` (`nurse_id`,`performed_at`),
  KEY `nurse_duty_history_zone_id_performed_at_index` (`zone_id`,`performed_at`),
  KEY `nurse_duty_history_duty_date_performed_at_index` (`duty_date`,`performed_at`),
  CONSTRAINT `nurse_duty_history_clinic_id_foreign` FOREIGN KEY (`clinic_id`) REFERENCES `clinics` (`id`) ON DELETE CASCADE,
  CONSTRAINT `nurse_duty_history_nurse_id_foreign` FOREIGN KEY (`nurse_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `nurse_duty_history_performed_by_foreign` FOREIGN KEY (`performed_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `nurse_duty_history_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `nurse_duty_history`
--

INSERT INTO `nurse_duty_history` VALUES (1,6,1,2,'2026-01-12','Monday','created',2,NULL,'{\"id\": 1, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-11T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:00:48.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:00:48.000000Z\", \"day_of_week\": \"Monday\"}',NULL,'2026-01-17 19:00:48','2026-01-17 19:00:48','2026-01-17 19:00:48'),(2,6,1,2,'2026-01-13','Tuesday','created',2,NULL,'{\"id\": 2, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-12T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:00:48.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:00:48.000000Z\", \"day_of_week\": \"Tuesday\"}',NULL,'2026-01-17 19:00:48','2026-01-17 19:00:48','2026-01-17 19:00:48'),(3,6,1,2,'2026-01-14','Wednesday','created',2,NULL,'{\"id\": 3, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-13T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:00:48.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:00:48.000000Z\", \"day_of_week\": \"Wednesday\"}',NULL,'2026-01-17 19:00:48','2026-01-17 19:00:48','2026-01-17 19:00:48'),(4,6,1,2,'2026-01-12','Monday','created',2,NULL,'{\"id\": 4, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-11T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:05:31.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:05:31.000000Z\", \"day_of_week\": \"Monday\"}',NULL,'2026-01-17 19:05:31','2026-01-17 19:05:31','2026-01-17 19:05:31'),(5,6,1,2,'2026-01-13','Tuesday','created',2,NULL,'{\"id\": 5, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-12T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:05:31.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:05:31.000000Z\", \"day_of_week\": \"Tuesday\"}',NULL,'2026-01-17 19:05:31','2026-01-17 19:05:31','2026-01-17 19:05:31'),(6,6,1,2,'2026-01-14','Wednesday','created',2,NULL,'{\"id\": 6, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-13T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:05:31.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:05:31.000000Z\", \"day_of_week\": \"Wednesday\"}',NULL,'2026-01-17 19:05:31','2026-01-17 19:05:31','2026-01-17 19:05:31'),(7,6,1,2,'2026-01-12','Monday','created',2,NULL,'{\"id\": 7, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-11T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:08:30.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:08:30.000000Z\", \"day_of_week\": \"Monday\"}',NULL,'2026-01-17 19:08:30','2026-01-17 19:08:30','2026-01-17 19:08:30'),(8,6,1,2,'2026-01-13','Tuesday','created',2,NULL,'{\"id\": 8, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-12T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:08:30.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:08:30.000000Z\", \"day_of_week\": \"Tuesday\"}',NULL,'2026-01-17 19:08:30','2026-01-17 19:08:30','2026-01-17 19:08:30'),(9,6,1,2,'2026-01-19','Monday','created',2,NULL,'{\"id\": 9, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-18T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:45:26.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:45:26.000000Z\", \"day_of_week\": \"Monday\"}',NULL,'2026-01-17 19:45:26','2026-01-17 19:45:26','2026-01-17 19:45:26'),(10,6,1,2,'2026-01-20','Tuesday','created',2,NULL,'{\"id\": 10, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-19T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:45:26.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:45:26.000000Z\", \"day_of_week\": \"Tuesday\"}',NULL,'2026-01-17 19:45:26','2026-01-17 19:45:26','2026-01-17 19:45:26'),(11,6,1,2,'2026-01-21','Wednesday','created',2,NULL,'{\"id\": 11, \"zone_id\": 1, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-20T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:45:26.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:45:26.000000Z\", \"day_of_week\": \"Wednesday\"}',NULL,'2026-01-17 19:45:26','2026-01-17 19:45:26','2026-01-17 19:45:26'),(12,6,4,2,'2026-01-22','Thursday','created',2,NULL,'{\"id\": 12, \"zone_id\": 4, \"nurse_id\": 6, \"clinic_id\": 2, \"duty_date\": \"2026-01-21T16:00:00.000000Z\", \"created_at\": \"2026-01-17T19:45:26.000000Z\", \"created_by\": 2, \"updated_at\": \"2026-01-17T19:45:26.000000Z\", \"day_of_week\": \"Thursday\"}',NULL,'2026-01-17 19:45:26','2026-01-17 19:45:26','2026-01-17 19:45:26');

--
-- Table structure for table `nurse_zone`
--

CREATE TABLE `nurse_zone` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nurse_id` bigint unsigned NOT NULL,
  `zone_id` bigint unsigned NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `coverage_areas` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `nurse_zone_zone_id_foreign` (`zone_id`),
  KEY `nurse_zone_nurse_id_zone_id_end_date_index` (`nurse_id`,`zone_id`,`end_date`),
  CONSTRAINT `nurse_zone_nurse_id_foreign` FOREIGN KEY (`nurse_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `nurse_zone_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `nurse_zone`
--

INSERT INTO `nurse_zone` VALUES (1,6,1,'2026-01-10',NULL,'','[]','2026-01-10 05:20:34','2026-01-10 05:20:34'),(2,14,1,'2026-01-18',NULL,'','[\"Jalan Tas 22\", \"Jalan Tas 30\", \"Jalan Tas Ria 2\", \"Jalan Tas Ria 3\", \"Jalan Tas Ria 4\", \"Jalan Tas Ria 5\", \"Jalan Tas Ria 6\", \"Jalan Tas Ria 7\", \"Jalan Tas Ria 8\", \"Jalan Tas Ria 31\", \"Jalan Tas Ria 32\", \"Jalan Tas Ria 33\", \"Jalan Tas Ria 34\", \"Jalan Tas Ria 35\", \"Jalan Tas Ria 40\", \"Jalan Tas Ria 40/1\", \"Jalan Tas Ria 60\", \"Tas Perdana\"]','2026-01-17 20:23:19','2026-01-17 20:23:19'),(3,19,2,'2026-01-18',NULL,'','[\"Kg Pandan 1\", \"Lorong Haji Jafar\", \"Lorong Wak Satay\", \"Mahkota Letrik\", \"Kes Risiko Kg Pandan S 1\", \"Kes Risiko Kg Pandan S 2\", \"Kes Risiko Kg Pandan S 3\"]','2026-01-17 20:24:39','2026-01-17 20:24:39');

--
-- Table structure for table `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,
  `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;

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

INSERT INTO `sessions` VALUES ('opgv0TDyU9y69L6MeAqseTQxRwph4Rhu40mOj3uY',10,'127.0.0.1','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','YTo0OntzOjY6Il90b2tlbiI7czo0MDoidmM3akxyTFgyWGVBYWVFQUg1TnF1NlZDTTIzSWtCSm9UTU5hNXptdyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mjk6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9wcm9maWxlIjt9czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTA7fQ==',1768717831);

--
-- Table structure for table `zone_change_logs`
--

CREATE TABLE `zone_change_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mother_id` bigint unsigned NOT NULL,
  `old_zone_id` bigint unsigned DEFAULT NULL,
  `new_zone_id` bigint unsigned NOT NULL,
  `old_nurse_id` bigint unsigned DEFAULT NULL,
  `new_nurse_id` bigint unsigned DEFAULT NULL,
  `change_reason` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `changed_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `zone_change_logs_mother_id_foreign` (`mother_id`),
  KEY `zone_change_logs_old_zone_id_foreign` (`old_zone_id`),
  KEY `zone_change_logs_new_zone_id_foreign` (`new_zone_id`),
  KEY `zone_change_logs_old_nurse_id_foreign` (`old_nurse_id`),
  KEY `zone_change_logs_new_nurse_id_foreign` (`new_nurse_id`),
  KEY `zone_change_logs_changed_by_foreign` (`changed_by`),
  CONSTRAINT `zone_change_logs_changed_by_foreign` FOREIGN KEY (`changed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `zone_change_logs_mother_id_foreign` FOREIGN KEY (`mother_id`) REFERENCES `expectant_mothers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `zone_change_logs_new_nurse_id_foreign` FOREIGN KEY (`new_nurse_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `zone_change_logs_new_zone_id_foreign` FOREIGN KEY (`new_zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE,
  CONSTRAINT `zone_change_logs_old_nurse_id_foreign` FOREIGN KEY (`old_nurse_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `zone_change_logs_old_zone_id_foreign` FOREIGN KEY (`old_zone_id`) REFERENCES `zones` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `zone_change_logs`
--

INSERT INTO `zone_change_logs` VALUES (1,1,NULL,1,NULL,6,'Initial Zone Assignment','',2,'2026-01-13 02:40:44','2026-01-13 02:40:44');

--
-- Table structure for table `zones`
--

CREATE TABLE `zones` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `clinic_id` bigint unsigned NOT NULL,
  `zone_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `boundary_notes` text COLLATE utf8mb4_unicode_ci,
  `coverage_areas` json DEFAULT NULL,
  `postcodes` 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 `zones_clinic_id_zone_code_unique` (`clinic_id`,`zone_code`),
  CONSTRAINT `zones_clinic_id_foreign` FOREIGN KEY (`clinic_id`) REFERENCES `clinics` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `zones`
--

INSERT INTO `zones` VALUES (1,2,'A','Zone A - Tas Area','Covers Jalan Tas area, Tas Ria residential area, and Tas Perdana','[\"Jalan Tas 1\", \"Jalan Tas 2\", \"Jalan Tas 3\", \"Jalan Tas 4\", \"Jalan Tas 5\", \"Jalan Tas 6\", \"Jalan Tas 7\", \"Jalan Tas 8\", \"Jalan Tas 9\", \"Jalan Tas 10\", \"Jalan Tas 11\", \"Jalan Tas 12\", \"Jalan Tas 13\", \"Jalan Tas 14\", \"Jalan Tas 15\", \"Jalan Tas 16\", \"Jalan Tas 18\", \"Jalan Tas 20\", \"Jalan Tas 22\", \"Jalan Tas 24\", \"Jalan Tas 26\", \"Jalan Tas 28\", \"Jalan Tas 30\", \"Jalan Tas 32\", \"Jalan Tas 34\", \"Jalan Tas 36\", \"Jalan Tas 38\", \"Jalan Tas 40\", \"Jalan Tas 42\", \"Jalan Tas Ria 2\", \"Jalan Tas Ria 3\", \"Jalan Tas Ria 4\", \"Jalan Tas Ria 5\", \"Jalan Tas Ria 6\", \"Jalan Tas Ria 7\", \"Jalan Tas Ria 8\", \"Jalan Tas Ria 11\", \"Jalan Tas Ria 12\", \"Jalan Tas Ria 13\", \"Jalan Tas Ria 14\", \"Jalan Tas Ria 15\", \"Jalan Tas Ria 16\", \"Jalan Tas Ria 17\", \"Jalan Tas Ria 18\", \"Jalan Tas Ria 19\", \"Jalan Tas Ria 31\", \"Jalan Tas Ria 32\", \"Jalan Tas Ria 33\", \"Jalan Tas Ria 34\", \"Jalan Tas Ria 35\", \"Jalan Tas Ria 40\", \"Jalan Tas Ria 40/1\", \"Jalan Tas Ria 60\", \"Jalan Tas Ria Mewah 37\", \"Jalan Tas Ria Mewah 38\", \"Jalan Tas Ria Mewah 39\", \"Tas Perdana\", \"Panadan Jaya 1\", \"Panadan Jaya 2\", \"Panadan Jaya 3\", \"Panadan Jaya 10\", \"CL Bt 6\", \"Batu 8\"]','[]',1,'2026-01-10 05:17:28','2026-01-17 19:32:43'),(2,2,'B','Zone B - Pandan Area','Covers Kampung Pandan main area, surrounding lorongs, and Taman areas','[\"Kg Pandan 1\", \"Kg Pandan 2\", \"Kg Pandan Dalam\", \"Kg Pandan Aman 1\", \"Kg Pandan Aman 2\", \"Kg Pandan Perdana 1\", \"Kg Pandan Perdana 2\", \"Lorong Haji Jafar\", \"Lorong Wak Satay\", \"Lorong Paip\", \"Mahkota Letrik\", \"Mahkota Emas\", \"Mahkota Emas 6/1\", \"Mahkota Emas 6/2\", \"Mahkota Emas 6/3\", \"Mahkota Emas 6/4\", \"Mahkota Emas 6/5\", \"Mahkota Emas 6/6\", \"Mahkota Emas 6/7\", \"Mahkota Emas 6/8\", \"Mahkota Emas 6/9\", \"Mahkota Emas 6/10\", \"Taman Pandan Perdana 1\", \"Taman Perdana 2\", \"Taman KPS 1\", \"Taman KPS 2\", \"Taman KPS 3\", \"Kampung Pandan 1 Roti Canai Madu\", \"Upin Ipin\", \"Kurnia\", \"PPU\", \"Padang Bola\", \"Gas\", \"Kes Risiko Kg Pandan S 1\", \"Kes Risiko Kg Pandan S 2\", \"Kes Risiko Kg Pandan S 3\", \"Kes Risiko Kg Pandan 2\"]',NULL,1,'2026-01-17 19:32:43','2026-01-17 19:32:43'),(3,2,'C','Zone C - Seri Damai Area','Covers Taman Seri Damai Perdana, Taman Pandan Indah, Bukit Rangin Aman, and bypass area','[\"Taman Seri Damai Perdana 2/41\", \"Taman Seri Damai Perdana 2/42\", \"Taman Seri Damai Perdana 2/220\", \"Jalan Pintasan Bypass\", \"Taman Pandan Damai 1/1\", \"Taman Pandan Damai 1/27\", \"Taman Pandan Damai 1/32\", \"Taman Pandan Damai 1/45\", \"Taman Pandan Damai 2/1\", \"Taman Pandan Damai 2/40\", \"Taman Pandan Damai 3\", \"Taman Pandan Indah 1\", \"Taman Pandan Indah 2\", \"Taman Bukit Rangin Aman 1\", \"Taman Bukit Rangin Aman 2\", \"Taman Bukit Rangin Aman 19\", \"Taman Bukit Rangin Aman 20\", \"Taman Bukit Rangin Aman 33\", \"Taman Pandan Damai\"]',NULL,1,'2026-01-17 19:32:43','2026-01-17 19:32:43'),(4,2,'D','Zone D - Bukit Rangin Area','Covers Bukit Rangin Damai lorongs, Kampung Chedering, Pandan Makmur, and Taman Permatang Badak Perdana','[\"Bukit Rangin Damai Lorong 1\", \"Bukit Rangin Damai Lorong 2\", \"Bukit Rangin Damai Lorong 3\", \"Bukit Rangin Damai Lorong 4\", \"Bukit Rangin Damai Lorong 5\", \"Bukit Rangin Damai Lorong 10\", \"Bukit Rangin Damai Lorong 11\", \"Bukit Rangin Damai Lorong 12\", \"Bukit Rangin Damai Lorong 13\", \"Bukit Rangin Damai Lorong 14\", \"Bukit Rangin Damai Lorong 15\", \"Bukit Rangin Damai Lorong 16\", \"Bukit Rangin Damai Lorong 17\", \"Bukit Rangin Damai Lorong 18\", \"Bukit Rangin Damai Lorong 19\", \"Bukit Rangin Damai Lorong 20\", \"Kg Chedering\", \"Kg Baru Chendering\", \"Pandan Makmur Lorong 1/1\", \"Pandan Makmur Lorong 1/5\", \"Pandan Makmur Lorong 1/6\", \"Pandan Makmur Lorong 1/8\", \"Pandan Makmur Lorong 1/9\", \"Pandan Makmur Lorong 1/18\", \"Pandan Makmur Lorong 1/27\", \"Pandan Makmur Lorong 1/29\", \"Pandan Makmur Lorong 2/2\", \"Pandan Makmur Damai Lorong 40\", \"Pandan Makmur Damai Lorong 41\", \"Pandan Makmur Damai Lorong 42\", \"Pandan Makmur Damai Lorong 43\", \"Tmn Bukit Rangin Perdana Lorong 7\", \"Tmn Bukit Rangin Perdana Lorong 8\", \"Rumah Kg Bukit Rangin\", \"Telaga Pasu\", \"Taman Permatang Badak Perdana Lorong 202\", \"Taman Permatang Badak Perdana Lorong 215\", \"Taman Permatang Badak Perdana Lorong 226\", \"Taman Permatang Badak Perdana Lorong 228\", \"Kuarters Bomba\", \"Lubuk Puyu\", \"Taman Pandan Jaya Lorong 91\", \"Taman Pandan Jaya Lorong 95\"]',NULL,1,'2026-01-17 19:32:43','2026-01-17 19:32:43');


