-- MariaDB dump 10.19  Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: localhost    Database: isp_management
-- ------------------------------------------------------
-- Server version	10.4.32-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `isp_management`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `isp_management` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `isp_management`;

--
-- Table structure for table `cache`
--

DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache`
--

LOCK TABLES `cache` WRITE;
/*!40000 ALTER TABLE `cache` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache_locks`
--

DROP TABLE IF EXISTS `cache_locks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_locks_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache_locks`
--

LOCK TABLES `cache_locks` WRITE;
/*!40000 ALTER TABLE `cache_locks` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache_locks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_code` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `postal_code` varchar(10) DEFAULT NULL,
  `pic_name` varchar(255) DEFAULT NULL,
  `pic_phone` varchar(30) DEFAULT NULL,
  `pic_email` varchar(255) DEFAULT NULL,
  `customer_type` enum('individual','company','government') NOT NULL DEFAULT 'company',
  `status` enum('prospect','active','inactive') NOT NULL DEFAULT 'prospect',
  `notes` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `customers_customer_code_unique` (`customer_code`),
  KEY `customers_created_by_foreign` (`created_by`),
  KEY `customers_name_index` (`name`),
  KEY `customers_company_name_index` (`company_name`),
  KEY `customers_status_index` (`status`),
  KEY `customers_customer_type_index` (`customer_type`),
  CONSTRAINT `customers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT INTO `customers` VALUES (1,'CUST-0001','PT Contoh Nusantara Updated','PT Contoh Nusantara','admin@contoh.co.id','0611234567','Jl. Contoh No. 10','Medan','Sumatera Utara','20111','Budi Santoso','081234567890','budi@contoh.co.id','company','active','Customer berhasil di-update melalui API.',1,'2026-08-21 20:47:34','2026-08-21 20:49:37','2026-08-21 20:49:37'),(2,'CUST-0002','PT Metro Test Survey','PT Metro Test Survey','admin@metrotest.co.id','0617654321','Jl. Gatot Subroto No. 20','Medan','Sumatera Utara','20123','Andi Wijaya','081234567891','andi@metrotest.co.id','company','prospect','Customer untuk pengujian modul Survey.',1,'2026-08-22 02:16:46','2026-08-22 02:16:46',NULL),(3,'CUST-DEMO-001','PT Demo Customer ISP','PT Demo Customer ISP','customer.demo@isp.local','0215551234','Jl. Demo ISP No. 1','Jakarta Selatan','DKI Jakarta','12345','Budi Demo','081234567890','budi.demo@example.com','company','prospect','Customer sementara untuk demo CRUD',1,'2026-08-26 01:21:10','2026-08-26 01:21:10',NULL),(4,'CUST-MEGANET-002','PT Megantara Solusi Nusantara','PT Megantara Solusi Nusantara','admin@megantara-solusi.co.id','0614529876','Jl. Diponegoro No. 88','Medan','Sumatera Utara','20152','Rian Kusuma','082198765432','rian.kusuma@megantara-solusi.co.id','company','active','Pelanggan corporate Dedicated Internet 100 Mbps',1,'2026-08-26 01:40:53','2026-08-26 01:40:53',NULL);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `designs`
--

DROP TABLE IF EXISTS `designs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `designs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `design_code` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `survey_id` bigint(20) unsigned NOT NULL,
  `design_date` date DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `design_type` varchar(255) DEFAULT NULL,
  `topology` text DEFAULT NULL,
  `pop_source` varchar(255) DEFAULT NULL,
  `access_medium` varchar(255) DEFAULT NULL,
  `cable_route_length` decimal(10,2) DEFAULT NULL,
  `bandwidth_mbps` int(10) unsigned DEFAULT NULL,
  `ip_plan` longtext DEFAULT NULL,
  `vlan_plan` longtext DEFAULT NULL,
  `equipment_plan` longtext DEFAULT NULL,
  `material_plan` longtext DEFAULT NULL,
  `technical_notes` longtext DEFAULT NULL,
  `revision_number` int(10) unsigned NOT NULL DEFAULT 1,
  `revision_notes` text DEFAULT NULL,
  `status` enum('draft','submitted','review','revision','approved') NOT NULL DEFAULT 'draft',
  `designed_by` bigint(20) unsigned DEFAULT NULL,
  `reviewed_by` bigint(20) unsigned DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `designs_design_code_unique` (`design_code`),
  KEY `designs_customer_id_foreign` (`customer_id`),
  KEY `designs_survey_id_foreign` (`survey_id`),
  KEY `designs_designed_by_foreign` (`designed_by`),
  KEY `designs_reviewed_by_foreign` (`reviewed_by`),
  KEY `designs_approved_by_foreign` (`approved_by`),
  KEY `designs_created_by_foreign` (`created_by`),
  KEY `designs_design_date_index` (`design_date`),
  KEY `designs_status_index` (`status`),
  KEY `designs_design_type_index` (`design_type`),
  CONSTRAINT `designs_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `designs_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `designs_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `designs_designed_by_foreign` FOREIGN KEY (`designed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `designs_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `designs_survey_id_foreign` FOREIGN KEY (`survey_id`) REFERENCES `surveys` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `designs`
--

LOCK TABLES `designs` WRITE;
/*!40000 ALTER TABLE `designs` DISABLE KEYS */;
INSERT INTO `designs` VALUES (1,'DES-0001',2,2,'2026-08-22','Design Dedicated Internet PT Metro Test Survey','Access Network','Customer -> ODP -> ODC -> POP Medan Barat','POP Medan Barat','Fiber Optic',1550.00,100,'Public /30 untuk WAN dan private network customer.','VLAN 210 untuk layanan customer.','1 Router, 1 ONT, 2 SFP, patchcord dan perangkat pendukung.','FO 1550 meter, patchcord, closure dan aksesoris instalasi.','Design sudah diperiksa internal dan siap diajukan untuk review.',1,NULL,'submitted',1,NULL,NULL,NULL,NULL,1,'2026-08-22 06:55:37','2026-08-22 06:57:30',NULL),(2,'DES-DELETE-TEST',2,2,NULL,'Design Dummy Untuk Test Delete',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,'draft',1,NULL,NULL,NULL,NULL,1,'2026-08-22 06:57:51','2026-08-22 06:58:05','2026-08-22 06:58:05');
/*!40000 ALTER TABLE `designs` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `failed_jobs` WRITE;
/*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `inventory_items`
--

DROP TABLE IF EXISTS `inventory_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `inventory_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `item_code` varchar(255) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `category` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `specification` text DEFAULT NULL,
  `unit` varchar(50) NOT NULL,
  `tracking_type` enum('bulk','serial') NOT NULL DEFAULT 'bulk',
  `minimum_stock` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `inventory_items_item_code_unique` (`item_code`),
  KEY `inventory_items_created_by_foreign` (`created_by`),
  KEY `inventory_items_item_name_index` (`item_name`),
  KEY `inventory_items_category_index` (`category`),
  KEY `inventory_items_status_index` (`status`),
  CONSTRAINT `inventory_items_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `inventory_items`
--

LOCK TABLES `inventory_items` WRITE;
/*!40000 ALTER TABLE `inventory_items` DISABLE KEYS */;
INSERT INTO `inventory_items` VALUES (1,'INV-0001','Fiber Optic Cable','Fiber Optic',NULL,NULL,'meter','bulk',0.00,'active',NULL,1,'2026-08-24 20:48:05','2026-08-24 20:48:05',NULL),(2,'INV-0002','SFP Module','Network Module',NULL,NULL,'pcs','serial',0.00,'active',NULL,1,'2026-08-24 20:48:06','2026-08-24 20:48:06',NULL),(3,'INV-0003','Router / CPE','Network Device',NULL,NULL,'unit','serial',0.00,'active',NULL,1,'2026-08-24 20:48:06','2026-08-24 20:48:06',NULL),(4,'INV-0004','Fiber Patch Cord','Fiber Optic',NULL,NULL,'pcs','bulk',0.00,'active',NULL,1,'2026-08-24 20:48:06','2026-08-24 20:48:06',NULL),(5,'INV-0005','Installation Accessories','Installation Material',NULL,NULL,'lot','bulk',0.00,'active',NULL,1,'2026-08-24 20:48:06','2026-08-24 20:48:06',NULL),(6,'INV-TEST-0001','Test Inventory Item Updated','Testing','CRUD Inventory update berhasil','Updated','pcs','bulk',10.00,'inactive','Siap dihapus',1,'2026-08-25 19:55:44','2026-08-25 19:56:52','2026-08-25 19:56:52');
/*!40000 ALTER TABLE `inventory_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `inventory_stocks`
--

DROP TABLE IF EXISTS `inventory_stocks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `inventory_stocks` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `inventory_item_id` bigint(20) unsigned NOT NULL,
  `quantity_on_hand` decimal(15,2) NOT NULL DEFAULT 0.00,
  `quantity_reserved` decimal(15,2) NOT NULL DEFAULT 0.00,
  `average_unit_cost` decimal(18,2) NOT NULL DEFAULT 0.00,
  `updated_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `inventory_stocks_inventory_item_id_unique` (`inventory_item_id`),
  KEY `inventory_stocks_updated_by_foreign` (`updated_by`),
  CONSTRAINT `inventory_stocks_inventory_item_id_foreign` FOREIGN KEY (`inventory_item_id`) REFERENCES `inventory_items` (`id`),
  CONSTRAINT `inventory_stocks_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `inventory_stocks`
--

LOCK TABLES `inventory_stocks` WRITE;
/*!40000 ALTER TABLE `inventory_stocks` DISABLE KEYS */;
INSERT INTO `inventory_stocks` VALUES (1,1,300.00,0.00,5133.76,1,'2026-08-24 20:48:06','2026-08-24 20:54:53'),(2,2,2.00,0.00,281369.43,1,'2026-08-24 20:48:06','2026-08-24 20:54:53'),(3,3,1.00,0.00,671337.58,1,'2026-08-24 20:48:06','2026-08-24 20:54:53'),(4,4,2.00,0.00,44426.75,1,'2026-08-24 20:48:06','2026-08-24 20:54:53'),(5,5,1.00,0.00,236942.68,1,'2026-08-24 20:48:06','2026-08-24 20:54:53');
/*!40000 ALTER TABLE `inventory_stocks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `inventory_transactions`
--

DROP TABLE IF EXISTS `inventory_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `inventory_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `transaction_code` varchar(255) NOT NULL,
  `inventory_item_id` bigint(20) unsigned NOT NULL,
  `transaction_type` enum('receipt','issue','return','adjustment_in','adjustment_out') NOT NULL,
  `transaction_date` date NOT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `unit_cost` decimal(18,2) NOT NULL DEFAULT 0.00,
  `total_cost` decimal(18,2) NOT NULL DEFAULT 0.00,
  `receiving_id` bigint(20) unsigned DEFAULT NULL,
  `receiving_item_id` bigint(20) unsigned DEFAULT NULL,
  `purchase_order_id` bigint(20) unsigned DEFAULT NULL,
  `project_id` bigint(20) unsigned DEFAULT NULL,
  `reference_type` varchar(255) DEFAULT NULL,
  `reference_id` bigint(20) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `inventory_transactions_transaction_code_unique` (`transaction_code`),
  UNIQUE KEY `inventory_transactions_receiving_item_id_unique` (`receiving_item_id`),
  KEY `inventory_transactions_inventory_item_id_foreign` (`inventory_item_id`),
  KEY `inventory_transactions_receiving_id_foreign` (`receiving_id`),
  KEY `inventory_transactions_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `inventory_transactions_project_id_foreign` (`project_id`),
  KEY `inventory_transactions_created_by_foreign` (`created_by`),
  KEY `inventory_transactions_transaction_type_index` (`transaction_type`),
  KEY `inventory_transactions_transaction_date_index` (`transaction_date`),
  KEY `inventory_transactions_reference_type_reference_id_index` (`reference_type`,`reference_id`),
  CONSTRAINT `inventory_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `inventory_transactions_inventory_item_id_foreign` FOREIGN KEY (`inventory_item_id`) REFERENCES `inventory_items` (`id`),
  CONSTRAINT `inventory_transactions_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`),
  CONSTRAINT `inventory_transactions_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `inventory_transactions_receiving_id_foreign` FOREIGN KEY (`receiving_id`) REFERENCES `receivings` (`id`),
  CONSTRAINT `inventory_transactions_receiving_item_id_foreign` FOREIGN KEY (`receiving_item_id`) REFERENCES `receiving_items` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `inventory_transactions`
--

LOCK TABLES `inventory_transactions` WRITE;
/*!40000 ALTER TABLE `inventory_transactions` DISABLE KEYS */;
INSERT INTO `inventory_transactions` VALUES (1,'INV-RCV-000001-000001',1,'receipt','2026-08-25',190.00,5133.76,975414.40,1,1,1,1,'receiving',1,'Receipt dari RCV-0001',1,'2026-08-24 20:54:53','2026-08-24 20:54:53'),(2,'INV-RCV-000001-000002',2,'receipt','2026-08-25',1.00,281369.43,281369.43,1,2,1,1,'receiving',1,'Receipt dari RCV-0001',1,'2026-08-24 20:54:53','2026-08-24 20:54:53'),(3,'INV-RCV-000001-000003',3,'receipt','2026-08-25',1.00,671337.58,671337.58,1,3,1,1,'receiving',1,'Receipt dari RCV-0001',1,'2026-08-24 20:54:53','2026-08-24 20:54:53'),(4,'INV-RCV-000001-000004',4,'receipt','2026-08-25',1.00,44426.75,44426.75,1,4,1,1,'receiving',1,'Receipt dari RCV-0001',1,'2026-08-24 20:54:53','2026-08-24 20:54:53'),(5,'INV-RCV-000001-000005',5,'receipt','2026-08-25',1.00,236942.68,236942.68,1,5,1,1,'receiving',1,'Receipt dari RCV-0001',1,'2026-08-24 20:54:53','2026-08-24 20:54:53'),(6,'INV-RCV-000002-000006',1,'receipt','2026-08-25',110.00,5133.76,564713.60,2,6,1,1,'receiving',2,'Receipt dari RCV-0002',1,'2026-08-24 20:54:53','2026-08-24 20:54:53'),(7,'INV-RCV-000002-000007',2,'receipt','2026-08-25',1.00,281369.43,281369.43,2,7,1,1,'receiving',2,'Receipt dari RCV-0002',1,'2026-08-24 20:54:53','2026-08-24 20:54:53'),(8,'INV-RCV-000002-000008',4,'receipt','2026-08-25',1.00,44426.75,44426.75,2,8,1,1,'receiving',2,'Receipt dari RCV-0002',1,'2026-08-24 20:54:53','2026-08-24 20:54:53');
/*!40000 ALTER TABLE `inventory_transactions` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `job_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `job_batches` WRITE;
/*!40000 ALTER TABLE `job_batches` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_batches` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) unsigned NOT NULL,
  `reserved_at` int(10) unsigned DEFAULT NULL,
  `available_at` int(10) unsigned NOT NULL,
  `created_at` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `jobs` WRITE;
/*!40000 ALTER TABLE `jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `jobs` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'0001_01_01_000000_create_users_table',1),(2,'0001_01_01_000001_create_cache_table',1),(3,'0001_01_01_000002_create_jobs_table',1),(4,'2026_08_11_074547_create_personal_access_tokens_table',2),(5,'2026_08_11_093142_create_roles_table',3),(6,'2026_08_11_093146_create_permissions_table',3),(7,'2026_08_11_093152_create_role_permissions_table',3),(8,'2026_08_12_023208_add_role_id_and_status_to_users_table',3),(9,'2026_08_21_041021_create_customers_table',4),(10,'2026_08_22_045111_create_surveys_table',5),(11,'2026_08_22_131343_create_designs_table',6),(12,'2026_08_22_140149_create_quotations_table',7),(13,'2026_08_22_140154_create_quotation_items_table',7),(14,'2026_08_22_215000_create_package_orders_table',8),(15,'2026_08_22_215005_create_package_order_items_table',8),(16,'2026_08_23_011950_create_projects_table',9),(17,'2026_08_24_032105_create_procurements_table',10),(18,'2026_08_24_032110_create_procurement_items_table',10),(19,'2026_08_24_034947_create_vendors_table',11),(20,'2026_08_24_034948_create_purchase_orders_table',11),(21,'2026_08_24_034950_create_purchase_order_items_table',11),(22,'2026_08_25_020354_create_receivings_table',12),(23,'2026_08_25_020356_create_receiving_items_table',12),(24,'2026_08_25_023511_create_inventory_items_table',13),(25,'2026_08_25_023513_create_inventory_stocks_table',13),(26,'2026_08_25_023518_create_inventory_transactions_table',13),(27,'2026_08_25_025925_add_inventory_item_id_to_procurement_and_purchase_order_items_tables',14);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `package_order_items`
--

DROP TABLE IF EXISTS `package_order_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `package_order_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `package_order_id` bigint(20) unsigned NOT NULL,
  `sequence_no` int(10) unsigned NOT NULL DEFAULT 1,
  `billing_type` enum('one_time','recurring') NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `quantity` decimal(12,2) NOT NULL DEFAULT 1.00,
  `unit` varchar(50) NOT NULL DEFAULT 'unit',
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `billing_period` varchar(30) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `package_order_items_billing_type_index` (`billing_type`),
  KEY `package_order_items_package_order_id_sequence_no_index` (`package_order_id`,`sequence_no`),
  CONSTRAINT `package_order_items_package_order_id_foreign` FOREIGN KEY (`package_order_id`) REFERENCES `package_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `package_order_items`
--

LOCK TABLES `package_order_items` WRITE;
/*!40000 ALTER TABLE `package_order_items` DISABLE KEYS */;
INSERT INTO `package_order_items` VALUES (1,1,1,'one_time','Biaya Instalasi Fiber Optic','Instalasi jalur FO sampai lokasi customer.',1.00,'lot',2500000.00,0.00,2500000.00,NULL,'2026-08-22 18:13:07','2026-08-22 18:13:07'),(2,1,2,'one_time','Biaya Aktivasi','Aktivasi layanan Dedicated Internet.',1.00,'lot',500000.00,0.00,500000.00,NULL,'2026-08-22 18:13:07','2026-08-22 18:13:07'),(3,1,3,'recurring','Dedicated Internet 100 Mbps','Layanan Dedicated Internet 100 Mbps.',1.00,'service',5000000.00,0.00,5000000.00,'monthly','2026-08-22 18:13:07','2026-08-22 18:13:07'),(4,1,4,'recurring','Public IP','Alokasi Public IP untuk layanan customer.',1.00,'service',600000.00,0.00,600000.00,'monthly','2026-08-22 18:13:07','2026-08-22 18:13:07');
/*!40000 ALTER TABLE `package_order_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `package_orders`
--

DROP TABLE IF EXISTS `package_orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `package_orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `package_order_code` varchar(255) NOT NULL,
  `quotation_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `design_id` bigint(20) unsigned NOT NULL,
  `order_date` date NOT NULL,
  `service_start_date` date DEFAULT NULL,
  `contract_start_date` date DEFAULT NULL,
  `contract_end_date` date DEFAULT NULL,
  `contract_months` smallint(5) unsigned DEFAULT NULL,
  `service_address` text DEFAULT NULL,
  `billing_cycle` enum('monthly','quarterly','yearly') NOT NULL DEFAULT 'monthly',
  `currency` varchar(10) NOT NULL DEFAULT 'IDR',
  `subtotal_one_time` decimal(15,2) NOT NULL DEFAULT 0.00,
  `subtotal_recurring` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_percent` decimal(5,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `grand_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `notes` longtext DEFAULT NULL,
  `terms_conditions` longtext DEFAULT NULL,
  `status` enum('draft','submitted','approved','active','completed','cancelled') NOT NULL DEFAULT 'draft',
  `submitted_by` bigint(20) unsigned DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `activated_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `cancellation_reason` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `package_orders_package_order_code_unique` (`package_order_code`),
  UNIQUE KEY `package_orders_quotation_id_unique` (`quotation_id`),
  KEY `package_orders_customer_id_foreign` (`customer_id`),
  KEY `package_orders_design_id_foreign` (`design_id`),
  KEY `package_orders_submitted_by_foreign` (`submitted_by`),
  KEY `package_orders_approved_by_foreign` (`approved_by`),
  KEY `package_orders_created_by_foreign` (`created_by`),
  KEY `package_orders_order_date_index` (`order_date`),
  KEY `package_orders_service_start_date_index` (`service_start_date`),
  KEY `package_orders_status_index` (`status`),
  CONSTRAINT `package_orders_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `package_orders_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `package_orders_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `package_orders_design_id_foreign` FOREIGN KEY (`design_id`) REFERENCES `designs` (`id`),
  CONSTRAINT `package_orders_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`),
  CONSTRAINT `package_orders_submitted_by_foreign` FOREIGN KEY (`submitted_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `package_orders`
--

LOCK TABLES `package_orders` WRITE;
/*!40000 ALTER TABLE `package_orders` DISABLE KEYS */;
INSERT INTO `package_orders` VALUES (1,'PO-CUST-0001',1,2,1,'2026-08-23','2026-09-01','2026-09-01','2027-08-31',12,'Jl. Gatot Subroto No. 20, Medan','monthly','IDR',3000000.00,5600000.00,500000.00,11.00,891000.00,8991000.00,'Package Order berdasarkan QUO-0001 yang telah diterima customer.','Masa berlaku penawaran 14 hari. Instalasi dilakukan setelah persetujuan dan administrasi selesai.','approved',1,'2026-08-22 18:18:48',1,'2026-08-22 18:18:59',NULL,NULL,NULL,NULL,1,'2026-08-22 18:13:07','2026-08-22 18:18:59',NULL);
/*!40000 ALTER TABLE `package_orders` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_reset_tokens`
--

DROP TABLE IF EXISTS `password_reset_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_reset_tokens`
--

LOCK TABLES `password_reset_tokens` WRITE;
/*!40000 ALTER TABLE `password_reset_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_reset_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `permissions`
--

DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `module` varchar(255) NOT NULL,
  `action` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_unique` (`name`),
  KEY `permissions_module_action_index` (`module`,`action`)
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `permissions`
--

LOCK TABLES `permissions` WRITE;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
INSERT INTO `permissions` VALUES (1,'customer.view','customer','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(2,'customer.create','customer','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(3,'customer.update','customer','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(4,'customer.delete','customer','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(5,'quotation.view','quotation','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(6,'quotation.create','quotation','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(7,'quotation.update','quotation','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(8,'quotation.delete','quotation','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(9,'quotation.submit','quotation','submit','2026-08-18 22:56:14','2026-08-18 22:56:14'),(10,'quotation.approve','quotation','approve','2026-08-18 22:56:14','2026-08-18 22:56:14'),(11,'quotation.reject','quotation','reject','2026-08-18 22:56:14','2026-08-18 22:56:14'),(12,'design.view','design','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(13,'design.create','design','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(14,'design.update','design','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(15,'design.delete','design','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(16,'design.approve','design','approve','2026-08-18 22:56:14','2026-08-18 22:56:14'),(17,'package_order.view','package_order','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(18,'package_order.create','package_order','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(19,'package_order.update','package_order','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(20,'package_order.delete','package_order','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(21,'package_order.submit','package_order','submit','2026-08-18 22:56:14','2026-08-18 22:56:14'),(22,'package_order.approve','package_order','approve','2026-08-18 22:56:14','2026-08-18 22:56:14'),(23,'package_order.reject','package_order','reject','2026-08-18 22:56:14','2026-08-18 22:56:14'),(24,'project.view','project','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(25,'project.create','project','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(26,'project.update','project','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(27,'project.delete','project','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(28,'procurement.view','procurement','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(29,'procurement.create','procurement','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(30,'procurement.update','procurement','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(31,'procurement.delete','procurement','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(32,'procurement.approve','procurement','approve','2026-08-18 22:56:14','2026-08-18 22:56:14'),(33,'invoice.view','invoice','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(34,'invoice.create','invoice','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(35,'invoice.update','invoice','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(36,'invoice.delete','invoice','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(37,'invoice.approve','invoice','approve','2026-08-18 22:56:14','2026-08-18 22:56:14'),(38,'payment.view','payment','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(39,'payment.create','payment','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(40,'payment.update','payment','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(41,'payment.delete','payment','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(42,'payment.verify','payment','verify','2026-08-18 22:56:14','2026-08-18 22:56:14'),(43,'document.view','document','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(44,'document.create','document','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(45,'document.update','document','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(46,'document.delete','document','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(47,'user.view','user','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(48,'user.create','user','create','2026-08-18 22:56:14','2026-08-18 22:56:14'),(49,'user.update','user','update','2026-08-18 22:56:14','2026-08-18 22:56:14'),(50,'user.delete','user','delete','2026-08-18 22:56:14','2026-08-18 22:56:14'),(51,'report.view','report','view','2026-08-18 22:56:14','2026-08-18 22:56:14'),(52,'report.export','report','export','2026-08-18 22:56:14','2026-08-18 22:56:14'),(53,'po.view','po','view','2026-08-20 20:43:07','2026-08-20 20:43:07'),(54,'po.create','po','create','2026-08-20 20:43:07','2026-08-20 20:43:07'),(55,'po.update','po','update','2026-08-20 20:43:07','2026-08-20 20:43:07'),(56,'po.delete','po','delete','2026-08-20 20:43:07','2026-08-20 20:43:07'),(57,'po.approve','po','approve','2026-08-20 20:43:07','2026-08-20 20:43:07'),(58,'payment.approve','payment','approve','2026-08-20 20:43:07','2026-08-20 20:43:07'),(59,'survey.view','survey','view','2026-08-22 02:06:59','2026-08-22 02:06:59'),(60,'survey.create','survey','create','2026-08-22 02:06:59','2026-08-22 02:06:59'),(61,'survey.update','survey','update','2026-08-22 02:06:59','2026-08-22 02:06:59'),(62,'survey.delete','survey','delete','2026-08-22 02:06:59','2026-08-22 02:06:59'),(63,'vendor.view','vendor','view','2026-08-24 02:33:45','2026-08-24 02:33:45'),(64,'vendor.create','vendor','create','2026-08-24 02:33:45','2026-08-24 02:33:45'),(65,'vendor.update','vendor','update','2026-08-24 02:33:45','2026-08-24 02:33:45'),(66,'vendor.delete','vendor','delete','2026-08-24 02:33:45','2026-08-24 02:33:45'),(67,'purchase_order.view','purchase_order','view','2026-08-24 02:33:45','2026-08-24 02:33:45'),(68,'purchase_order.create','purchase_order','create','2026-08-24 02:33:45','2026-08-24 02:33:45'),(69,'purchase_order.update','purchase_order','update','2026-08-24 02:33:45','2026-08-24 02:33:45'),(70,'purchase_order.delete','purchase_order','delete','2026-08-24 02:33:45','2026-08-24 02:33:45'),(71,'purchase_order.submit','purchase_order','submit','2026-08-24 02:33:45','2026-08-24 02:33:45'),(72,'purchase_order.approve','purchase_order','approve','2026-08-24 02:33:45','2026-08-24 02:33:45'),(73,'purchase_order.send','purchase_order','send','2026-08-24 02:33:45','2026-08-24 02:33:45'),(74,'purchase_order.cancel','purchase_order','cancel','2026-08-24 02:33:45','2026-08-24 02:33:45'),(75,'receiving.view','receiving','view','2026-08-24 19:24:21','2026-08-24 19:24:21'),(76,'receiving.create','receiving','create','2026-08-24 19:24:21','2026-08-24 19:24:21'),(77,'receiving.update','receiving','update','2026-08-24 19:24:21','2026-08-24 19:24:21'),(78,'receiving.delete','receiving','delete','2026-08-24 19:24:21','2026-08-24 19:24:21'),(79,'receiving.post','receiving','post','2026-08-24 19:24:21','2026-08-24 19:24:21'),(80,'receiving.cancel','receiving','cancel','2026-08-24 19:24:21','2026-08-24 19:24:21'),(81,'inventory.view','inventory','view','2026-08-25 19:51:28','2026-08-25 19:51:28'),(82,'inventory.create','inventory','create','2026-08-25 19:51:28','2026-08-25 19:51:28'),(83,'inventory.update','inventory','update','2026-08-25 19:51:28','2026-08-25 19:51:28'),(84,'inventory.delete','inventory','delete','2026-08-25 19:51:28','2026-08-25 19:51:28');
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `personal_access_tokens`
--

DROP TABLE IF EXISTS `personal_access_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `personal_access_tokens` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(255) NOT NULL,
  `tokenable_id` bigint(20) unsigned NOT NULL,
  `name` text NOT NULL,
  `token` varchar(64) NOT NULL,
  `abilities` text DEFAULT NULL,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`),
  KEY `personal_access_tokens_expires_at_index` (`expires_at`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `personal_access_tokens`
--

LOCK TABLES `personal_access_tokens` WRITE;
/*!40000 ALTER TABLE `personal_access_tokens` DISABLE KEYS */;
INSERT INTO `personal_access_tokens` VALUES (1,'App\\Models\\User',1,'isp-management-token','2e21496bcc9621475ca530646343413c4f40e6f65d6ff3c4a536c39741e90af9','[\"*\"]',NULL,NULL,'2026-08-20 01:57:12','2026-08-20 01:57:12'),(3,'App\\Models\\User',1,'isp-management-token','420ab3e0848cff6e39cfbc1059b3dd376f1bb3a388533540e30beed3368dbb5e','[\"*\"]','2026-08-21 20:49:49',NULL,'2026-08-21 20:46:02','2026-08-21 20:49:49'),(4,'App\\Models\\User',1,'isp-management-token','4346c559d3f8e237badb5eb11498f945af34a9b8e17db08cd621e2c233c6d61a','[\"*\"]','2026-08-22 18:18:59',NULL,'2026-08-22 02:16:24','2026-08-22 18:18:59'),(5,'App\\Models\\User',1,'isp-management-token','985c322d99609077c76e4758cde2525088c7c24d7c66273bec9861473b3c3819','[\"*\"]','2026-08-25 19:56:52',NULL,'2026-08-23 20:14:34','2026-08-25 19:56:52'),(6,'App\\Models\\User',1,'isp-management-token','736005124a866a160e253290f02ca53e5173a1c68e5be40830ec903e3747b6aa','[\"*\"]','2026-08-26 01:40:53',NULL,'2026-08-26 01:01:59','2026-08-26 01:40:53');
/*!40000 ALTER TABLE `personal_access_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `procurement_items`
--

DROP TABLE IF EXISTS `procurement_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `procurement_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `procurement_id` bigint(20) unsigned NOT NULL,
  `inventory_item_id` bigint(20) unsigned DEFAULT NULL,
  `sequence_no` int(10) unsigned NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `category` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `specification` text DEFAULT NULL,
  `quantity` decimal(12,2) NOT NULL,
  `unit` varchar(50) NOT NULL,
  `estimated_unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `estimated_total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `actual_unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `actual_total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `received_quantity` decimal(12,2) NOT NULL DEFAULT 0.00,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `procurement_items_procurement_id_index` (`procurement_id`),
  KEY `procurement_items_category_index` (`category`),
  KEY `procurement_items_inventory_item_id_foreign` (`inventory_item_id`),
  CONSTRAINT `procurement_items_inventory_item_id_foreign` FOREIGN KEY (`inventory_item_id`) REFERENCES `inventory_items` (`id`),
  CONSTRAINT `procurement_items_procurement_id_foreign` FOREIGN KEY (`procurement_id`) REFERENCES `procurements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `procurement_items`
--

LOCK TABLES `procurement_items` WRITE;
/*!40000 ALTER TABLE `procurement_items` DISABLE KEYS */;
INSERT INTO `procurement_items` VALUES (6,1,1,1,'Fiber Optic Cable','Cable',NULL,'Single Mode Outdoor',300.00,'meter',5500.00,1650000.00,0.00,0.00,0.00,NULL,'2026-08-23 20:40:49','2026-08-24 20:48:06'),(7,1,2,2,'SFP Module','Network Equipment',NULL,'1G Single Mode',2.00,'pcs',300000.00,600000.00,0.00,0.00,0.00,NULL,'2026-08-23 20:40:49','2026-08-24 20:48:06'),(8,1,3,3,'Router / CPE','Network Equipment',NULL,'Gigabit Ethernet',1.00,'unit',700000.00,700000.00,0.00,0.00,0.00,NULL,'2026-08-23 20:40:49','2026-08-24 20:48:06'),(9,1,4,4,'Fiber Patch Cord','Accessories',NULL,'SC-LC Single Mode',2.00,'pcs',50000.00,100000.00,0.00,0.00,0.00,NULL,'2026-08-23 20:40:49','2026-08-24 20:48:06'),(10,1,5,5,'Installation Accessories','Accessories',NULL,'Clamp, connector, protection dan consumable',1.00,'lot',250000.00,250000.00,0.00,0.00,0.00,NULL,'2026-08-23 20:40:49','2026-08-24 20:48:06');
/*!40000 ALTER TABLE `procurement_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `procurements`
--

DROP TABLE IF EXISTS `procurements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `procurements` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `procurement_code` varchar(255) NOT NULL,
  `project_id` bigint(20) unsigned NOT NULL,
  `package_order_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `request_date` date NOT NULL,
  `required_date` date DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `purpose` longtext DEFAULT NULL,
  `priority` enum('low','normal','high','urgent') NOT NULL DEFAULT 'normal',
  `estimated_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `actual_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `notes` longtext DEFAULT NULL,
  `status` enum('draft','submitted','approved','ordered','partially_received','received','completed','cancelled') NOT NULL DEFAULT 'draft',
  `submitted_by` bigint(20) unsigned DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `ordered_at` timestamp NULL DEFAULT NULL,
  `received_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `cancellation_reason` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `procurements_procurement_code_unique` (`procurement_code`),
  KEY `procurements_submitted_by_foreign` (`submitted_by`),
  KEY `procurements_approved_by_foreign` (`approved_by`),
  KEY `procurements_created_by_foreign` (`created_by`),
  KEY `procurements_project_id_index` (`project_id`),
  KEY `procurements_package_order_id_index` (`package_order_id`),
  KEY `procurements_customer_id_index` (`customer_id`),
  KEY `procurements_status_index` (`status`),
  KEY `procurements_priority_index` (`priority`),
  KEY `procurements_request_date_index` (`request_date`),
  KEY `procurements_required_date_index` (`required_date`),
  CONSTRAINT `procurements_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `procurements_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `procurements_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `procurements_package_order_id_foreign` FOREIGN KEY (`package_order_id`) REFERENCES `package_orders` (`id`),
  CONSTRAINT `procurements_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`),
  CONSTRAINT `procurements_submitted_by_foreign` FOREIGN KEY (`submitted_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `procurements`
--

LOCK TABLES `procurements` WRITE;
/*!40000 ALTER TABLE `procurements` DISABLE KEYS */;
INSERT INTO `procurements` VALUES (1,'PROC-0001',1,1,2,'2026-08-24','2026-08-29','Kebutuhan Material Implementasi PRJ-0001 - Revisi','Pengadaan material untuk implementasi Dedicated Internet 100 Mbps.','urgent',3300000.00,0.00,'Revisi estimasi harga kabel FO.','received',1,'2026-08-23 20:45:06',1,'2026-08-23 20:45:23','2026-08-24 19:00:49','2026-08-24 19:31:51',NULL,NULL,NULL,1,'2026-08-23 20:35:58','2026-08-24 19:31:51',NULL);
/*!40000 ALTER TABLE `procurements` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `projects`
--

DROP TABLE IF EXISTS `projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projects` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `project_code` varchar(255) NOT NULL,
  `package_order_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `design_id` bigint(20) unsigned NOT NULL,
  `project_name` varchar(255) NOT NULL,
  `description` longtext DEFAULT NULL,
  `planned_start_date` date DEFAULT NULL,
  `planned_end_date` date DEFAULT NULL,
  `actual_start_date` date DEFAULT NULL,
  `actual_end_date` date DEFAULT NULL,
  `project_manager_id` bigint(20) unsigned DEFAULT NULL,
  `priority` enum('low','normal','high','urgent') NOT NULL DEFAULT 'normal',
  `progress_percent` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `budget_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `actual_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `technical_notes` longtext DEFAULT NULL,
  `status` enum('planning','ready','in_progress','testing','completed','closed','cancelled') NOT NULL DEFAULT 'planning',
  `ready_at` timestamp NULL DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `testing_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `closed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `cancellation_reason` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `projects_project_code_unique` (`project_code`),
  UNIQUE KEY `projects_package_order_id_unique` (`package_order_id`),
  KEY `projects_customer_id_foreign` (`customer_id`),
  KEY `projects_design_id_foreign` (`design_id`),
  KEY `projects_created_by_foreign` (`created_by`),
  KEY `projects_status_index` (`status`),
  KEY `projects_priority_index` (`priority`),
  KEY `projects_planned_start_date_index` (`planned_start_date`),
  KEY `projects_planned_end_date_index` (`planned_end_date`),
  KEY `projects_project_manager_id_index` (`project_manager_id`),
  CONSTRAINT `projects_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `projects_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `projects_design_id_foreign` FOREIGN KEY (`design_id`) REFERENCES `designs` (`id`),
  CONSTRAINT `projects_package_order_id_foreign` FOREIGN KEY (`package_order_id`) REFERENCES `package_orders` (`id`),
  CONSTRAINT `projects_project_manager_id_foreign` FOREIGN KEY (`project_manager_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `projects`
--

LOCK TABLES `projects` WRITE;
/*!40000 ALTER TABLE `projects` DISABLE KEYS */;
INSERT INTO `projects` VALUES (1,'PRJ-0001',1,2,1,'Implementasi Dedicated Internet 100 Mbps - PT Metro Test Survey','Project implementasi layanan Dedicated Internet 100 Mbps berdasarkan PO-CUST-0001.','2026-08-25','2026-09-02','2026-08-24',NULL,1,'urgent',25,3250000.00,0.00,'Persiapan implementasi FO dan koordinasi akses lokasi customer.','in_progress','2026-08-23 20:19:41','2026-08-23 20:20:05',NULL,NULL,NULL,NULL,NULL,1,'2026-08-23 20:16:33','2026-08-23 20:20:05',NULL);
/*!40000 ALTER TABLE `projects` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_order_items`
--

DROP TABLE IF EXISTS `purchase_order_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_order_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` bigint(20) unsigned NOT NULL,
  `procurement_item_id` bigint(20) unsigned NOT NULL,
  `inventory_item_id` bigint(20) unsigned DEFAULT NULL,
  `sequence_no` int(10) unsigned NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `specification` text DEFAULT NULL,
  `quantity` decimal(12,2) NOT NULL,
  `unit` varchar(50) NOT NULL,
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `received_quantity` decimal(12,2) NOT NULL DEFAULT 0.00,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_order_items_purchase_order_id_index` (`purchase_order_id`),
  KEY `purchase_order_items_procurement_item_id_index` (`procurement_item_id`),
  KEY `purchase_order_items_inventory_item_id_foreign` (`inventory_item_id`),
  CONSTRAINT `purchase_order_items_inventory_item_id_foreign` FOREIGN KEY (`inventory_item_id`) REFERENCES `inventory_items` (`id`),
  CONSTRAINT `purchase_order_items_procurement_item_id_foreign` FOREIGN KEY (`procurement_item_id`) REFERENCES `procurement_items` (`id`),
  CONSTRAINT `purchase_order_items_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchase_order_items`
--

LOCK TABLES `purchase_order_items` WRITE;
/*!40000 ALTER TABLE `purchase_order_items` DISABLE KEYS */;
INSERT INTO `purchase_order_items` VALUES (6,1,6,1,1,'Fiber Optic Cable',NULL,'Single Mode Outdoor',300.00,'meter',5200.00,0.00,1560000.00,300.00,'Harga final vendor','2026-08-24 18:59:40','2026-08-24 20:48:06'),(7,1,7,2,2,'SFP Module',NULL,'1G Single Mode',2.00,'pcs',285000.00,0.00,570000.00,2.00,'Harga final vendor','2026-08-24 18:59:40','2026-08-24 20:48:06'),(8,1,8,3,3,'Router / CPE',NULL,'Gigabit Ethernet',1.00,'unit',680000.00,0.00,680000.00,1.00,'Harga final vendor','2026-08-24 18:59:40','2026-08-24 20:48:06'),(9,1,9,4,4,'Fiber Patch Cord',NULL,'SC-LC Single Mode',2.00,'pcs',45000.00,0.00,90000.00,2.00,'Harga final vendor','2026-08-24 18:59:40','2026-08-24 20:48:06'),(10,1,10,5,5,'Installation Accessories',NULL,'Clamp, connector, protection dan consumable',1.00,'lot',240000.00,0.00,240000.00,1.00,'Harga final vendor','2026-08-24 18:59:40','2026-08-24 20:48:06');
/*!40000 ALTER TABLE `purchase_order_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_orders`
--

DROP TABLE IF EXISTS `purchase_orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_code` varchar(255) NOT NULL,
  `procurement_id` bigint(20) unsigned NOT NULL,
  `project_id` bigint(20) unsigned NOT NULL,
  `vendor_id` bigint(20) unsigned NOT NULL,
  `order_date` date NOT NULL,
  `expected_delivery_date` date DEFAULT NULL,
  `currency` varchar(10) NOT NULL DEFAULT 'IDR',
  `subtotal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_percent` decimal(5,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `grand_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `shipping_address` text DEFAULT NULL,
  `payment_terms` text DEFAULT NULL,
  `notes` longtext DEFAULT NULL,
  `status` enum('draft','submitted','approved','sent','partially_received','received','completed','cancelled') NOT NULL DEFAULT 'draft',
  `submitted_by` bigint(20) unsigned DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `received_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `cancellation_reason` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_orders_purchase_order_code_unique` (`purchase_order_code`),
  KEY `purchase_orders_submitted_by_foreign` (`submitted_by`),
  KEY `purchase_orders_approved_by_foreign` (`approved_by`),
  KEY `purchase_orders_created_by_foreign` (`created_by`),
  KEY `purchase_orders_procurement_id_index` (`procurement_id`),
  KEY `purchase_orders_project_id_index` (`project_id`),
  KEY `purchase_orders_vendor_id_index` (`vendor_id`),
  KEY `purchase_orders_status_index` (`status`),
  KEY `purchase_orders_order_date_index` (`order_date`),
  KEY `purchase_orders_expected_delivery_date_index` (`expected_delivery_date`),
  CONSTRAINT `purchase_orders_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `purchase_orders_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `purchase_orders_procurement_id_foreign` FOREIGN KEY (`procurement_id`) REFERENCES `procurements` (`id`),
  CONSTRAINT `purchase_orders_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`),
  CONSTRAINT `purchase_orders_submitted_by_foreign` FOREIGN KEY (`submitted_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `purchase_orders_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchase_orders`
--

LOCK TABLES `purchase_orders` WRITE;
/*!40000 ALTER TABLE `purchase_orders` DISABLE KEYS */;
INSERT INTO `purchase_orders` VALUES (1,'PO-VND-0001',1,1,1,'2026-08-24','2026-08-31','IDR',3140000.00,40000.00,11.00,341000.00,3441000.00,'Lokasi proyek PT Metro Test Survey','Net 30','Harga final hasil negosiasi dengan VND-0001','received',1,'2026-08-24 19:00:02',1,'2026-08-24 19:00:17','2026-08-24 19:00:49','2026-08-24 19:31:51',NULL,NULL,NULL,1,'2026-08-24 03:35:39','2026-08-24 19:31:51',NULL);
/*!40000 ALTER TABLE `purchase_orders` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `quotation_items`
--

DROP TABLE IF EXISTS `quotation_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `quotation_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `quotation_id` bigint(20) unsigned NOT NULL,
  `sequence_no` int(10) unsigned NOT NULL DEFAULT 1,
  `billing_type` enum('one_time','recurring') NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `quantity` decimal(12,2) NOT NULL DEFAULT 1.00,
  `unit` varchar(50) NOT NULL DEFAULT 'unit',
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `billing_period` varchar(30) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quotation_items_quotation_id_index` (`quotation_id`),
  KEY `quotation_items_billing_type_index` (`billing_type`),
  KEY `quotation_items_sequence_no_index` (`sequence_no`),
  CONSTRAINT `quotation_items_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `quotation_items`
--

LOCK TABLES `quotation_items` WRITE;
/*!40000 ALTER TABLE `quotation_items` DISABLE KEYS */;
INSERT INTO `quotation_items` VALUES (5,1,1,'one_time','Biaya Instalasi Fiber Optic','Instalasi jalur FO sampai lokasi customer.',1.00,'lot',2500000.00,0.00,2500000.00,NULL,'2026-08-22 14:42:45','2026-08-22 14:42:45'),(6,1,2,'one_time','Biaya Aktivasi','Aktivasi layanan Dedicated Internet.',1.00,'lot',500000.00,0.00,500000.00,NULL,'2026-08-22 14:42:45','2026-08-22 14:42:45'),(7,1,3,'recurring','Dedicated Internet 100 Mbps','Layanan Dedicated Internet 100 Mbps.',1.00,'service',5000000.00,0.00,5000000.00,'monthly','2026-08-22 14:42:45','2026-08-22 14:42:45'),(8,1,4,'recurring','Public IP','Alokasi Public IP untuk layanan customer.',1.00,'service',600000.00,0.00,600000.00,'monthly','2026-08-22 14:42:45','2026-08-22 14:42:45');
/*!40000 ALTER TABLE `quotation_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `quotations`
--

DROP TABLE IF EXISTS `quotations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `quotations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `quotation_code` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `design_id` bigint(20) unsigned NOT NULL,
  `quotation_date` date NOT NULL,
  `valid_until` date DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `currency` varchar(10) NOT NULL DEFAULT 'IDR',
  `subtotal_one_time` decimal(15,2) NOT NULL DEFAULT 0.00,
  `subtotal_recurring` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_percent` decimal(5,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `grand_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `notes` longtext DEFAULT NULL,
  `terms_conditions` longtext DEFAULT NULL,
  `status` enum('draft','submitted','under_review','approved','rejected','sent','accepted','expired') NOT NULL DEFAULT 'draft',
  `submitted_by` bigint(20) unsigned DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `rejection_reason` text DEFAULT NULL,
  `rejected_at` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `accepted_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `quotations_quotation_code_unique` (`quotation_code`),
  KEY `quotations_submitted_by_foreign` (`submitted_by`),
  KEY `quotations_approved_by_foreign` (`approved_by`),
  KEY `quotations_created_by_foreign` (`created_by`),
  KEY `quotations_quotation_date_index` (`quotation_date`),
  KEY `quotations_valid_until_index` (`valid_until`),
  KEY `quotations_status_index` (`status`),
  KEY `quotations_customer_id_index` (`customer_id`),
  KEY `quotations_design_id_index` (`design_id`),
  CONSTRAINT `quotations_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `quotations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `quotations_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `quotations_design_id_foreign` FOREIGN KEY (`design_id`) REFERENCES `designs` (`id`),
  CONSTRAINT `quotations_submitted_by_foreign` FOREIGN KEY (`submitted_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `quotations`
--

LOCK TABLES `quotations` WRITE;
/*!40000 ALTER TABLE `quotations` DISABLE KEYS */;
INSERT INTO `quotations` VALUES (1,'QUO-0001',2,1,'2026-08-23','2026-09-06','Penawaran Dedicated Internet 100 Mbps - Revisi 1','IDR',3000000.00,5600000.00,500000.00,11.00,891000.00,8991000.00,'Revisi harga Public IP.','Masa berlaku penawaran 14 hari. Instalasi dilakukan setelah persetujuan dan administrasi selesai.','accepted',1,'2026-08-22 14:47:46',1,'2026-08-22 14:48:12',NULL,NULL,'2026-08-22 14:49:08','2026-08-22 14:49:17',1,'2026-08-22 14:40:43','2026-08-22 14:49:17',NULL);
/*!40000 ALTER TABLE `quotations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `receiving_items`
--

DROP TABLE IF EXISTS `receiving_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `receiving_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `receiving_id` bigint(20) unsigned NOT NULL,
  `purchase_order_item_id` bigint(20) unsigned NOT NULL,
  `sequence_no` int(10) unsigned NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `specification` text DEFAULT NULL,
  `quantity_received` decimal(15,2) NOT NULL,
  `quantity_accepted` decimal(15,2) NOT NULL DEFAULT 0.00,
  `quantity_rejected` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit` varchar(50) NOT NULL,
  `remarks` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `receiving_items_receiving_id_index` (`receiving_id`),
  KEY `receiving_items_purchase_order_item_id_index` (`purchase_order_item_id`),
  CONSTRAINT `receiving_items_purchase_order_item_id_foreign` FOREIGN KEY (`purchase_order_item_id`) REFERENCES `purchase_order_items` (`id`),
  CONSTRAINT `receiving_items_receiving_id_foreign` FOREIGN KEY (`receiving_id`) REFERENCES `receivings` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `receiving_items`
--

LOCK TABLES `receiving_items` WRITE;
/*!40000 ALTER TABLE `receiving_items` DISABLE KEYS */;
INSERT INTO `receiving_items` VALUES (1,1,6,1,'Fiber Optic Cable',NULL,'Single Mode Outdoor',200.00,190.00,10.00,'meter','10 meter fiber ditolak karena kondisi fisik','2026-08-24 19:28:11','2026-08-24 19:28:11'),(2,1,7,2,'SFP Module',NULL,'1G Single Mode',1.00,1.00,0.00,'pcs','Baik','2026-08-24 19:28:11','2026-08-24 19:28:11'),(3,1,8,3,'Router / CPE',NULL,'Gigabit Ethernet',1.00,1.00,0.00,'unit','Baik','2026-08-24 19:28:11','2026-08-24 19:28:11'),(4,1,9,4,'Fiber Patch Cord',NULL,'SC-LC Single Mode',1.00,1.00,0.00,'pcs','Baik','2026-08-24 19:28:11','2026-08-24 19:28:11'),(5,1,10,5,'Installation Accessories',NULL,'Clamp, connector, protection dan consumable',1.00,1.00,0.00,'lot','Baik','2026-08-24 19:28:11','2026-08-24 19:28:11'),(6,2,6,1,'Fiber Optic Cable',NULL,'Single Mode Outdoor',110.00,110.00,0.00,'meter','Pengiriman sisa - kondisi baik','2026-08-24 19:31:44','2026-08-24 19:31:44'),(7,2,7,2,'SFP Module',NULL,'1G Single Mode',1.00,1.00,0.00,'pcs','Pengiriman sisa - kondisi baik','2026-08-24 19:31:44','2026-08-24 19:31:44'),(8,2,9,4,'Fiber Patch Cord',NULL,'SC-LC Single Mode',1.00,1.00,0.00,'pcs','Pengiriman sisa - kondisi baik','2026-08-24 19:31:44','2026-08-24 19:31:44');
/*!40000 ALTER TABLE `receiving_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `receivings`
--

DROP TABLE IF EXISTS `receivings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `receivings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `receiving_code` varchar(255) NOT NULL,
  `purchase_order_id` bigint(20) unsigned NOT NULL,
  `procurement_id` bigint(20) unsigned NOT NULL,
  `project_id` bigint(20) unsigned NOT NULL,
  `vendor_id` bigint(20) unsigned NOT NULL,
  `received_date` date NOT NULL,
  `delivery_note_number` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `status` enum('draft','posted','cancelled') NOT NULL DEFAULT 'draft',
  `received_by` bigint(20) unsigned DEFAULT NULL,
  `posted_by` bigint(20) unsigned DEFAULT NULL,
  `posted_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `cancellation_reason` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `receivings_receiving_code_unique` (`receiving_code`),
  KEY `receivings_received_by_foreign` (`received_by`),
  KEY `receivings_posted_by_foreign` (`posted_by`),
  KEY `receivings_created_by_foreign` (`created_by`),
  KEY `receivings_purchase_order_id_index` (`purchase_order_id`),
  KEY `receivings_procurement_id_index` (`procurement_id`),
  KEY `receivings_project_id_index` (`project_id`),
  KEY `receivings_vendor_id_index` (`vendor_id`),
  KEY `receivings_received_date_index` (`received_date`),
  KEY `receivings_status_index` (`status`),
  CONSTRAINT `receivings_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `receivings_posted_by_foreign` FOREIGN KEY (`posted_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `receivings_procurement_id_foreign` FOREIGN KEY (`procurement_id`) REFERENCES `procurements` (`id`),
  CONSTRAINT `receivings_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`),
  CONSTRAINT `receivings_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `receivings_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `receivings_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `receivings`
--

LOCK TABLES `receivings` WRITE;
/*!40000 ALTER TABLE `receivings` DISABLE KEYS */;
INSERT INTO `receivings` VALUES (1,'RCV-0001',1,1,1,1,'2026-08-25','SJ-VND-0001-001','Pengiriman pertama sebagian dari PO-VND-0001','posted',1,1,'2026-08-24 19:29:43',NULL,NULL,1,'2026-08-24 19:28:11','2026-08-24 19:29:43',NULL),(2,'RCV-0002',1,1,1,1,'2026-08-25','SJ-VND-0001-002','Pengiriman kedua untuk menyelesaikan PO-VND-0001','posted',1,1,'2026-08-24 19:31:51',NULL,NULL,1,'2026-08-24 19:31:44','2026-08-24 19:31:51',NULL);
/*!40000 ALTER TABLE `receivings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `role_permissions`
--

DROP TABLE IF EXISTS `role_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role_permissions` (
  `role_id` bigint(20) unsigned NOT NULL,
  `permission_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`permission_id`),
  KEY `role_permissions_permission_id_foreign` (`permission_id`),
  CONSTRAINT `role_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `role_permissions`
--

LOCK TABLES `role_permissions` WRITE;
/*!40000 ALTER TABLE `role_permissions` DISABLE KEYS */;
INSERT INTO `role_permissions` VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),(1,14),(1,15),(1,16),(1,17),(1,18),(1,19),(1,20),(1,21),(1,22),(1,23),(1,24),(1,25),(1,26),(1,27),(1,28),(1,29),(1,30),(1,31),(1,32),(1,33),(1,34),(1,35),(1,36),(1,37),(1,38),(1,39),(1,40),(1,41),(1,42),(1,43),(1,44),(1,45),(1,46),(1,47),(1,48),(1,49),(1,50),(1,51),(1,52),(1,53),(1,54),(1,55),(1,56),(1,57),(1,58),(1,59),(1,60),(1,61),(1,62),(1,63),(1,64),(1,65),(1,66),(1,67),(1,68),(1,69),(1,70),(1,71),(1,72),(1,73),(1,74),(1,75),(1,76),(1,77),(1,78),(1,79),(1,80),(1,81),(1,82),(1,83),(1,84),(2,1),(2,5),(2,10),(2,11),(2,12),(2,16),(2,17),(2,22),(2,23),(2,24),(2,28),(2,32),(2,33),(2,37),(2,38),(2,42),(2,43),(2,51),(2,52),(2,59),(3,1),(3,5),(3,6),(3,7),(3,9),(3,12),(3,13),(3,14),(3,17),(3,18),(3,19),(3,21),(3,24),(3,25),(3,26),(3,28),(3,29),(3,30),(3,33),(3,38),(3,43),(3,44),(3,45),(3,51),(3,52),(3,59),(3,60),(3,61),(4,1),(4,2),(4,3),(4,5),(4,6),(4,7),(4,8),(4,9),(4,43),(4,44),(4,51),(4,59),(4,60),(4,61),(5,12),(5,13),(5,14),(5,15),(5,16),(5,24),(5,43),(5,44),(5,45),(5,59),(6,1),(6,5),(6,12),(6,16),(6,17),(6,24),(6,25),(6,26),(6,27),(6,28),(6,29),(6,30),(6,43),(6,44),(6,45),(6,51),(6,59),(6,61),(7,1),(7,5),(7,17),(7,33),(7,34),(7,35),(7,36),(7,37),(7,38),(7,39),(7,40),(7,42),(7,43),(7,44),(7,51),(7,52),(8,17),(8,18),(8,19),(8,21),(8,24),(8,28),(8,29),(8,30),(8,31),(8,32),(8,43),(8,44),(8,51),(9,17),(9,24),(9,28),(9,43),(9,51),(10,12),(10,17),(10,24),(10,26),(10,43),(10,59),(10,61),(11,1),(11,12),(11,17),(11,24),(11,26),(11,43),(11,51),(11,52),(11,59);
/*!40000 ALTER TABLE `role_permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `roles`
--

LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'super_admin','Memiliki akses penuh terhadap seluruh sistem.','2026-08-18 22:56:14','2026-08-18 22:56:14'),(2,'director','Mengawasi dan melakukan approval terhadap proses bisnis.','2026-08-18 22:56:14','2026-08-27 03:59:19'),(3,'manager','Mengelola proses dan tim pada bagian terkait.','2026-08-18 22:56:14','2026-08-27 03:55:37'),(4,'sales','Mengelola customer, penawaran, dan proses penjualan.','2026-08-18 22:56:14','2026-08-27 03:55:37'),(5,'designer','Mengelola survey dan design teknis.','2026-08-18 22:56:14','2026-08-27 03:59:19'),(6,'project_manager','Mengelola project setelah proses penjualan disetujui.','2026-08-18 22:56:14','2026-08-27 03:59:19'),(7,'finance','Mengelola invoice, pembayaran, dan proses keuangan.','2026-08-18 22:56:14','2026-08-27 03:55:37'),(8,'purchasing','Mengelola procurement, vendor, dan purchase order.','2026-08-18 22:56:14','2026-08-27 03:59:19'),(9,'warehouse','Mengelola receiving dan inventory.','2026-08-18 22:56:14','2026-08-27 03:59:19'),(10,'technician','Menangani survey lapangan, work order, dan instalasi.','2026-08-18 22:56:14','2026-08-27 03:59:19'),(11,'noc','Mengelola monitoring layanan dan operasional jaringan.','2026-08-18 22:56:14','2026-08-27 03:59:19');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `sessions` WRITE;
/*!40000 ALTER TABLE `sessions` DISABLE KEYS */;
INSERT INTO `sessions` VALUES ('Hpue1U1luUeQCiC8EFmAlaO2vhQwDVgvdBnOON3K',NULL,'127.0.0.1','curl/8.21.0','YTozOntzOjY6Il90b2tlbiI7czo0MDoiZEc0S0hxV3JyYVFmcHFTQXg5Y3BBR1hjQmNkT0dHdVYyc1pxSHlYaiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMCI7czo1OiJyb3V0ZSI7Tjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==',1787284512);
/*!40000 ALTER TABLE `sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `surveys`
--

DROP TABLE IF EXISTS `surveys`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `surveys` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `survey_code` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `survey_date` date DEFAULT NULL,
  `location_address` text DEFAULT NULL,
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `contact_person` varchar(255) DEFAULT NULL,
  `contact_phone` varchar(30) DEFAULT NULL,
  `existing_network` text DEFAULT NULL,
  `nearest_pop` varchar(255) DEFAULT NULL,
  `distance_to_pop` decimal(10,2) DEFAULT NULL,
  `recommended_medium` varchar(255) DEFAULT NULL,
  `estimated_cable_length` decimal(10,2) DEFAULT NULL,
  `power_available` tinyint(1) DEFAULT NULL,
  `rack_available` tinyint(1) DEFAULT NULL,
  `pole_required` tinyint(1) DEFAULT NULL,
  `technical_notes` text DEFAULT NULL,
  `survey_result` enum('feasible','not_feasible','conditional','pending') DEFAULT NULL,
  `status` enum('draft','scheduled','in_progress','completed','cancelled') NOT NULL DEFAULT 'draft',
  `surveyed_by` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `surveys_survey_code_unique` (`survey_code`),
  KEY `surveys_created_by_foreign` (`created_by`),
  KEY `surveys_customer_id_index` (`customer_id`),
  KEY `surveys_survey_date_index` (`survey_date`),
  KEY `surveys_status_index` (`status`),
  KEY `surveys_survey_result_index` (`survey_result`),
  KEY `surveys_surveyed_by_index` (`surveyed_by`),
  CONSTRAINT `surveys_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `surveys_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `surveys_surveyed_by_foreign` FOREIGN KEY (`surveyed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `surveys`
--

LOCK TABLES `surveys` WRITE;
/*!40000 ALTER TABLE `surveys` DISABLE KEYS */;
INSERT INTO `surveys` VALUES (1,'SURV-0001',2,'2026-08-22','Jl. Gatot Subroto No. 20, Medan',3.5951960,98.6722260,'Andi Wijaya','081234567891','Belum tersedia koneksi dedicated.','POP Medan Barat',1250.00,'Fiber Optic',1500.00,1,1,0,'Survey selesai. Jalur FO feasible untuk implementasi.','feasible','completed',1,1,'2026-08-22 02:19:42','2026-08-22 02:23:39','2026-08-22 02:23:39'),(2,'SURV-0002',2,'2026-08-22','Jl. Gatot Subroto No. 20, Medan',3.5951960,98.6722260,'Andi Wijaya','081234567891','Belum tersedia koneksi dedicated.','POP Medan Barat',1250.00,'Fiber Optic',1500.00,1,1,0,'Survey aktif untuk proses design jaringan.','feasible','completed',1,1,'2026-08-22 06:54:01','2026-08-22 06:54:01',NULL);
/*!40000 ALTER TABLE `surveys` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_role_id_foreign` (`role_id`),
  KEY `users_status_index` (`status`),
  CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,1,'Super Administrator','admin@isp.local',NULL,'$2y$12$3XJThhI34tYlEJkKTc7uDOjCwDsXAdrVg4EgF8hMS1nbcNNznrmMK','active',NULL,'2026-08-20 01:16:28','2026-08-25 20:05:01');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vendors`
--

DROP TABLE IF EXISTS `vendors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vendors` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `vendor_code` varchar(255) NOT NULL,
  `vendor_name` varchar(255) NOT NULL,
  `contact_person` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `tax_number` varchar(100) DEFAULT NULL,
  `payment_term_days` smallint(5) unsigned NOT NULL DEFAULT 0,
  `notes` text DEFAULT NULL,
  `status` enum('active','inactive','blacklisted') NOT NULL DEFAULT 'active',
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vendors_vendor_code_unique` (`vendor_code`),
  KEY `vendors_created_by_foreign` (`created_by`),
  KEY `vendors_vendor_name_index` (`vendor_name`),
  KEY `vendors_status_index` (`status`),
  CONSTRAINT `vendors_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `vendors`
--

LOCK TABLES `vendors` WRITE;
/*!40000 ALTER TABLE `vendors` DISABLE KEYS */;
INSERT INTO `vendors` VALUES (1,'VND-0001','PT Sumber Network Indonesia','Budi Santoso','sales@sumbernetwork.local','081234567890','Jl. Industri No. 10, Medan','01.234.567.8-901.000',30,'Vendor perangkat jaringan dan material fiber optic.','active',1,'2026-08-24 03:03:09','2026-08-24 03:03:09',NULL);
/*!40000 ALTER TABLE `vendors` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-08-28 11:49:03
