-- MariaDB dump 10.19  Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: localhost    Database: rental_stock
-- ------------------------------------------------------
-- 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 */;

--
-- Table structure for table `approval_requests`
--

DROP TABLE IF EXISTS `approval_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `approval_requests` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `request_id` varchar(255) NOT NULL,
  `request_type` enum('DEPLOYMENT','RETURN','TRANSFER','LOCATION_CORRECTION','NEW_MASTER_ID','ATTACH_ASSET') NOT NULL,
  `requested_by` bigint(20) unsigned NOT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `rental_device_code` varchar(50) DEFAULT NULL,
  `equipment_type` varchar(100) DEFAULT NULL,
  `serial_number` varchar(100) DEFAULT NULL,
  `from_location` text DEFAULT NULL,
  `to_location` text DEFAULT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('PENDING','APPROVED','REJECTED','EXPIRED','CANCELLED') NOT NULL DEFAULT 'PENDING',
  `expires_at` timestamp NULL DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `approval_requests_request_id_unique` (`request_id`),
  KEY `approval_requests_requested_by_foreign` (`requested_by`),
  KEY `approval_requests_approved_by_foreign` (`approved_by`),
  CONSTRAINT `approval_requests_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`),
  CONSTRAINT `approval_requests_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `approval_requests`
--

