/*
 Navicat Premium Data Transfer

 Source Server         : mycon
 Source Server Type    : MySQL
 Source Server Version : 100432
 Source Host           : localhost:3306
 Source Schema         : rpp_proj

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

 Date: 30/09/2025 16:17:25
*/


-- ----------------------------
-- Table structure for banks
-- ----------------------------
CREATE TABLE `banks`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('Perusahaan','Kredit') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `account_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `contact_person` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `contact_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of banks
-- ----------------------------
INSERT INTO `banks` VALUES (1, 'BCA KCP', 'Perusahaan', '011112222', 'PT. Rejeki Persada', NULL, NULL, NULL, NULL, '2025-09-19 03:27:06', '2025-09-19 03:27:06');
INSERT INTO `banks` VALUES (2, 'BTN KC MAKASSAR', 'Kredit', '00000ZXXXXXX', '-', NULL, NULL, NULL, NULL, '2025-09-24 09:19:17', '2025-09-24 09:19:17');
INSERT INTO `banks` VALUES (3, 'BTN KCP PANAKUKANG', 'Kredit', '-', '-', NULL, NULL, NULL, NULL, '2025-09-24 09:19:47', '2025-09-24 09:19:47');

-- ----------------------------
-- Table structure for barangs
-- ----------------------------
CREATE TABLE `barangs`  (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `kategoris_id` bigint(20) UNSIGNED NULL DEFAULT NULL,
  `merks_id` bigint(20) UNSIGNED NULL DEFAULT NULL,
  `satuan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `hpp` decimal(14, 2) NULL DEFAULT NULL,
  `ket` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of barangs
-- ----------------------------
INSERT INTO `barangs` VALUES (1, 'TALI TUKANG', 9, NULL, 'BH', NULL, 'tedt', NULL, '2024-11-04 11:10:33', '2025-03-24 08:17:11');
INSERT INTO `barangs` VALUES (2, 'PASIR', 1, NULL, 'RET', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (3, 'PAPAN 2X20', 8, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (4, 'BALOK 4X6', 8, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (5, 'BATU GUNUNG', 10, NULL, 'RET', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (6, 'SEMEN', 4, NULL, 'SAK', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (7, 'PAKU 7 & 10', 3, NULL, 'KG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (8, 'BATU MERAH UKURAN BESAR', 10, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (9, 'KUSEN JENDELA', 11, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (11, 'VENTILASI', 11, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (12, 'KANAL C', 12, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (13, 'RENG', 8, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (14, 'HOLLOW 2X4', 13, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (15, 'SPANDEK PENDEK (7,50 m)', 6, NULL, 'LEMBAR', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (16, 'SPANDEK SEDANG (7,80 m)', 6, NULL, 'LEMBAR', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (17, 'SPANDEK PANJANG (8,95 m)', 6, NULL, 'LEMBAR', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (18, 'TEGEL 40X40', 7, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (19, 'TEGEL 20X20', 7, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (20, 'TEGEL 20X25', 7, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (21, 'WC', 15, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (22, 'DAPUR', 16, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (23, 'TEGEL 40X20 (DEPAN RUMAH)', 7, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (24, 'NAT TEGEL', 4, NULL, 'BKS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (25, 'CAT DALAM (KIMEX 600) DIVINITY', 5, NULL, 'PILE', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (26, 'CAT PLAFON (KIMEX 660) BRILIANT', 5, NULL, 'PILE', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (27, 'CAT LUAR (JOTUN BLUE/GREEN)', 5, NULL, 'PILE', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (28, 'CAT PEMBATAS & LISTPLANK (JOTUN)', 5, NULL, 'EMBER KECIL', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (29, 'CAT KUSEN GLOVIN/AVIAN PUTIH', 5, NULL, 'KLG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (30, 'AFDUNNER', 9, NULL, 'BTL', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (31, 'KALSIBOARD', 9, NULL, 'LBR', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (32, 'CORNISH', 9, NULL, 'SAK', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (33, 'LAKBAN/PERBAN PLAFON', 9, NULL, 'ROLL', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (34, 'PAKU BETON 5', 3, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (35, 'PAKU BETON 7', 3, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (36, 'PINTU WC', 11, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (37, 'BAK CUCI PIRING/WASHTAFEL', 16, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (38, 'DAUN PINTU', 11, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (39, 'DAUN JENDELA', 11, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (40, 'KAPE KECIL UNTUK PLAFON', 9, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (41, 'KAPE BESAR UNTUK PLESTER', 9, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (42, 'KUAS 4\" (BISA DIPAKAI 2-3 RUMAH)', 14, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (43, 'KUAS 2\" (BISA DIPAKAI 2-3 RUMAH)', 14, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (44, 'KUAS ROLL (BISA DIPAKAI 2 RUMAH)', 14, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (45, 'BAUT PLAFON/skrup hitam', 3, NULL, 'DUS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (46, 'BAUT KANAL C', 3, NULL, 'DOS', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (47, 'BAUT SPANDEK', 3, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (48, 'KARET BAUT SPANDEK', 3, NULL, 'BH', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (49, 'Besi Ø6', 13, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (50, 'Besi Ø8', 13, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (51, 'Besi Ø10', 13, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (52, 'Besi Ø12', 13, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (53, 'CAT TEMBOK NIPPONT PAINT 5KG', 5, NULL, 'KLG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (54, 'BESI 5mm', 13, NULL, 'BTG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (56, 'PAKU BETON', 3, NULL, 'KG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (57, 'PAKU BETON KECIL', 3, NULL, 'KG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (58, 'PAKU BTN KECIL (KG)', 3, NULL, 'KG', NULL, NULL, NULL, '2024-11-04 11:10:33', '2024-11-04 11:10:33');
INSERT INTO `barangs` VALUES (59, 'Cat Avian Merah 200 ML', 5, NULL, 'KLG', NULL, 'Test Input barang cat', NULL, '2024-11-18 07:28:57', '2024-11-18 07:49:52');

-- ----------------------------
-- Table structure for failed_jobs
-- ----------------------------
CREATE TABLE `failed_jobs`  (
  `id` bigint(20) 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(0) NOT NULL DEFAULT current_timestamp(0),
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `failed_jobs_uuid_unique`(`uuid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- 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(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) 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(11) NULL DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for jobs
-- ----------------------------
CREATE TABLE `jobs`  (
  `id` bigint(20) 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(3) UNSIGNED NOT NULL,
  `reserved_at` int(10) UNSIGNED NULL DEFAULT NULL,
  `available_at` int(10) UNSIGNED NOT NULL,
  `created_at` int(10) UNSIGNED NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `jobs_queue_index`(`queue`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for menus
-- ----------------------------
CREATE TABLE `menus`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `route_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `permission_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `order` int(11) NOT NULL DEFAULT 0,
  `parent_id` bigint(20) UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `menus_parent_id_foreign`(`parent_id`) USING BTREE,
  CONSTRAINT `menus_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of menus
-- ----------------------------
INSERT INTO `menus` VALUES (1, 'Dashboard', 'fas fa-home', 'dashboard', NULL, NULL, 10, NULL, '2025-07-25 03:45:46', '2025-07-25 03:45:46');
INSERT INTO `menus` VALUES (2, 'Manajemen User', 'fas fa-users', 'users.index', NULL, 'view users', 20, 10, '2025-07-25 03:45:46', '2025-07-25 03:45:46');
INSERT INTO `menus` VALUES (3, 'Manajemen Proyek', 'fas fa-cubes', NULL, NULL, 'view projects', 30, NULL, '2025-07-25 03:45:46', '2025-07-25 03:45:46');
INSERT INTO `menus` VALUES (4, 'Daftar Siteplan', 'fas fa-mountain-city', 'projects.index', NULL, 'view projects', 31, 3, '2025-07-25 03:45:46', '2025-07-25 03:45:46');
INSERT INTO `menus` VALUES (9, 'Manajemen Role', 'fas fa-user-tag', 'roles.index', NULL, 'view roles', 25, 10, '2025-07-25 03:45:46', '2025-07-25 03:45:46');
INSERT INTO `menus` VALUES (10, 'Settings', 'fas fa-gears', NULL, NULL, NULL, 50, NULL, '2025-07-25 11:09:11', '2025-07-25 11:09:19');
INSERT INTO `menus` VALUES (11, 'Daftar Pekerjaan', 'fas fa-solid fa-trowel-bricks', 'stages.index', NULL, 'view stages', 33, 3, '2025-07-30 15:20:46', '2025-07-30 15:20:48');
INSERT INTO `menus` VALUES (12, 'Master Data', 'fas fa-database', NULL, NULL, NULL, 11, NULL, '2025-09-19 09:48:03', '2025-09-19 09:48:09');
INSERT INTO `menus` VALUES (13, 'Data Bank', 'fas fa-building-columns', 'banks.index', NULL, 'view banks', 11, 12, '2025-09-19 09:49:08', '2025-09-19 09:49:12');
INSERT INTO `menus` VALUES (14, 'Data Customer', 'fas fa-user', 'customers.index', NULL, 'view customers', 11, 12, '2025-09-19 09:49:08', '2025-09-19 09:49:12');
INSERT INTO `menus` VALUES (15, 'Data Marketing/Sales', 'fas fa-people-group', 'salesmen.index', NULL, 'view salesmen', 11, 12, '2025-09-19 09:49:12', '2025-09-19 09:49:12');
INSERT INTO `menus` VALUES (16, 'Transaksi', 'fas fa-regular fa-tags', NULL, NULL, NULL, 40, NULL, '2025-09-19 09:49:12', '2025-09-19 09:49:12');
INSERT INTO `menus` VALUES (18, 'Penjualan', 'fas fa-regular fa-shop', 'sales.index', NULL, NULL, 0, 16, '2025-09-19 09:49:12', '2025-09-19 09:49:12');

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

-- ----------------------------
-- Records of migrations
-- ----------------------------
INSERT INTO `migrations` VALUES (1, '0001_01_01_000000_create_users_table', 1);
INSERT INTO `migrations` VALUES (2, '0001_01_01_000001_create_cache_table', 1);
INSERT INTO `migrations` VALUES (3, '0001_01_01_000002_create_jobs_table', 1);
INSERT INTO `migrations` VALUES (4, '2025_07_23_033927_add_username_and_role_to_users_table', 1);
INSERT INTO `migrations` VALUES (5, '2025_07_23_062946_create_permission_tables', 2);
INSERT INTO `migrations` VALUES (6, '2025_07_23_064505_create_menus_table', 3);
INSERT INTO `migrations` VALUES (7, '2025_07_25_041252_create_projects_table', 4);
INSERT INTO `migrations` VALUES (8, '2025_07_25_080305_add_address_city_pic_phone_to_projects_table', 5);
INSERT INTO `migrations` VALUES (9, '2025_07_25_080402_add_address_city_pic_phone_to_projects_table2', 6);
INSERT INTO `migrations` VALUES (10, '2025_07_25_090536_create_units_table', 7);
INSERT INTO `migrations` VALUES (11, '2025_07_28_081112_create_stages_table', 8);
INSERT INTO `migrations` VALUES (12, '2025_07_28_081112_create_unit_stage_progress_table', 8);
INSERT INTO `migrations` VALUES (13, '2025_09_10_070605_add_denah_and_design_to_units_table', 9);
INSERT INTO `migrations` VALUES (14, '2025_09_11_152003_add_parent_id_to_stages_table', 10);
INSERT INTO `migrations` VALUES (15, '2025_09_18_090932_create_customers_table', 11);
INSERT INTO `migrations` VALUES (16, '2025_09_18_091419_add_field_to_customer', 12);
INSERT INTO `migrations` VALUES (17, '2025_09_19_023221_create_table_banks', 13);
INSERT INTO `migrations` VALUES (18, '2025_09_19_024028_add_field_address_to_bank', 14);
INSERT INTO `migrations` VALUES (19, '2025_09_19_081621_add_parent_id_to_unit_stages', 15);
INSERT INTO `migrations` VALUES (20, '2025_09_24_143126_create_table_sales', 16);
INSERT INTO `migrations` VALUES (21, '2025_09_24_150134_update_customers_table', 17);
INSERT INTO `migrations` VALUES (22, '2025_09_24_151054_create_table_customers', 18);
INSERT INTO `migrations` VALUES (23, '2025_09_24_151255_create_table_sales', 19);
INSERT INTO `migrations` VALUES (24, '2025_09_24_154033_create_table_salesmen', 20);

-- ----------------------------
-- Table structure for model_has_permissions
-- ----------------------------
CREATE TABLE `model_has_permissions`  (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`, `model_id`, `model_type`) USING BTREE,
  INDEX `model_has_permissions_model_id_model_type_index`(`model_id`, `model_type`) 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;

-- ----------------------------
-- Table structure for model_has_roles
-- ----------------------------
CREATE TABLE `model_has_roles`  (
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  PRIMARY KEY (`role_id`, `model_id`, `model_type`) USING BTREE,
  INDEX `model_has_roles_model_id_model_type_index`(`model_id`, `model_type`) 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 (1, 'App\\Models\\User', 1);
INSERT INTO `model_has_roles` VALUES (1, 'App\\Models\\User', 5);
INSERT INTO `model_has_roles` VALUES (2, 'App\\Models\\User', 2);
INSERT INTO `model_has_roles` VALUES (2, 'App\\Models\\User', 3);
INSERT INTO `model_has_roles` VALUES (4, 'App\\Models\\User', 4);

-- ----------------------------
-- Table structure for permissions
-- ----------------------------
CREATE TABLE `permissions`  (
  `id` bigint(20) 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(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `permissions_name_guard_name_unique`(`name`, `guard_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of permissions
-- ----------------------------
INSERT INTO `permissions` VALUES (1, 'view users', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (2, 'create users', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (3, 'edit users', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (4, 'delete users', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (5, 'view projects', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (6, 'create projects', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (7, 'edit projects', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (8, 'delete projects', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (9, 'view units', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (10, 'create units', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (11, 'edit units', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (12, 'delete units', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `permissions` VALUES (13, 'view roles', 'web', '2025-07-25 03:44:52', '2025-07-25 03:44:52');
INSERT INTO `permissions` VALUES (14, 'create roles', 'web', '2025-07-25 03:44:52', '2025-07-25 03:44:52');
INSERT INTO `permissions` VALUES (15, 'edit roles', 'web', '2025-07-25 03:44:52', '2025-07-25 03:44:52');
INSERT INTO `permissions` VALUES (16, 'delete roles', 'web', '2025-07-25 03:44:52', '2025-07-25 03:44:52');
INSERT INTO `permissions` VALUES (17, 'view stages', 'web', '2025-07-30 15:15:15', '2025-07-30 15:15:18');
INSERT INTO `permissions` VALUES (18, 'create stages', 'web', '2025-07-30 15:15:44', '2025-07-30 15:15:47');
INSERT INTO `permissions` VALUES (19, 'edit stages', 'web', '2025-07-30 15:16:03', '2025-07-30 15:16:06');
INSERT INTO `permissions` VALUES (20, 'delete stages', 'web', '2025-07-30 15:16:21', '2025-07-30 15:16:23');
INSERT INTO `permissions` VALUES (21, 'manage stages', 'web', '2025-08-06 07:58:21', '2025-08-06 07:58:21');
INSERT INTO `permissions` VALUES (22, 'manage units', 'web', '2025-09-12 16:36:05', '2025-09-12 16:36:08');
INSERT INTO `permissions` VALUES (23, 'view unit progress', 'web', '2025-09-12 17:37:12', '2025-09-12 17:37:15');
INSERT INTO `permissions` VALUES (24, 'create unit progress', 'web', '2025-09-12 17:37:31', '2025-09-12 17:37:34');
INSERT INTO `permissions` VALUES (25, 'edit unit progress', 'web', '2025-09-12 17:37:50', '2025-09-12 17:37:52');
INSERT INTO `permissions` VALUES (26, 'delete unit progress', 'web', '2025-09-12 17:38:06', '2025-09-12 17:38:09');
INSERT INTO `permissions` VALUES (27, 'update unit progress', 'web', '2025-09-12 17:38:44', '2025-09-12 17:38:47');
INSERT INTO `permissions` VALUES (28, 'view harga pokok', 'web', '2025-09-17 14:07:34', '2025-09-17 14:07:37');
INSERT INTO `permissions` VALUES (29, 'view banks', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (30, 'create banks', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (31, 'edit banks', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (32, 'delete banks', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (33, 'view customers', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (34, 'create customers', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (35, 'edit customers', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (36, 'delete customers', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (37, 'view marketings', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (38, 'create marketings', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (39, 'edit martketings', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (40, 'delete marketings', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (44, 'view salesmen', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (45, 'create salesmen', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (46, 'edit salesmen', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (47, 'delete salesmen', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (48, 'view komisi salesmen', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');
INSERT INTO `permissions` VALUES (49, 'edit komisi salesmen', 'web', '2025-09-19 10:31:44', '2025-09-19 10:31:48');

-- ----------------------------
-- Table structure for projects
-- ----------------------------
CREATE TABLE `projects`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `image_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  `alamat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `kota` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `telp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of projects
-- ----------------------------
INSERT INTO `projects` VALUES (1, 'MUTIARA KARIANGO 1', 'MUTIARA KARIANGO 1', NULL, 'ongoing', 'projects/MjuNTVaaKF9gcM3GaQLMMhPrNiC3sRQEEKIn1HR5.jpg', '2025-07-25 08:19:41', '2025-07-28 09:00:17', 'Dusun Bombongi Desa Tenrigangkae, Dusun Mangento Desa Pattontongan, Desa/Kelurahan Tenrigangkae, Kec. Mandai, Kab. Maros,', 'Kabupaten Maros', 'Benhard Kevin Sentosa Litoy', '0811442161');
INSERT INTO `projects` VALUES (2, 'ATRIA RESIDENCE GALESONG', 'ATRIA RESIDENCE GALESONG', NULL, 'ongoing', 'projects/vxalunMsj0oGjxWGrncurz9XEWMvd0DYhPINQDdm.jpg', '2025-07-28 08:29:03', '2025-07-28 08:59:50', 'Jl. Baso Beta, Bontolebang, Kec. Galesong Utara, Makassar, Sulawesi Selatan', 'Kabupaten Galesong Utara', 'Benhard Kevin Sentosa Litoy', '0811442161');
INSERT INTO `projects` VALUES (3, 'PROYEK 3', NULL, NULL, 'pending', NULL, '2025-09-12 07:26:23', '2025-09-17 07:46:02', 'JL. GAJAH MADA', 'JAKARTA', 'BUDI', '08889999');

-- ----------------------------
-- Table structure for role_has_permissions
-- ----------------------------
CREATE TABLE `role_has_permissions`  (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`, `role_id`) USING BTREE,
  INDEX `role_has_permissions_role_id_foreign`(`role_id`) 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
-- ----------------------------
INSERT INTO `role_has_permissions` VALUES (1, 1);
INSERT INTO `role_has_permissions` VALUES (2, 1);
INSERT INTO `role_has_permissions` VALUES (3, 1);
INSERT INTO `role_has_permissions` VALUES (4, 1);
INSERT INTO `role_has_permissions` VALUES (5, 1);
INSERT INTO `role_has_permissions` VALUES (5, 2);
INSERT INTO `role_has_permissions` VALUES (5, 3);
INSERT INTO `role_has_permissions` VALUES (5, 4);
INSERT INTO `role_has_permissions` VALUES (5, 5);
INSERT INTO `role_has_permissions` VALUES (6, 1);
INSERT INTO `role_has_permissions` VALUES (7, 1);
INSERT INTO `role_has_permissions` VALUES (7, 3);
INSERT INTO `role_has_permissions` VALUES (8, 1);
INSERT INTO `role_has_permissions` VALUES (9, 1);
INSERT INTO `role_has_permissions` VALUES (9, 2);
INSERT INTO `role_has_permissions` VALUES (9, 3);
INSERT INTO `role_has_permissions` VALUES (9, 4);
INSERT INTO `role_has_permissions` VALUES (9, 5);
INSERT INTO `role_has_permissions` VALUES (10, 1);
INSERT INTO `role_has_permissions` VALUES (11, 1);
INSERT INTO `role_has_permissions` VALUES (11, 3);
INSERT INTO `role_has_permissions` VALUES (12, 1);
INSERT INTO `role_has_permissions` VALUES (13, 1);
INSERT INTO `role_has_permissions` VALUES (14, 1);
INSERT INTO `role_has_permissions` VALUES (15, 1);
INSERT INTO `role_has_permissions` VALUES (16, 1);
INSERT INTO `role_has_permissions` VALUES (17, 1);
INSERT INTO `role_has_permissions` VALUES (18, 1);
INSERT INTO `role_has_permissions` VALUES (19, 1);
INSERT INTO `role_has_permissions` VALUES (20, 1);
INSERT INTO `role_has_permissions` VALUES (21, 1);
INSERT INTO `role_has_permissions` VALUES (22, 1);
INSERT INTO `role_has_permissions` VALUES (23, 1);
INSERT INTO `role_has_permissions` VALUES (24, 1);
INSERT INTO `role_has_permissions` VALUES (25, 1);
INSERT INTO `role_has_permissions` VALUES (26, 1);
INSERT INTO `role_has_permissions` VALUES (27, 1);
INSERT INTO `role_has_permissions` VALUES (28, 1);
INSERT INTO `role_has_permissions` VALUES (29, 1);
INSERT INTO `role_has_permissions` VALUES (30, 1);
INSERT INTO `role_has_permissions` VALUES (31, 1);
INSERT INTO `role_has_permissions` VALUES (32, 1);
INSERT INTO `role_has_permissions` VALUES (33, 1);
INSERT INTO `role_has_permissions` VALUES (33, 2);
INSERT INTO `role_has_permissions` VALUES (34, 1);
INSERT INTO `role_has_permissions` VALUES (34, 2);
INSERT INTO `role_has_permissions` VALUES (35, 1);
INSERT INTO `role_has_permissions` VALUES (35, 2);
INSERT INTO `role_has_permissions` VALUES (36, 1);
INSERT INTO `role_has_permissions` VALUES (44, 1);
INSERT INTO `role_has_permissions` VALUES (44, 2);
INSERT INTO `role_has_permissions` VALUES (45, 1);
INSERT INTO `role_has_permissions` VALUES (46, 1);
INSERT INTO `role_has_permissions` VALUES (47, 1);
INSERT INTO `role_has_permissions` VALUES (48, 1);
INSERT INTO `role_has_permissions` VALUES (49, 1);

-- ----------------------------
-- Table structure for roles
-- ----------------------------
CREATE TABLE `roles`  (
  `id` bigint(20) 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(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `roles_name_guard_name_unique`(`name`, `guard_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of roles
-- ----------------------------
INSERT INTO `roles` VALUES (1, 'admin', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `roles` VALUES (2, 'sales', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `roles` VALUES (3, 'developer', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `roles` VALUES (4, 'user', 'web', '2025-07-23 06:30:20', '2025-07-23 06:30:20');
INSERT INTO `roles` VALUES (5, 'Gudang', 'web', '2025-07-25 03:54:12', '2025-07-25 03:54:12');

-- ----------------------------
-- Table structure for sales
-- ----------------------------
CREATE TABLE `sales`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `sale_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `booking_fee` decimal(15, 2) NOT NULL,
  `down_payment` decimal(15, 2) NULL DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `kpr_bank` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `akad_date` date NULL DEFAULT NULL,
  `plafon_amount` decimal(15, 2) NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `sales_sale_number_unique`(`sale_number`) USING BTREE,
  INDEX `sales_unit_id_foreign`(`unit_id`) USING BTREE,
  INDEX `sales_customer_id_foreign`(`customer_id`) USING BTREE,
  CONSTRAINT `sales_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `sales_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for salesmen
-- ----------------------------
CREATE TABLE `salesmen`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `commission_rate` decimal(5, 2) NOT NULL DEFAULT 0,
  `joint_date` date NULL DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `salesmen_email_unique`(`email`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of salesmen
-- ----------------------------
INSERT INTO `salesmen` VALUES (1, 'Budi', 'boedy@example.com', '08568808234', 0.00, NULL, 'active', '2025-09-24 16:00:38', '2025-09-24 16:00:38');
INSERT INTO `salesmen` VALUES (2, 'Yudi', 'yudi@persadan.com', '99922222', 0.00, NULL, 'active', '2025-09-24 16:19:21', '2025-09-24 16:19:21');

-- ----------------------------
-- Table structure for sessions
-- ----------------------------
CREATE TABLE `sessions`  (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint(20) 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(11) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sessions_user_id_index`(`user_id`) USING BTREE,
  INDEX `sessions_last_activity_index`(`last_activity`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sessions
-- ----------------------------
INSERT INTO `sessions` VALUES ('5s9w1ufgt3zTTkE290Bvh7godMBQuQZekwzvxyFF', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoicGREU0dkNWhxUGxpTjRaYm02eEtDVjNXYXl4aEI1Y3JiUU9GVU82cSI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzQ6Imh0dHA6Ly9sb2NhbGhvc3Q6ODAwMC9zYWxlcy9jcmVhdGUiO31zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1758911555);
INSERT INTO `sessions` VALUES ('fhPe6T2fBsYrYHrJ5d4bjcEe9YTJMtDmeTrkt0Mc', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiOXNRZWJqSld2UjNqY2Rzc21zQlJJbnNMWlJmZzRsZUxtRUdISWlTUCI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czozNDoiaHR0cDovL2xvY2FsaG9zdDo4MDAwL3NhbGVzL2NyZWF0ZSI7fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjI3OiJodHRwOi8vbG9jYWxob3N0OjgwMDAvbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1758964347);
INSERT INTO `sessions` VALUES ('ImcDll8xjyDuuWG4vMLQYPcaBrmEWeyoa3ufIWDH', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiS2xuaXh2MDVZU0pCNlNNZUV0N1N4QU9vTjk1N2tvczl2V09lRm5PdiI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czozNDoiaHR0cDovL2xvY2FsaG9zdDo4MDAwL3NhbGVzL2NyZWF0ZSI7fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjI3OiJodHRwOi8vbG9jYWxob3N0OjgwMDAvbG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1758998942);
INSERT INTO `sessions` VALUES ('K7tbnJLMO8x5J1GqkhC3tXriyXB5jD81DQ12zOjt', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiczNyemRIZkViNVF0U0tVeEs3SUpTZ1o0N0hHWjZuTGwxWndBTkh2eSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzQ6Imh0dHA6Ly9sb2NhbGhvc3Q6ODAwMC9zYWxlcy9jcmVhdGUiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1758984312);
INSERT INTO `sessions` VALUES ('vkjz69c8do0XlCmMyF0rP0AEqVU3ipR0WEj0iGEz', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoianUyZ09Xckhvdk1SYTJIRUVXR2picjhNdTkwNGpWWnYwZ3NrQVNsdCI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czozNDoiaHR0cDovL2xvY2FsaG9zdDo4MDAwL3NhbGVzL2NyZWF0ZSI7fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjM0OiJodHRwOi8vbG9jYWxob3N0OjgwMDAvc2FsZXMvY3JlYXRlIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1758749264);

-- ----------------------------
-- Table structure for stages
-- ----------------------------
CREATE TABLE `stages`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `order` int(11) NOT NULL,
  `parent_id` bigint(20) UNSIGNED NULL DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `stages_name_unique`(`name`) USING BTREE,
  INDEX `stages_parent_id_foreign`(`parent_id`) USING BTREE,
  CONSTRAINT `stages_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `stages` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 69 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of stages
-- ----------------------------
INSERT INTO `stages` VALUES (1, 'PEKERJAAN BATU', 1, NULL, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (2, 'PEKERJAAN BESI', 2, NULL, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (3, 'PEKERJAAN KAYU & BAJA RINGAN', 3, NULL, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (4, 'PEKERJAAN CAT', 4, NULL, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (5, 'PEKERJAAN INSTALASI AIR BERSIH & KOTOR', 5, NULL, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (6, 'Pasang Bouwpalnk1', 1, 1, NULL, '2025-09-11 22:50:05', '2025-09-12 02:31:52');
INSERT INTO `stages` VALUES (7, 'Galian Pondasi', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (8, 'Pasang Bantu Kosong', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (9, 'Urugan Kembali Pondasi', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (10, 'Pasang Pondasi Batu Gunung/Kali', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (11, 'Pasang Mal & Cor Sloof', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (12, 'Timbunan Dalam Rumah', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (13, 'Pasangan Transram & Dinding Batu Merah', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (14, 'Stel Kusen Pintu & Jendela', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (15, 'Pasang Mal & Cor Kolom', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (16, 'Pasang Mal & Cor Ringbalk', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (17, 'Pasang Roster kayu', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (18, 'Pasang Mal & Cor Kanopi Plat Teras depan', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (19, 'Balok Latei', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (20, 'Pasang Mal & Cor Meja Dapur + Pembesian', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (21, 'Pasangan Dinding Kuda-Kuda Batu Merah', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (22, 'Pasang Dinding Pembatas atap batu merah', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (23, 'Pasang Mal & Cor Kuda-Kuda', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (24, 'Pasang Mal & Cor Sopi-Sopi', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (25, 'Plesteran Dinding Bag. Dalam', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (26, 'Plesteran Dinding Bagian Luar', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (27, 'Les Profil Bagian Depan Kamar Tidur', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (28, 'Acian Dinding Bagian Dalam', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (29, 'Acian Dinding Bagian Luar', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (30, 'Hamparan pasir & Rabat beton carport', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (31, 'Pasang keramik lantai rumah', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (32, 'Pasang keramik teras depan', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (33, 'Pasang keramik teras belakang', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (34, 'Pasang keramik lantai km/wc & floor drain', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (35, 'Pasang keramik dinding km/wc (T 120cm)', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (36, 'Pasang keramik dinding, Meja dapur & washtafel', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (37, 'Pasang keramik dinding depan (40 x 40 cm )', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (38, 'Pasang kloset jongkok', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (39, 'Septick Tank ( 0-100% )', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (40, 'Jembatan Masuk Rumah ( 0-100% )', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (41, 'Pagar batas rumah ( 0-100% )', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (42, 'Timbunan Halaman', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (43, 'Pembersihan (Rumah & Halaman)', 0, 1, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (44, 'Besi Sloof 15/20 (Besi 10 Mm - Beugel 8 Mm)', 0, 2, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (45, 'Besi Kolom 15/20 (Besi 10 Mm - Beugel 8 Mm)', 0, 2, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (46, 'Besi Ringbalk 15/20 (Besi 10 Mm - Beugel 8 Mm)', 0, 2, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (47, 'Besi Kuda-Kuda 15/20 (Besi 10 Mm-Beugel 8 Mm)', 0, 2, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (48, 'Besi Balok Latei', 0, 2, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (49, 'Besi Sopi-Sopi', 0, 2, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (50, 'Besi Plat Kanopi teras depan', 0, 2, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (51, 'Pasang Rangka Plapond (Holo 2X4)', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (52, 'Pasang Plapond Kalsiboard', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (53, 'Pasang Rangka Atap Baja Ringan (0,65/75)', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (54, 'Pasang Reng Untuk Atap Spandek', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (55, 'Pasang Atap Spandek', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (56, 'Pasang Listplank Kalsiboard', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (57, 'Setel, Pasang Engsel & Kunci Pintu ', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (58, 'Pasang Kaca, Setel, Engsel & Hak Angin Jendela', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (59, 'Setel & Pasang Kunci Pintu KM/WC (Aluminium)', 0, 3, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (60, 'Cat Dinding Rumah Bagian Dalam', 0, 4, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (61, 'Cat Dinding Rumah Bagian Luar', 0, 4, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (62, 'Plamur dan Cat Kusen & Daun Pintu', 0, 4, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (63, 'Plamur dan Cat Kusen Jendela & Daun Jendela', 0, 4, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (64, 'Cat Plafond Bagian Dalam', 0, 4, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (65, 'Cat Plafond Bagian Luar', 0, 4, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (66, 'Cat Listplank Kalsiboard', 0, 4, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (67, 'Pasang Instalasi Pipa Pembuangan Air Kotor ', 0, 5, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');
INSERT INTO `stages` VALUES (68, 'Pasang Instalasi Pipa Air Bersih + Kran Air', 0, 5, NULL, '2025-09-11 22:50:05', '2025-09-11 22:50:05');

-- ----------------------------
-- Table structure for unit_stage_progress
-- ----------------------------
CREATE TABLE `unit_stage_progress`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `stage_id` bigint(20) UNSIGNED NOT NULL,
  `progress_percentage` int(11) NOT NULL DEFAULT 0,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Not Started',
  `start_date` date NULL DEFAULT NULL,
  `end_date` date NULL DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unit_stage_progresses_unit_id_stage_id_unique`(`unit_id`, `stage_id`) USING BTREE,
  INDEX `unit_stage_progresses_stage_id_foreign`(`stage_id`) USING BTREE,
  CONSTRAINT `unit_stage_progresses_stage_id_foreign` FOREIGN KEY (`stage_id`) REFERENCES `stages` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `unit_stage_progresses_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of unit_stage_progress
-- ----------------------------
INSERT INTO `unit_stage_progress` VALUES (3, 5, 7, 75, 'Sedang Dikerjakan', '2025-09-12', '2025-09-22', NULL, '2025-09-12 09:46:25', '2025-09-22 09:28:36');
INSERT INTO `unit_stage_progress` VALUES (7, 1, 7, 20, 'Sedang Dikerjakan', '2025-09-16', '2025-09-16', NULL, '2025-09-16 06:33:44', '2025-09-16 06:33:44');
INSERT INTO `unit_stage_progress` VALUES (8, 5, 8, 100, 'Selesai', '2025-09-16', '2025-09-16', NULL, '2025-09-16 09:22:18', '2025-09-16 09:22:18');
INSERT INTO `unit_stage_progress` VALUES (9, 8, 7, 50, 'Sedang Dikerjakan', '2025-09-16', '2025-09-16', NULL, '2025-09-16 14:21:17', '2025-09-16 14:21:17');
INSERT INTO `unit_stage_progress` VALUES (10, 5, 9, 50, 'Not Started', NULL, NULL, NULL, '2025-09-18 08:45:45', '2025-09-18 08:45:45');
INSERT INTO `unit_stage_progress` VALUES (13, 6, 7, 100, 'Not Started', '2025-09-22', '2025-09-22', NULL, '2025-09-22 14:29:10', '2025-09-22 14:29:10');

-- ----------------------------
-- Table structure for unit_stage_progresses
-- ----------------------------
CREATE TABLE `unit_stage_progresses`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `stage_id` bigint(20) UNSIGNED NOT NULL,
  `progress_percentage` decimal(5, 2) NOT NULL DEFAULT 0,
  `tanggal_progres` date NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `document_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for units
-- ----------------------------
CREATE TABLE `units`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `project_id` bigint(20) UNSIGNED NOT NULL,
  `nama_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `alamat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '',
  `luas_tanah` decimal(10, 2) NULL DEFAULT 0,
  `lebih_tanah` double(10, 2) NULL DEFAULT 0,
  `luas_bangunan` double NULL DEFAULT NULL,
  `harga` decimal(15, 2) NULL DEFAULT NULL,
  `harga_jual` decimal(15, 2) NULL DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `jumlah_kamar_tidur` int(11) NULL DEFAULT NULL,
  `jumlah_kamar_mandi` int(11) NULL DEFAULT NULL,
  `deskripsi` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `image_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `denah_image_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `design_image_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_at` timestamp(0) NULL DEFAULT NULL,
  `updated_at` timestamp(0) NULL DEFAULT NULL,
  `lantai` decimal(3, 1) NULL DEFAULT 1,
  `subsidi` bigint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `units_project_id_foreign`(`project_id`) USING BTREE,
  CONSTRAINT `units_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of units
-- ----------------------------
INSERT INTO `units` VALUES (1, 1, 'Aster BLOK A1/1', '', 72.00, 0.00, 36, 120000000.00, 150000000.00, 'available', 2, 1, 'fsdfsfsf', 'units/GpRsE3qpLnzsBQsajMm9dxgukBpR0UcDreeAQCpb.jpg', NULL, NULL, '2025-07-25 09:26:56', '2025-07-28 07:31:33', 1.0, 0);
INSERT INTO `units` VALUES (2, 1, 'Aster BLOK A1/2', '', 72.00, 0.00, 36, 120000000.00, 150000000.00, 'available', 1, 0, 'dfdfdfdfd', NULL, NULL, NULL, '2025-07-28 07:30:22', '2025-07-28 07:30:22', 1.0, 0);
INSERT INTO `units` VALUES (3, 2, 'ATRIA BLOK A01', '', 60.00, 0.00, 36, NULL, 15000000.00, 'available', 2, 1, 'test', NULL, NULL, NULL, '2025-09-10 04:21:05', '2025-09-10 04:21:05', 1.0, 0);
INSERT INTO `units` VALUES (4, 2, 'ATRIA BLOK A02', '', 60.00, 0.00, 36, NULL, 150000000.00, 'available', 2, 1, 'test2', NULL, NULL, NULL, '2025-09-10 06:19:21', '2025-09-10 06:19:21', 1.0, 0);
INSERT INTO `units` VALUES (5, 3, 'BLOK A01', NULL, 60.00, 0.00, 36, NULL, 150000000.00, 'available', 2, 1, NULL, 'units/OZigTSv7nfg0LcQrxI6UMUD7z7cXQm8I8Mn1Ansm.jpg', NULL, NULL, '2025-09-12 07:34:07', '2025-09-20 09:25:26', 1.0, 1);
INSERT INTO `units` VALUES (6, 3, 'BLOK A02', '', 60.00, 0.00, 36, 0.00, 150000000.00, 'available', 2, 1, NULL, NULL, NULL, NULL, '2025-09-12 08:27:26', '2025-09-12 08:27:26', 1.0, 1);
INSERT INTO `units` VALUES (7, 3, 'BLOK A03', '', 72.00, 0.00, 36, 0.00, 150000000.00, 'available', 2, 1, NULL, NULL, NULL, NULL, '2025-09-12 08:30:06', '2025-09-12 08:30:06', 1.0, NULL);
INSERT INTO `units` VALUES (8, 3, 'BLOK A04', '', 72.00, 0.00, 36, 0.00, 165000000.00, 'available', 2, 1, NULL, NULL, NULL, NULL, '2025-09-16 14:19:44', '2025-09-16 14:19:44', 1.0, 1);
INSERT INTO `units` VALUES (9, 3, 'BLOK A05', NULL, 60.00, 0.00, 36, NULL, 150000000.00, 'available', 2, 1, NULL, NULL, NULL, NULL, '2025-09-20 09:29:23', '2025-09-20 09:29:23', 1.0, 1);

