/*
 Navicat Premium Data Transfer

 Source Server         : lokal
 Source Server Type    : MySQL
 Source Server Version : 80403
 Source Host           : localhost:3306
 Source Schema         : waba_saas

 Target Server Type    : MySQL
 Target Server Version : 80403
 File Encoding         : 65001

 Date: 09/12/2025 09:50:08
*/


-- ----------------------------
-- Table structure for activity_logs
-- ----------------------------
CREATE TABLE `activity_logs`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NULL DEFAULT NULL,
  `module` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` json NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `activity_logs_user_id_foreign`(`user_id` ASC) USING BTREE,
  INDEX `activity_logs_module_index`(`module` ASC) USING BTREE,
  CONSTRAINT `activity_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of cache_locks
-- ----------------------------

-- ----------------------------
-- Table structure for campaign_logs
-- ----------------------------
CREATE TABLE `campaign_logs`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `campaign_id` bigint UNSIGNED NOT NULL,
  `phone_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'queued',
  `response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `campaign_logs_campaign_id_foreign`(`campaign_id` ASC) USING BTREE,
  CONSTRAINT `campaign_logs_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of campaign_logs
-- ----------------------------

-- ----------------------------
-- Table structure for campaigns
-- ----------------------------
CREATE TABLE `campaigns`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `template_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `language` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parameters` json NOT NULL,
  `recipients` json NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `scheduled_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `campaigns_user_id_foreign`(`user_id` ASC) USING BTREE,
  CONSTRAINT `campaigns_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for dedicated_assigns
-- ----------------------------
CREATE TABLE `dedicated_assigns`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `client_id` bigint UNSIGNED NOT NULL,
  `waba_pool_id` bigint UNSIGNED NOT NULL,
  `start_date` datetime NOT NULL,
  `end_date` datetime NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `dedicated_assigns_client_id_waba_pool_id_unique`(`client_id` ASC, `waba_pool_id` ASC) USING BTREE,
  INDEX `dedicated_assigns_waba_pool_id_foreign`(`waba_pool_id` ASC) USING BTREE,
  CONSTRAINT `dedicated_assigns_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `dedicated_assigns_waba_pool_id_foreign` FOREIGN KEY (`waba_pool_id`) REFERENCES `waba_pools` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of dedicated_assigns
-- ----------------------------

-- ----------------------------
-- Table structure for divisi_shifts
-- ----------------------------
CREATE TABLE `divisi_shifts`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `divisi_id` bigint UNSIGNED NOT NULL,
  `shift_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `divisi_shifts_divisi_id_foreign`(`divisi_id` ASC) USING BTREE,
  INDEX `divisi_shifts_shift_id_foreign`(`shift_id` ASC) USING BTREE,
  CONSTRAINT `divisi_shifts_divisi_id_foreign` FOREIGN KEY (`divisi_id`) REFERENCES `divisis` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `divisi_shifts_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of divisi_shifts
-- ----------------------------

-- ----------------------------
-- Table structure for divisis
-- ----------------------------
CREATE TABLE `divisis`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `keterangan` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of divisis
-- ----------------------------
INSERT INTO `divisis` VALUES (6, '2df63e96-b296-4d89-b845-fdd2e4270f20', 'Apoteker', 'Apoteker', '2025-05-21 04:28:03', '2025-05-21 04:31:30');
INSERT INTO `divisis` VALUES (7, '2efebd75-a08a-42f7-a591-ed537c5b1b34', 'Dokter_Umum_IGD', 'dokter IGD', '2025-05-21 04:28:43', '2025-05-21 04:32:18');
INSERT INTO `divisis` VALUES (8, '73a140d6-2975-46ca-9c85-35aa8e7ebf29', 'PERAWAT_HD_RAJAL', 'perawat HD', '2025-05-21 04:29:22', '2025-05-21 07:40:42');
INSERT INTO `divisis` VALUES (9, '8ca86588-dc04-4e52-adbd-aee3391e367b', 'PENATA', 'Perawat IBS', '2025-05-21 04:29:45', '2025-05-21 07:01:42');
INSERT INTO `divisis` VALUES (10, '01c0d6a5-a972-4674-a288-40b1082d3e93', 'ASISTEN', 'ASISTEN', '2025-05-21 07:01:50', '2025-05-21 07:40:54');
INSERT INTO `divisis` VALUES (11, '36dcaca8-5d8e-4ada-92df-3e837aa3de2a', 'PERAWAT', 'perawat/bidan', '2025-05-21 07:06:51', '2025-05-21 07:39:01');
INSERT INTO `divisis` VALUES (12, '85c5d34b-3f95-4b6c-9547-bef8cbd6d095', 'PERAWAT_HD_RANAP', 'PERAWAT_HD_RANAP', '2025-05-21 07:25:32', '2025-05-21 07:40:48');
INSERT INTO `divisis` VALUES (14, '013d7af3-41cb-4b51-8d6d-feeea8a118d6', 'JTL', 'JTL', '2025-05-21 08:12:05', '2025-05-21 08:12:05');
INSERT INTO `divisis` VALUES (16, 'ae4676ee-f020-4c01-9bf8-566f9ba27bbc', 'tes', 'Tesing gannn', '2025-07-10 06:55:51', '2025-07-10 06:56:33');