LOCK TABLES `approval_requests` WRITE;
/*!40000 ALTER TABLE `approval_requests` DISABLE KEYS */;
/*!40000 ALTER TABLE `approval_requests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `asset_movements`
--

DROP TABLE IF EXISTS `asset_movements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `asset_movements` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `movement_id` varchar(255) NOT NULL,
  `rental_device_code` varchar(50) NOT NULL,
  `equipment_type` varchar(100) DEFAULT NULL,
  `serial_number` varchar(100) DEFAULT NULL,
  `from_warehouse_id` bigint(20) unsigned DEFAULT NULL,
  `from_zone_id` bigint(20) unsigned DEFAULT NULL,
  `from_rack_id` bigint(20) unsigned DEFAULT NULL,
  `from_shelf_id` bigint(20) unsigned DEFAULT NULL,
  `from_site_id` bigint(20) unsigned DEFAULT NULL,
  `from_location_type` varchar(20) DEFAULT NULL,
  `to_warehouse_id` bigint(20) unsigned DEFAULT NULL,
  `to_zone_id` bigint(20) unsigned DEFAULT NULL,
  `to_rack_id` bigint(20) unsigned DEFAULT NULL,
  `to_shelf_id` bigint(20) unsigned DEFAULT NULL,
  `to_site_id` bigint(20) unsigned DEFAULT NULL,
  `to_location_type` varchar(20) DEFAULT NULL,
  `requested_by` bigint(20) unsigned NOT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('PENDING','APPROVED','REJECTED','COMPLETED') NOT NULL DEFAULT 'PENDING',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `asset_movements_movement_id_unique` (`movement_id`),
  KEY `asset_movements_from_warehouse_id_foreign` (`from_warehouse_id`),
  KEY `asset_movements_from_zone_id_foreign` (`from_zone_id`),
  KEY `asset_movements_from_rack_id_foreign` (`from_rack_id`),
  KEY `asset_movements_from_shelf_id_foreign` (`from_shelf_id`),
  KEY `asset_movements_from_site_id_foreign` (`from_site_id`),
  KEY `asset_movements_to_warehouse_id_foreign` (`to_warehouse_id`),
  KEY `asset_movements_to_zone_id_foreign` (`to_zone_id`),
  KEY `asset_movements_to_rack_id_foreign` (`to_rack_id`),
  KEY `asset_movements_to_shelf_id_foreign` (`to_shelf_id`),
  KEY `asset_movements_to_site_id_foreign` (`to_site_id`),
  CONSTRAINT `asset_movements_from_rack_id_foreign` FOREIGN KEY (`from_rack_id`) REFERENCES `warehouse_racks` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_from_shelf_id_foreign` FOREIGN KEY (`from_shelf_id`) REFERENCES `warehouse_shelves` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_from_site_id_foreign` FOREIGN KEY (`from_site_id`) REFERENCES `sites` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_from_warehouse_id_foreign` FOREIGN KEY (`from_warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_from_zone_id_foreign` FOREIGN KEY (`from_zone_id`) REFERENCES `warehouse_zones` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_to_rack_id_foreign` FOREIGN KEY (`to_rack_id`) REFERENCES `warehouse_racks` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_to_shelf_id_foreign` FOREIGN KEY (`to_shelf_id`) REFERENCES `warehouse_shelves` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_to_site_id_foreign` FOREIGN KEY (`to_site_id`) REFERENCES `sites` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_to_warehouse_id_foreign` FOREIGN KEY (`to_warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE SET NULL,
  CONSTRAINT `asset_movements_to_zone_id_foreign` FOREIGN KEY (`to_zone_id`) REFERENCES `warehouse_zones` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `asset_movements`
--

LOCK TABLES `asset_movements` WRITE;
/*!40000 ALTER TABLE `asset_movements` DISABLE KEYS */;
/*!40000 ALTER TABLE `asset_movements` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `audit_logs`
--

DROP TABLE IF EXISTS `audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `audit_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `action` varchar(100) NOT NULL,
  `entity_type` varchar(100) DEFAULT NULL,
  `entity_id` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`old_values`)),
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`new_values`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `audit_logs_user_id_foreign` (`user_id`),
  CONSTRAINT `audit_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `audit_logs`
--

LOCK TABLES `audit_logs` WRITE;
/*!40000 ALTER TABLE `audit_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `audit_logs` 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,
  `customer_name` varchar(255) NOT NULL,
  `contact_person` varchar(255) DEFAULT NULL,
  `contact_phone` varchar(255) DEFAULT NULL,
  `contact_email` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `district` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `customers_customer_code_unique` (`customer_code`)
) ENGINE=InnoDB 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 */;
/*!40000 ALTER TABLE `customers` 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=18 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,'2026_09_01_000001_create_roles_table',1),(2,'2026_09_01_000002_create_users_table',1),(3,'2026_09_01_000003_create_password_reset_tokens_table',1),(4,'2026_09_01_000004_create_customers_table',1),(5,'2026_09_01_000005_create_warehouses_table',1),(6,'2026_09_01_000006_create_warehouse_zones_table',1),(7,'2026_09_01_000007_create_warehouse_racks_table',1),(8,'2026_09_01_000008_create_warehouse_shelves_table',1),(9,'2026_09_01_000009_create_sites_table',1),(10,'2026_09_01_000010_create_rental_devices_table',1),(11,'2026_09_01_000011_create_approval_requests_table',1),(12,'2026_09_01_000012_create_asset_movements_table',1),(13,'2026_09_01_000013_create_stock_verification_sessions_table',1),(14,'2026_09_01_000014_create_stock_verification_items_table',1),(15,'2026_09_01_000015_create_notifications_table',1),(16,'2026_09_01_000016_create_audit_logs_table',1),(17,'2026_09_01_000017_create_sessions_table',1);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `notifications`
--

DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notifications` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `type` varchar(100) NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications_user_id_foreign` (`user_id`),
  CONSTRAINT `notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `notifications`
--

LOCK TABLES `notifications` WRITE;
/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
/*!40000 ALTER TABLE `notifications` 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 `rental_devices`
--

DROP TABLE IF EXISTS `rental_devices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rental_devices` (
  `rental_device_code` varchar(50) NOT NULL,
  `pos_oil_serial` varchar(100) DEFAULT NULL,
  `slip_printer_serial` varchar(100) DEFAULT NULL,
  `cash_drawer_serial` varchar(100) DEFAULT NULL,
  `elcb_pos_oil_serial` varchar(100) DEFAULT NULL,
  `keyboard_pos_serial` varchar(100) DEFAULT NULL,
  `mouse_pos_serial` varchar(100) DEFAULT NULL,
  `cpu_bo_serial` varchar(100) DEFAULT NULL,
  `screen_monitor_serial` varchar(100) DEFAULT NULL,
  `laser_printer_serial` varchar(100) DEFAULT NULL,
  `ups_serial` varchar(100) DEFAULT NULL,
  `surge_protection_serial` varchar(100) DEFAULT NULL,
  `switch_hub_serial` varchar(100) DEFAULT NULL,
  `elcb_bo_serial` varchar(100) DEFAULT NULL,
  `keyboard_bo_serial` varchar(100) DEFAULT NULL,
  `mouse_bo_serial` varchar(100) DEFAULT NULL,
  `enable_card_serial` varchar(100) DEFAULT NULL,
  `fdm_serial` varchar(100) DEFAULT NULL,
  `rack_15u_serial` varchar(100) DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `location_type` enum('WAREHOUSE','SITE','TRANSIT','MAINTENANCE','OTHER') NOT NULL DEFAULT 'WAREHOUSE',
  `warehouse_id` bigint(20) unsigned DEFAULT NULL,
  `zone_id` bigint(20) unsigned DEFAULT NULL,
  `rack_id` bigint(20) unsigned DEFAULT NULL,
  `shelf_id` bigint(20) unsigned DEFAULT NULL,
  `site_id` bigint(20) unsigned DEFAULT NULL,
  `status` enum('IN_STOCK','DEPLOYED','RENTED','MAINTENANCE','RETURNED','LOST') NOT NULL DEFAULT 'IN_STOCK',
  `rental_start_date` date DEFAULT NULL,
  `rental_end_date` date DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`rental_device_code`),
  KEY `rental_devices_customer_id_foreign` (`customer_id`),
  KEY `rental_devices_warehouse_id_foreign` (`warehouse_id`),
  KEY `rental_devices_zone_id_foreign` (`zone_id`),
  KEY `rental_devices_rack_id_foreign` (`rack_id`),
  KEY `rental_devices_shelf_id_foreign` (`shelf_id`),
  KEY `rental_devices_site_id_foreign` (`site_id`),
  CONSTRAINT `rental_devices_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `rental_devices_rack_id_foreign` FOREIGN KEY (`rack_id`) REFERENCES `warehouse_racks` (`id`),
  CONSTRAINT `rental_devices_shelf_id_foreign` FOREIGN KEY (`shelf_id`) REFERENCES `warehouse_shelves` (`id`),
  CONSTRAINT `rental_devices_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `sites` (`id`),
  CONSTRAINT `rental_devices_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `rental_devices_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `warehouse_zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `rental_devices`
--

LOCK TABLES `rental_devices` WRITE;
/*!40000 ALTER TABLE `rental_devices` DISABLE KEYS */;
/*!40000 ALTER TABLE `rental_devices` 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` text 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=4 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,'ADMIN','Full system access','2026-09-03 22:02:30','2026-09-03 22:02:30'),(2,'MANAGER','Can approve requests, view reports','2026-09-03 22:02:30','2026-09-03 22:02:30'),(3,'STAFF','Can scan, verify stock, create requests','2026-09-03 22:02:30','2026-09-03 22:02:30');
/*!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_foreign` (`user_id`),
  CONSTRAINT `sessions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) 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 */;
/*!40000 ALTER TABLE `sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sites`
--

DROP TABLE IF EXISTS `sites`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sites` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `site_code` varchar(255) NOT NULL,
  `site_name` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `address` text DEFAULT NULL,
  `district` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `contact_name` varchar(255) DEFAULT NULL,
  `contact_phone` varchar(255) DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sites_site_code_unique` (`site_code`),
  KEY `sites_customer_id_foreign` (`customer_id`),
  CONSTRAINT `sites_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sites`
--

LOCK TABLES `sites` WRITE;
/*!40000 ALTER TABLE `sites` DISABLE KEYS */;
/*!40000 ALTER TABLE `sites` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `stock_verification_items`
--

DROP TABLE IF EXISTS `stock_verification_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stock_verification_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `session_id` bigint(20) unsigned NOT NULL,
  `rental_device_code` varchar(50) DEFAULT NULL,
  `serial_number` varchar(100) NOT NULL,
  `equipment_type` varchar(100) DEFAULT NULL,
  `expected_warehouse_id` bigint(20) unsigned DEFAULT NULL,
  `expected_zone_id` bigint(20) unsigned DEFAULT NULL,
  `expected_rack_id` bigint(20) unsigned DEFAULT NULL,
  `expected_shelf_id` bigint(20) unsigned DEFAULT NULL,
  `actual_warehouse_id` bigint(20) unsigned DEFAULT NULL,
  `actual_zone_id` bigint(20) unsigned DEFAULT NULL,
  `actual_rack_id` bigint(20) unsigned DEFAULT NULL,
  `actual_shelf_id` bigint(20) unsigned DEFAULT NULL,
  `result` enum('MATCHED','WRONG_LOCATION','UNKNOWN','MISSING','DUPLICATE') NOT NULL,
  `notes` text DEFAULT NULL,
  `scanned_by` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_verification_items_session_id_foreign` (`session_id`),
  KEY `stock_verification_items_scanned_by_foreign` (`scanned_by`),
  KEY `stock_verification_items_expected_warehouse_id_foreign` (`expected_warehouse_id`),
  KEY `stock_verification_items_expected_zone_id_foreign` (`expected_zone_id`),
  KEY `stock_verification_items_expected_rack_id_foreign` (`expected_rack_id`),
  KEY `stock_verification_items_expected_shelf_id_foreign` (`expected_shelf_id`),
  KEY `stock_verification_items_actual_warehouse_id_foreign` (`actual_warehouse_id`),
  KEY `stock_verification_items_actual_zone_id_foreign` (`actual_zone_id`),
  KEY `stock_verification_items_actual_rack_id_foreign` (`actual_rack_id`),
  KEY `stock_verification_items_actual_shelf_id_foreign` (`actual_shelf_id`),
  CONSTRAINT `stock_verification_items_actual_rack_id_foreign` FOREIGN KEY (`actual_rack_id`) REFERENCES `warehouse_racks` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_actual_shelf_id_foreign` FOREIGN KEY (`actual_shelf_id`) REFERENCES `warehouse_shelves` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_actual_warehouse_id_foreign` FOREIGN KEY (`actual_warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_actual_zone_id_foreign` FOREIGN KEY (`actual_zone_id`) REFERENCES `warehouse_zones` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_expected_rack_id_foreign` FOREIGN KEY (`expected_rack_id`) REFERENCES `warehouse_racks` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_expected_shelf_id_foreign` FOREIGN KEY (`expected_shelf_id`) REFERENCES `warehouse_shelves` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_expected_warehouse_id_foreign` FOREIGN KEY (`expected_warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_expected_zone_id_foreign` FOREIGN KEY (`expected_zone_id`) REFERENCES `warehouse_zones` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_verification_items_scanned_by_foreign` FOREIGN KEY (`scanned_by`) REFERENCES `users` (`id`),
  CONSTRAINT `stock_verification_items_session_id_foreign` FOREIGN KEY (`session_id`) REFERENCES `stock_verification_sessions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `stock_verification_items`
--

LOCK TABLES `stock_verification_items` WRITE;
/*!40000 ALTER TABLE `stock_verification_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_verification_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `stock_verification_sessions`
--

DROP TABLE IF EXISTS `stock_verification_sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stock_verification_sessions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `session_code` varchar(255) NOT NULL,
  `warehouse_id` bigint(20) unsigned NOT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `status` enum('IN_PROGRESS','COMPLETED','CANCELLED') NOT NULL DEFAULT 'IN_PROGRESS',
  `total_scanned` int(11) NOT NULL DEFAULT 0,
  `total_matched` int(11) NOT NULL DEFAULT 0,
  `total_unknown` int(11) NOT NULL DEFAULT 0,
  `total_wrong_location` int(11) NOT NULL DEFAULT 0,
  `total_missing` int(11) NOT NULL DEFAULT 0,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `stock_verification_sessions_session_code_unique` (`session_code`),
  KEY `stock_verification_sessions_warehouse_id_foreign` (`warehouse_id`),
  KEY `stock_verification_sessions_created_by_foreign` (`created_by`),
  CONSTRAINT `stock_verification_sessions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `stock_verification_sessions_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `stock_verification_sessions`
--

LOCK TABLES `stock_verification_sessions` WRITE;
/*!40000 ALTER TABLE `stock_verification_sessions` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_verification_sessions` 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,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `role_id` bigint(20) unsigned NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `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`),
  CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 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,'Administrator','admin@rental.com',NULL,'$2y$12$u7m5Y.zBWM/b41uNBeTCvOP/PHirLeURBuN/phGqObNMMnveUhbwa',1,'012345678',1,NULL,'2026-09-03 22:02:30','2026-09-03 22:02:30'),(2,'Manager','manager@rental.com',NULL,'$2y$12$MH01meJWYPpTyTHLIt947.4BuoRpnhAKHfnElH7BJ026zQg7H86.C',2,'012345679',1,NULL,'2026-09-03 22:02:31','2026-09-03 22:02:31'),(3,'Staff','staff@rental.com',NULL,'$2y$12$qy2WHx7D4s5E..kjkzqdlOQTSA2C.aTvVa9Bj84m4fEZzZpyJ8Fdu',3,'012345680',1,NULL,'2026-09-03 22:02:31','2026-09-03 22:02:31');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `warehouse_racks`
--

DROP TABLE IF EXISTS `warehouse_racks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `warehouse_racks` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `zone_id` bigint(20) unsigned NOT NULL,
  `rack_code` varchar(255) NOT NULL,
  `rack_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `warehouse_racks_zone_id_rack_code_unique` (`zone_id`,`rack_code`),
  CONSTRAINT `warehouse_racks_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `warehouse_zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `warehouse_racks`
--

LOCK TABLES `warehouse_racks` WRITE;
/*!40000 ALTER TABLE `warehouse_racks` DISABLE KEYS */;
/*!40000 ALTER TABLE `warehouse_racks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `warehouse_shelves`
--

DROP TABLE IF EXISTS `warehouse_shelves`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `warehouse_shelves` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `rack_id` bigint(20) unsigned NOT NULL,
  `shelf_code` varchar(255) NOT NULL,
  `shelf_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `warehouse_shelves_rack_id_shelf_code_unique` (`rack_id`,`shelf_code`),
  CONSTRAINT `warehouse_shelves_rack_id_foreign` FOREIGN KEY (`rack_id`) REFERENCES `warehouse_racks` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `warehouse_shelves`
--

LOCK TABLES `warehouse_shelves` WRITE;
/*!40000 ALTER TABLE `warehouse_shelves` DISABLE KEYS */;
/*!40000 ALTER TABLE `warehouse_shelves` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `warehouse_zones`
--

DROP TABLE IF EXISTS `warehouse_zones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `warehouse_zones` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `warehouse_id` bigint(20) unsigned NOT NULL,
  `zone_code` varchar(255) NOT NULL,
  `zone_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `warehouse_zones_warehouse_id_zone_code_unique` (`warehouse_id`,`zone_code`),
  CONSTRAINT `warehouse_zones_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `warehouse_zones`
--

LOCK TABLES `warehouse_zones` WRITE;
/*!40000 ALTER TABLE `warehouse_zones` DISABLE KEYS */;
/*!40000 ALTER TABLE `warehouse_zones` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `warehouses`
--

DROP TABLE IF EXISTS `warehouses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `warehouses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `warehouse_code` varchar(255) NOT NULL,
  `warehouse_name` varchar(255) NOT NULL,
  `address` text DEFAULT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `warehouses_warehouse_code_unique` (`warehouse_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `warehouses`
--

LOCK TABLES `warehouses` WRITE;
/*!40000 ALTER TABLE `warehouses` DISABLE KEYS */;
/*!40000 ALTER TABLE `warehouses` 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-09-04 12:02:43