-- ----------------------------
-- Table structure for failed_jobs
-- ----------------------------
CREATE TABLE `failed_jobs`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `failed_jobs_uuid_unique`(`uuid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of failed_jobs
-- ----------------------------

-- ----------------------------
-- Table structure for job_batches
-- ----------------------------
CREATE TABLE `job_batches`  (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 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 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `cancelled_at` int NULL DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of job_batches
-- ----------------------------

-- ----------------------------
-- Table structure for jobs
-- ----------------------------
CREATE TABLE `jobs`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint UNSIGNED NOT NULL,
  `reserved_at` int UNSIGNED NULL DEFAULT NULL,
  `available_at` int UNSIGNED NOT NULL,
  `created_at` int UNSIGNED NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `jobs_queue_index`(`queue` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of jobs
-- ----------------------------

-- ----------------------------
-- Table structure for menus
-- ----------------------------
CREATE TABLE `menus`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `nama_menu` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `order` int NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `menus_parent_id_foreign`(`parent_id` ASC) USING BTREE,
  CONSTRAINT `menus_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of menus
-- ----------------------------
INSERT INTO `menus` VALUES (1, 'bb5e49c9-5c7b-4840-bb4b-b48a96e8a260', 'user.index', 'ti ti-user', 'User', 5, '2025-02-18 02:01:15', '2025-12-08 16:28:48', 12);
INSERT INTO `menus` VALUES (2, '6ee7d0a1-4aca-4cc5-ba7b-7eb636977c57', 'settings.edit', 'ti ti-settings', 'Pengaturan', NULL, '2025-02-18 02:10:08', '2025-12-08 16:28:48', 15);
INSERT INTO `menus` VALUES (3, '9b1c00d5-5b6b-4161-b976-87a6da9573d1', 'role.index', 'ti ti-shield', 'Role', 5, '2025-02-18 02:10:58', '2025-12-08 16:28:48', 13);
INSERT INTO `menus` VALUES (4, '1f2f5340-6912-42da-9331-ab768c5d44ee', 'menu.index', 'ti ti-list', 'Menu', 5, '2025-02-18 02:15:39', '2025-12-08 16:28:48', 14);
INSERT INTO `menus` VALUES (5, 'f602469c-7303-4df9-9164-76ba63e2a5b0', '#', 'ti ti-key', 'Autentikasi', NULL, '2025-02-18 02:17:37', '2025-12-08 16:28:48', 11);
INSERT INTO `menus` VALUES (16, '19d25981-c20f-46e1-92b2-93530e79a19d', '#', 'ti ti-brand-whatsapp', 'WA Gateway', NULL, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 1);
INSERT INTO `menus` VALUES (17, 'c9e87cad-a964-4739-a070-98e5bdc65ec8', 'admin.dashboard', 'ti ti-dashboard', 'WA Dashboard', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 2);
INSERT INTO `menus` VALUES (18, 'bac31b15-6c2f-4f74-8e0c-cdf22d89c527', 'admin.clients.index', 'ti ti-users', 'WA Clients', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 3);
INSERT INTO `menus` VALUES (19, '5196ce55-8b20-45e2-b590-c7d0c235cad0', 'admin.resellers.index', 'ti ti-list', 'WA Resellers', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 4);
INSERT INTO `menus` VALUES (20, 'ce622314-4216-4c87-bccb-fc722ac5fcd4', 'admin.waba-pools.index', 'ti ti-device-mobile-message', 'WA WABA Pools', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 5);
INSERT INTO `menus` VALUES (21, '26dc8726-b5f9-457a-9bd5-5dc8ffbdf5f8', 'admin.templates.index', 'ti ti-template', 'WA Templates', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 6);
INSERT INTO `menus` VALUES (22, '1fffae17-13a4-45d6-8afd-688d03f1a717', 'admin.message-pricings.index', 'ti ti-currency-dollar', 'WA Pricings', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 7);
INSERT INTO `menus` VALUES (23, 'f9bcdf99-c011-40a2-9e26-f537e490c661', 'admin.messages.index', 'ti ti-messages', 'WA Messages', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 8);
INSERT INTO `menus` VALUES (24, 'cf4bd2a7-bf49-4c4b-8e89-ed3919ff7ec0', 'admin.topups.index', 'ti ti-wallet', 'WA Topups', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 9);
INSERT INTO `menus` VALUES (25, 'dc011332-1ed3-4bb5-86d5-7d273bb0a3ef', 'admin.activity-logs.index', 'ti ti-list-details', 'WA Activity Logs', 16, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 10);
INSERT INTO `menus` VALUES (26, '7b286e95-5945-4974-9a53-c5d40b9a2d0c', '#', 'ti ti-brand-whatsapp', 'WA Reseller', NULL, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 16);
INSERT INTO `menus` VALUES (27, 'f1c5aa78-0248-46f1-8d27-40f80265c4d1', 'reseller.dashboard', 'ti ti-dashboard', 'Dashboard Reseller', 26, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 17);
INSERT INTO `menus` VALUES (28, '57b13bb3-6544-4be6-a3db-8d6f33727af5', 'reseller.clients.index', 'ti ti-users', 'Clients Reseller', 26, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 18);
INSERT INTO `menus` VALUES (29, '5d98022d-71ec-4c46-bd02-68cb5c9fa2cb', 'reseller.pricing.index', 'ti ti-currency-dollar', 'Pricing Reseller', 26, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 19);
INSERT INTO `menus` VALUES (30, 'd4abb6dc-6a82-484e-a869-f505bb085e59', 'reseller.commission.index', 'ti ti-cash', 'Komisi Reseller', 26, '2025-12-08 15:50:43', '2025-12-08 16:28:48', 20);
INSERT INTO `menus` VALUES (31, 'ec5e7a72-86b5-4ea1-b4d3-f6c3f21cd9fd', '#', 'ti ti-brand-whatsapp', 'WA Client', NULL, '2025-12-08 17:49:16', '2025-12-08 17:49:16', 52);
INSERT INTO `menus` VALUES (32, '5d8386e6-760c-41e1-ab52-6e0f35ada969', 'client.dashboard', 'ti ti-dashboard', 'Client Dashboard', 31, '2025-12-08 17:49:16', '2025-12-08 17:49:16', 1);
INSERT INTO `menus` VALUES (33, '6d99e207-c776-439a-9ba1-b1573d18fb89', 'client.messages.create', 'ti ti-send', 'Send Message', 31, '2025-12-08 17:49:16', '2025-12-08 17:49:16', 2);
INSERT INTO `menus` VALUES (34, '96aeb2bd-f834-4c65-8a14-31e8205cb6d0', 'client.messages.index', 'ti ti-message-circle', 'Message History', 31, '2025-12-08 17:49:16', '2025-12-08 17:49:16', 3);
INSERT INTO `menus` VALUES (35, '296fc268-bcc8-43d6-836d-d10a3345d031', 'client.balance', 'ti ti-wallet', 'Balance', 31, '2025-12-08 17:49:16', '2025-12-08 17:49:16', 4);
INSERT INTO `menus` VALUES (36, 'ba0677aa-8337-42e0-ab1c-d5ca8168c110', 'client.campaigns.index', 'ti ti-broadcast', 'Campaigns', 31, '2025-12-08 19:26:57', '2025-12-08 19:26:57', 5);
INSERT INTO `menus` VALUES (37, 'cef6b887-9c3f-439a-bb27-265a0d2401f3', 'reseller.settings.api-key', 'ti ti-key', 'API Settings', 26, '2025-12-08 19:52:19', '2025-12-08 19:52:19', 5);
INSERT INTO `menus` VALUES (38, 'd6d548b9-94a5-457b-90f5-ae22e0255be3', 'reseller.templates.index', 'ti ti-template', 'Templates Reseller', 26, '2025-12-08 20:34:24', '2025-12-08 20:34:24', 6);
INSERT INTO `menus` VALUES (39, '08f97fac-0a78-479f-8d37-684f6fbbb6b6', 'client.templates.index', 'ti ti-template', 'Templates', 31, '2025-12-08 20:34:24', '2025-12-08 20:34:24', 6);

-- ----------------------------
-- Table structure for message_pricings
-- ----------------------------
CREATE TABLE `message_pricings`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `message_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `price_shared` decimal(14, 4) NOT NULL DEFAULT 0.0000,
  `price_dedicated` decimal(14, 4) NOT NULL DEFAULT 0.0000,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `message_pricings_message_type_index`(`message_type` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of message_pricings
-- ----------------------------
INSERT INTO `message_pricings` VALUES (1, 'marketing', 590.0000, 594.0000, 1, '2025-12-08 18:54:40', '2025-12-08 19:04:47');
INSERT INTO `message_pricings` VALUES (2, 'utility', 360.0000, 364.0000, 1, '2025-12-08 18:55:06', '2025-12-08 19:04:18');
INSERT INTO `message_pricings` VALUES (3, 'otp', 360.0000, 364.0000, 1, '2025-12-08 18:55:20', '2025-12-08 19:04:10');

-- ----------------------------
-- Table structure for messages
-- ----------------------------
CREATE TABLE `messages`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_id` bigint UNSIGNED NOT NULL,
  `waba_pool_id` bigint UNSIGNED NULL DEFAULT NULL,
  `message_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'text, template, media',
  `category` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `cost` decimal(14, 4) NOT NULL DEFAULT 0.0000,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'queued',
  `meta_message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `payload` json NOT NULL,
  `response` json NULL,
  `sent_at` datetime NULL DEFAULT NULL,
  `error_message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `messages_uuid_unique`(`uuid` ASC) USING BTREE,
  INDEX `messages_client_id_foreign`(`client_id` ASC) USING BTREE,
  INDEX `messages_waba_pool_id_foreign`(`waba_pool_id` ASC) USING BTREE,
  INDEX `messages_status_index`(`status` ASC) USING BTREE,
  INDEX `messages_meta_message_id_index`(`meta_message_id` ASC) USING BTREE,
  CONSTRAINT `messages_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `messages_waba_pool_id_foreign` FOREIGN KEY (`waba_pool_id`) REFERENCES `waba_pools` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of messages
-- ----------------------------
INSERT INTO `messages` VALUES (1, '656b2258-0c4e-4b32-9a6b-2e24f04a00f3', 6, 1, 'text', 'marketing', 596.0000, 'queued', NULL, '{\"to\": \"62895361034833\", \"type\": \"text\", \"media\": null, \"message\": \"test\", \"category\": \"marketing\", \"template_name\": null, \"template_params\": null}', NULL, NULL, NULL, '2025-12-08 19:11:45', '2025-12-08 19:11:45');
INSERT INTO `messages` VALUES (2, 'bd328ccf-9f7c-4254-a3d3-f51b2eaaae05', 6, 1, 'text', 'utility', 366.0000, 'queued', NULL, '{\"to\": \"62895361034833\", \"type\": \"text\", \"media\": null, \"message\": \"test 2\", \"category\": \"utility\", \"template_name\": null, \"template_params\": null}', NULL, NULL, NULL, '2025-12-08 19:12:54', '2025-12-08 19:12:54');

-- ----------------------------
-- Table structure for migrations
-- ----------------------------
CREATE TABLE `migrations`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of migrations
-- ----------------------------
INSERT INTO `migrations` VALUES (9, '0001_01_01_000000_create_users_table', 1);
INSERT INTO `migrations` VALUES (10, '0001_01_01_000001_create_cache_table', 1);
INSERT INTO `migrations` VALUES (11, '0001_01_01_000002_create_jobs_table', 1);
INSERT INTO `migrations` VALUES (12, '2025_02_18_013140_create_settings_table', 1);
INSERT INTO `migrations` VALUES (13, '2025_02_18_014202_create_permission_tables', 1);
INSERT INTO `migrations` VALUES (14, '2025_02_18_015415_create_menus_table', 2);
INSERT INTO `migrations` VALUES (15, '2025_02_18_015517_create_role_menus_table', 2);
INSERT INTO `migrations` VALUES (16, '2025_02_18_031243_create_divisis_table', 3);
INSERT INTO `migrations` VALUES (17, '2025_02_18_031322_create_jabatans_table', 3);
INSERT INTO `migrations` VALUES (19, '2025_02_18_040607_create_radii_table', 5);
INSERT INTO `migrations` VALUES (21, '2025_02_18_034610_create_shifts_table', 6);
INSERT INTO `migrations` VALUES (22, '2025_02_18_061406_create_jam_kerjas_table', 6);
INSERT INTO `migrations` VALUES (23, '2025_02_19_005354_create_divisi_shifts_table', 6);
INSERT INTO `migrations` VALUES (34, '2025_02_20_034830_create_pegawai_masters_table', 7);
INSERT INTO `migrations` VALUES (35, '2025_02_22_011112_create_pegawai_shifts_table', 8);
INSERT INTO `migrations` VALUES (36, '2025_02_24_014835_create_presensis_table', 8);
INSERT INTO `migrations` VALUES (37, '2025_02_24_032535_create_personal_access_tokens_table', 9);
INSERT INTO `migrations` VALUES (38, '2025_02_24_033112_create_o_t_p_verifications_table', 10);
INSERT INTO `migrations` VALUES (41, '2025_02_25_005648_create_user_photos_table', 11);
INSERT INTO `migrations` VALUES (42, '2025_05_14_041214_create_proporsi_fairness_table', 12);
INSERT INTO `migrations` VALUES (43, '2025_05_14_044119_create_grade_table', 13);
INSERT INTO `migrations` VALUES (44, '2025_05_14_050000_create_sumbers_table', 14);
INSERT INTO `migrations` VALUES (45, '2025_05_14_050000_create_sumber_table', 15);
INSERT INTO `migrations` VALUES (46, '2024_01_15_create_remunerasi_batch_table', 16);
INSERT INTO `migrations` VALUES (47, '2024_01_15_create_remunerasi_source_table', 17);
INSERT INTO `migrations` VALUES (48, '2024_03_19_000001_create_detail_source_table', 18);
INSERT INTO `migrations` VALUES (49, '2024_03_19_000002_create_pembagian_klaim_table', 19);
INSERT INTO `migrations` VALUES (50, '2025_12_08_000003_create_resellers_table', 20);
INSERT INTO `migrations` VALUES (51, '2025_12_08_000001_create_waba_pools_table', 21);
INSERT INTO `migrations` VALUES (52, '2025_12_08_000002_create_clients_table', 22);
INSERT INTO `migrations` VALUES (53, '2025_12_08_000004_create_dedicated_assigns_table', 23);
INSERT INTO `migrations` VALUES (54, '2025_12_08_000005_create_messages_table', 24);
INSERT INTO `migrations` VALUES (55, '2025_12_08_000006_create_templates_table', 25);
INSERT INTO `migrations` VALUES (56, '2025_12_08_000007_create_reseller_client_pricings_table', 26);
INSERT INTO `migrations` VALUES (57, '2025_12_08_000008_create_topups_table', 27);
INSERT INTO `migrations` VALUES (58, '2025_12_08_000009_create_activity_logs_table', 28);
INSERT INTO `migrations` VALUES (59, '2025_12_08_000010_create_whitelists_table', 29);
INSERT INTO `migrations` VALUES (60, '2025_12_08_000011_create_message_pricings_table', 30);
INSERT INTO `migrations` VALUES (61, '2025_12_08_100000_create_sessions_table_if_missing', 31);
INSERT INTO `migrations` VALUES (62, '2025_12_08_110000_add_account_name_to_waba_pools_table', 32);
INSERT INTO `migrations` VALUES (63, '2025_12_08_172253_create_reseller_clients_table', 33);
INSERT INTO `migrations` VALUES (64, '2025_12_08_172257_create_reseller_pricings_table', 34);
INSERT INTO `migrations` VALUES (65, '2025_12_08_172302_add_category_to_messages_table', 35);
INSERT INTO `migrations` VALUES (66, '2025_12_08_175710_add_default_and_final_price_to_reseller_pricings_table', 36);
INSERT INTO `migrations` VALUES (67, '2025_12_08_181814_add_user_id_to_clients_table', 37);
INSERT INTO `migrations` VALUES (68, '2025_12_08_182753_add_api_and_server_key_to_clients_table', 38);
INSERT INTO `migrations` VALUES (69, '2025_12_08_184348_add_deleted_at_to_clients_table', 39);
INSERT INTO `migrations` VALUES (70, '2025_12_08_191811_create_campaigns_table', 40);
INSERT INTO `migrations` VALUES (71, '2025_12_08_191815_create_campaign_logs_table', 41);
INSERT INTO `migrations` VALUES (72, '2025_12_08_194923_add_server_key_to_resellers_table', 42);
INSERT INTO `migrations` VALUES (73, '2025_12_08_201941_add_multi_account_fields_to_templates_table', 43);

-- ----------------------------
-- Table structure for model_has_permissions
-- ----------------------------
CREATE TABLE `model_has_permissions`  (
  `permission_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`, `model_id`, `model_type`) USING BTREE,
  INDEX `model_has_permissions_model_id_model_type_index`(`model_id` ASC, `model_type` ASC) USING BTREE,
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of model_has_permissions
-- ----------------------------

-- ----------------------------
-- Table structure for model_has_roles
-- ----------------------------
CREATE TABLE `model_has_roles`  (
  `role_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`role_id`, `model_id`, `model_type`) USING BTREE,
  INDEX `model_has_roles_model_id_model_type_index`(`model_id` ASC, `model_type` ASC) USING BTREE,
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of model_has_roles
-- ----------------------------
INSERT INTO `model_has_roles` VALUES (3, 'App\\Models\\User', 1);
INSERT INTO `model_has_roles` VALUES (4, 'App\\Models\\User', 11);
INSERT INTO `model_has_roles` VALUES (5, 'App\\Models\\User', 13);
INSERT INTO `model_has_roles` VALUES (5, 'App\\Models\\User', 14);
INSERT INTO `model_has_roles` VALUES (5, 'App\\Models\\User', 15);
INSERT INTO `model_has_roles` VALUES (5, 'App\\Models\\User', 16);
INSERT INTO `model_has_roles` VALUES (5, 'App\\Models\\User', 17);
INSERT INTO `model_has_roles` VALUES (4, 'App\\Models\\User', 18);
INSERT INTO `model_has_roles` VALUES (5, 'App\\Models\\User', 19);
INSERT INTO `model_has_roles` VALUES (5, 'App\\Models\\User', 20);

-- ----------------------------
-- Records of password_reset_tokens
-- ----------------------------

-- ----------------------------
-- Table structure for pembagian_klaim
-- ----------------------------
CREATE TABLE `pembagian_klaim`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `groups` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `jenis` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `grade` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ppa` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` decimal(10, 4) NOT NULL,
  `sumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `flag` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `del` tinyint(1) NOT NULL DEFAULT 0,
  `sep` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `id_detail_source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cluster` tinyint NOT NULL,
  `idxdaftar` int NOT NULL,
  `nomr` int NOT NULL,
  `tanggal` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pembagian_klaim
-- ----------------------------

-- ----------------------------
-- Table structure for permissions
-- ----------------------------
CREATE TABLE `permissions`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `permissions_name_guard_name_unique`(`name` ASC, `guard_name` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for reseller_client_pricings
-- ----------------------------
CREATE TABLE `reseller_client_pricings`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `reseller_id` bigint UNSIGNED NOT NULL,
  `client_id` bigint UNSIGNED NOT NULL,
  `message_price` decimal(14, 4) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `reseller_client_pricings_reseller_id_client_id_unique`(`reseller_id` ASC, `client_id` ASC) USING BTREE,
  INDEX `reseller_client_pricings_client_id_foreign`(`client_id` ASC) USING BTREE,
  CONSTRAINT `reseller_client_pricings_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `reseller_client_pricings_reseller_id_foreign` FOREIGN KEY (`reseller_id`) REFERENCES `resellers` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of reseller_client_pricings
-- ----------------------------

-- ----------------------------
-- Table structure for reseller_clients
-- ----------------------------
CREATE TABLE `reseller_clients`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `reseller_id` bigint UNSIGNED NOT NULL,
  `client_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `package` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'shared',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `reseller_clients_reseller_id_foreign`(`reseller_id` ASC) USING BTREE,
  INDEX `reseller_clients_client_id_foreign`(`client_id` ASC) USING BTREE,
  CONSTRAINT `reseller_clients_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `reseller_clients_reseller_id_foreign` FOREIGN KEY (`reseller_id`) REFERENCES `resellers` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of reseller_clients
-- ----------------------------
INSERT INTO `reseller_clients` VALUES (1, 1, 5, '3274', 'shared', 'active', '2025-12-08 18:14:32', '2025-12-08 18:14:32');
INSERT INTO `reseller_clients` VALUES (2, 1, 6, 'untul', 'shared', 'active', '2025-12-08 18:29:33', '2025-12-08 18:29:33');
INSERT INTO `reseller_clients` VALUES (3, 2, 7, 'Client Name', 'shared', 'active', '2025-12-08 19:59:45', '2025-12-08 19:59:45');

-- ----------------------------
-- Table structure for reseller_pricings
-- ----------------------------
CREATE TABLE `reseller_pricings`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `reseller_id` bigint UNSIGNED NOT NULL,
  `package` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `message_category` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `default_price` decimal(14, 4) NOT NULL DEFAULT 0.0000,
  `markup` decimal(14, 4) NOT NULL DEFAULT 0.0000,
  `final_price` decimal(14, 4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `reseller_pricings_reseller_id_package_message_category_unique`(`reseller_id` ASC, `package` ASC, `message_category` ASC) USING BTREE,
  CONSTRAINT `reseller_pricings_reseller_id_foreign` FOREIGN KEY (`reseller_id`) REFERENCES `resellers` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of reseller_pricings
-- ----------------------------
INSERT INTO `reseller_pricings` VALUES (14, 1, 'shared', 'marketing', 590.0000, 6.0000, 596.0000, '2025-12-08 19:05:08', '2025-12-08 19:05:08');
INSERT INTO `reseller_pricings` VALUES (15, 1, 'shared', 'utility', 360.0000, 6.0000, 366.0000, '2025-12-08 19:05:15', '2025-12-08 19:05:15');
INSERT INTO `reseller_pricings` VALUES (16, 1, 'shared', 'otp', 360.0000, 6.0000, 366.0000, '2025-12-08 19:05:25', '2025-12-08 19:05:25');
INSERT INTO `reseller_pricings` VALUES (17, 1, 'dedicated', 'marketing', 594.0000, 12.0000, 606.0000, '2025-12-08 19:05:45', '2025-12-08 19:05:45');
INSERT INTO `reseller_pricings` VALUES (18, 1, 'dedicated', 'utility', 364.0000, 12.0000, 376.0000, '2025-12-08 19:05:55', '2025-12-08 19:05:55');
INSERT INTO `reseller_pricings` VALUES (19, 1, 'dedicated', 'otp', 364.0000, 12.0000, 376.0000, '2025-12-08 19:06:06', '2025-12-08 19:06:06');
INSERT INTO `reseller_pricings` VALUES (20, 2, 'shared', 'marketing', 590.0000, 6.0000, 596.0000, '2025-12-08 19:39:55', '2025-12-08 19:39:55');
INSERT INTO `reseller_pricings` VALUES (21, 2, 'shared', 'utility', 360.0000, 6.0000, 366.0000, '2025-12-08 19:40:02', '2025-12-08 19:41:18');
INSERT INTO `reseller_pricings` VALUES (22, 2, 'shared', 'otp', 360.0000, 6.0000, 366.0000, '2025-12-08 19:40:11', '2025-12-08 19:41:10');
INSERT INTO `reseller_pricings` VALUES (23, 2, 'dedicated', 'marketing', 594.0000, 12.0000, 606.0000, '2025-12-08 19:40:21', '2025-12-08 19:40:21');
INSERT INTO `reseller_pricings` VALUES (24, 2, 'dedicated', 'utility', 364.0000, 12.0000, 376.0000, '2025-12-08 19:40:53', '2025-12-08 19:40:53');
INSERT INTO `reseller_pricings` VALUES (25, 2, 'dedicated', 'otp', 364.0000, 12.0000, 376.0000, '2025-12-08 19:41:04', '2025-12-08 19:41:04');

-- ----------------------------
-- Table structure for role_has_permissions
-- ----------------------------
CREATE TABLE `role_has_permissions`  (
  `permission_id` bigint UNSIGNED NOT NULL,
  `role_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`, `role_id`) USING BTREE,
  INDEX `role_has_permissions_role_id_foreign`(`role_id` ASC) USING BTREE,
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of role_has_permissions
-- ----------------------------

-- ----------------------------
-- Table structure for role_menus
-- ----------------------------
CREATE TABLE `role_menus`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `role_id` bigint UNSIGNED NOT NULL,
  `menu_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `role_menus_role_id_foreign`(`role_id` ASC) USING BTREE,
  INDEX `role_menus_menu_id_foreign`(`menu_id` ASC) USING BTREE,
  CONSTRAINT `role_menus_menu_id_foreign` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `role_menus_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 76 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of role_menus
-- ----------------------------
INSERT INTO `role_menus` VALUES (45, 3, 1, NULL, NULL);
INSERT INTO `role_menus` VALUES (46, 3, 2, NULL, NULL);
INSERT INTO `role_menus` VALUES (47, 3, 3, NULL, NULL);
INSERT INTO `role_menus` VALUES (48, 3, 4, NULL, NULL);
INSERT INTO `role_menus` VALUES (49, 3, 5, NULL, NULL);
INSERT INTO `role_menus` VALUES (61, 4, 27, '2025-12-08 15:50:43', '2025-12-08 15:50:43');
INSERT INTO `role_menus` VALUES (62, 4, 28, '2025-12-08 15:50:43', '2025-12-08 15:50:43');
INSERT INTO `role_menus` VALUES (63, 4, 29, '2025-12-08 15:50:43', '2025-12-08 15:50:43');
INSERT INTO `role_menus` VALUES (64, 4, 30, '2025-12-08 15:50:43', '2025-12-08 15:50:43');
INSERT INTO `role_menus` VALUES (65, 3, 16, NULL, NULL);
INSERT INTO `role_menus` VALUES (66, 3, 17, NULL, NULL);
INSERT INTO `role_menus` VALUES (67, 3, 18, NULL, NULL);
INSERT INTO `role_menus` VALUES (68, 3, 19, NULL, NULL);
INSERT INTO `role_menus` VALUES (69, 3, 20, NULL, NULL);
INSERT INTO `role_menus` VALUES (70, 3, 21, NULL, NULL);
INSERT INTO `role_menus` VALUES (71, 3, 22, NULL, NULL);
INSERT INTO `role_menus` VALUES (72, 3, 23, NULL, NULL);
INSERT INTO `role_menus` VALUES (73, 3, 24, NULL, NULL);
INSERT INTO `role_menus` VALUES (74, 3, 25, NULL, NULL);
INSERT INTO `role_menus` VALUES (75, 4, 26, NULL, NULL);
INSERT INTO `role_menus` VALUES (76, 5, 32, '2025-12-08 17:49:16', '2025-12-08 17:49:16');
INSERT INTO `role_menus` VALUES (77, 5, 33, '2025-12-08 17:49:16', '2025-12-08 17:49:16');
INSERT INTO `role_menus` VALUES (78, 5, 34, '2025-12-08 17:49:16', '2025-12-08 17:49:16');
INSERT INTO `role_menus` VALUES (79, 5, 35, '2025-12-08 17:49:16', '2025-12-08 17:49:16');
INSERT INTO `role_menus` VALUES (80, 5, 31, NULL, NULL);
INSERT INTO `role_menus` VALUES (81, 5, 36, '2025-12-08 19:26:57', '2025-12-08 19:26:57');
INSERT INTO `role_menus` VALUES (82, 4, 37, '2025-12-08 19:52:19', '2025-12-08 19:52:19');
INSERT INTO `role_menus` VALUES (83, 4, 38, '2025-12-08 20:34:24', '2025-12-08 20:34:24');
INSERT INTO `role_menus` VALUES (84, 5, 39, '2025-12-08 20:34:24', '2025-12-08 20:34:24');

-- ----------------------------
-- Table structure for roles
-- ----------------------------
CREATE TABLE `roles`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `roles_name_guard_name_unique`(`name` ASC, `guard_name` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of roles
-- ----------------------------
INSERT INTO `roles` VALUES (3, 'admin', 'web', '2025-03-12 12:48:41', '2025-03-12 12:48:41');
INSERT INTO `roles` VALUES (4, 'reseller', 'web', '2025-12-08 15:46:04', '2025-12-08 15:46:04');
INSERT INTO `roles` VALUES (5, 'client', 'web', '2025-12-08 17:49:15', '2025-12-08 17:49:15');

-- ----------------------------
-- Table structure for sessions
-- ----------------------------
CREATE TABLE `sessions`  (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED NULL DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sessions_user_id_index`(`user_id` ASC) USING BTREE,
  INDEX `sessions_last_activity_index`(`last_activity` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sessions
-- ----------------------------
INSERT INTO `sessions` VALUES ('46xNZB7b0jEHq1WkJu41PGJXze3Vco5fzv99RpuS', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiNEl6dmZFT1FwR1pLd3RWYVR0WTFtamFPWTlXeTdTUXlzQXZoa1hMUyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czozOiJ1cmwiO2E6MDp7fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjI4OiJodHRwOi8vd2FiYV9zYWFzLnRlc3Qvcm9sZS8zIjt9czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTt9', 1765230354);
INSERT INTO `sessions` VALUES ('AFzuOikcWYG966sY33lnsUVcZ5iK3hmtOttaILND', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiU1JteHlycGY4YUZSeHlRcldFZko2OGtGWjE5Z3NpTG9ESVl4bkhiaCI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mzc6Imh0dHA6Ly93YWJhX3NhYXMudGVzdC9hZG1pbi9yZXNlbGxlcnMiO31zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1765246157);
INSERT INTO `sessions` VALUES ('o94VBQADq31fqyAVh4Vnz7CUbDhq0Eu9KivYYals', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoidWpKaFF5Z2REY1FJY3ZONkk3ZTBkNFNEWXFLZEZTZXpnSjZVSjZOeSI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czozODoiaHR0cDovLzEyNy4wLjAuMTo4MDAwL2FkbWluL3dhYmEtcG9vbHMiO31zOjk6Il9wcmV2aW91cyI7YToxOntzOjM6InVybCI7czoyNzoiaHR0cDovLzEyNy4wLjAuMTo4MDAwL2xvZ2luIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1765226110);
INSERT INTO `sessions` VALUES ('RsPCkFn6itfVDwgGr44RVCcZhb5q7u2Qn28Qh0Ho', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiRzdqYWpQYVM4ZFRzeVZoQU15SGZoT1RIYXdSVDRjZHpNUXZzSXRtaiI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzY6Imh0dHA6Ly93YWJhX3NhYXMudGVzdC9hZG1pbi9tZXNzYWdlcyI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', 1765230991);
INSERT INTO `sessions` VALUES ('SsaMUflbdzC1U0WfgDVcUlcMWJ6HIJOT31IFuLCo', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiNFRuU1p1aENjTDlTSzdpWG1rZDJjbFlwOTVTSlR6T2cxSEhqYkUxWSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzA6Imh0dHA6Ly93YWJhX3NhYXMudGVzdC9yZWdpc3RlciI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1765228878);
INSERT INTO `sessions` VALUES ('tkoDNGuZPejMaa1q6F8XDJDcV53eweLRciItFAmI', NULL, '127.0.0.1', 'PostmanRuntime/7.49.1', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiWGJiU05ldkozdHFSa1R5M0lQWElNRVljRGo0QmdGQmExMEpDOVpyZyI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czoyMToiaHR0cDovL3dhYmFfc2Fhcy50ZXN0Ijt9czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mjc6Imh0dHA6Ly93YWJhX3NhYXMudGVzdC9sb2dpbiI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1765224168);

-- ----------------------------
-- Table structure for settings
-- ----------------------------
CREATE TABLE `settings`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `website_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `website_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `favicon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of settings
-- ----------------------------
INSERT INTO `settings` VALUES (1, 'WABA Saas', 'Aplikasi Whatsapp Business Central', 'logos/1765205861_logo.png', 'favicons/1765205861_favicon.png', 'kejarkoding@gmail.com', '6285156345912', 'Parenggan, Kec pati, Kab pati', '2025-02-18 02:08:56', '2025-12-08 14:57:41');

-- ----------------------------
-- Table structure for shifts
-- ----------------------------
CREATE TABLE `shifts`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_shift` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `kode_shift` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `keterangan` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `toleransi_terlambat` int NOT NULL DEFAULT 0,
  `status` enum('1','2') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `waktu_mulai_masuk` int NULL DEFAULT NULL,
  `waktu_akhir_masuk` int NULL DEFAULT NULL,
  `waktu_mulai_keluar` int NULL DEFAULT NULL,
  `waktu_akhir_keluar` int NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of shifts
-- ----------------------------
INSERT INTO `shifts` VALUES (12, 'd5181a94-150f-41b1-ac83-f5df072eefcb', 'SHIFT SORE', 'SS', 'OK', 20, '1', '2025-02-19 02:29:01', '2025-03-06 14:01:23', -10, 20, 0, 10);
INSERT INTO `shifts` VALUES (13, '4f8fc7b3-963a-43c6-b3cf-013e6389691d', 'SHIFT PAGI', 'SP', 'OK', 20, '1', '2025-02-19 02:29:30', '2025-03-10 11:56:09', -60, 60, -60, 20);
INSERT INTO `shifts` VALUES (14, '20a6a8fa-df3e-4ab2-ba2e-2e9be3c5b332', 'SHIFT MALAM', 'SM', NULL, 20, '1', '2025-02-19 02:30:18', '2025-03-10 09:45:41', -60, 60, -60, 60);

-- ----------------------------
-- Table structure for templates
-- ----------------------------
CREATE TABLE `templates`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `waba_pool_id` bigint UNSIGNED NULL DEFAULT NULL,
  `waba_template_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `status` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `language` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'id',
  `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by_id` bigint UNSIGNED NULL DEFAULT NULL,
  `created_role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `synced_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'admin atau client',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `templates_waba_pool_id_foreign`(`waba_pool_id` ASC) USING BTREE,
  CONSTRAINT `templates_waba_pool_id_foreign` FOREIGN KEY (`waba_pool_id`) REFERENCES `waba_pools` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of templates
-- ----------------------------

-- ----------------------------
-- Table structure for topups
-- ----------------------------
CREATE TABLE `topups`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `client_id` bigint UNSIGNED NOT NULL,
  `amount` decimal(14, 4) NOT NULL,
  `method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'midtrans',
  `status` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `midtrans_order_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `midtrans_payload` json NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `topups_client_id_foreign`(`client_id` ASC) USING BTREE,
  INDEX `topups_midtrans_order_id_index`(`midtrans_order_id` ASC) USING BTREE,
  CONSTRAINT `topups_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for whitelists
-- ----------------------------
CREATE TABLE `whitelists`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `client_id` bigint UNSIGNED NOT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `whitelists_client_id_ip_address_unique`(`client_id` ASC, `ip_address` ASC) USING BTREE,
  CONSTRAINT `whitelists_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of whitelists
-- ----------------------------

