-- MariaDB dump 10.19  Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: 127.0.0.1    Database: jevapos
-- ------------------------------------------------------
-- 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 `accommodation_bookings`
--

DROP TABLE IF EXISTS `accommodation_bookings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_bookings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `room_id` bigint(20) unsigned NOT NULL,
  `rate_plan_id` bigint(20) unsigned DEFAULT NULL,
  `meal_plan_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `booking_no` varchar(255) NOT NULL,
  `confirmation_no` varchar(255) DEFAULT NULL,
  `guest_name` varchar(255) NOT NULL,
  `guest_phone` varchar(255) DEFAULT NULL,
  `nationality` varchar(255) DEFAULT NULL,
  `id_passport_no` varchar(255) DEFAULT NULL,
  `adults` int(10) unsigned NOT NULL DEFAULT 1,
  `children` int(10) unsigned NOT NULL DEFAULT 0,
  `child_ages` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`child_ages`)),
  `source` varchar(255) NOT NULL DEFAULT 'walk_in',
  `check_in_at` datetime NOT NULL,
  `expected_check_out_at` datetime NOT NULL,
  `actual_check_out_at` datetime DEFAULT NULL,
  `reserved_at` timestamp NULL DEFAULT NULL,
  `nights` int(10) unsigned NOT NULL DEFAULT 1,
  `rate` decimal(14,2) NOT NULL DEFAULT 0.00,
  `base_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `occupancy_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `extras_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `rate_snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`rate_snapshot`)),
  `total_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `paid_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `payment_method_id` bigint(20) unsigned DEFAULT NULL,
  `charge_type_id` bigint(20) unsigned DEFAULT NULL,
  `balance_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `payment_status` varchar(255) NOT NULL DEFAULT 'unpaid',
  `status` varchar(255) NOT NULL DEFAULT 'checked_in',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accommodation_bookings_booking_no_unique` (`booking_no`),
  KEY `accommodation_bookings_customer_id_foreign` (`customer_id`),
  KEY `accommodation_bookings_user_id_foreign` (`user_id`),
  KEY `accommodation_bookings_payment_method_id_foreign` (`payment_method_id`),
  KEY `accommodation_bookings_charge_type_id_foreign` (`charge_type_id`),
  KEY `idx_accommodation_bookings_room_id_status` (`room_id`,`status`),
  KEY `idx_accommodation_bookings_check_in_at` (`check_in_at`),
  KEY `idx_accommodation_bookings_expected_check_out_at` (`expected_check_out_at`),
  KEY `idx_accommodation_bookings_status_check_in_at` (`status`,`check_in_at`),
  KEY `accommodation_bookings_rate_plan_id_foreign` (`rate_plan_id`),
  KEY `accommodation_bookings_meal_plan_id_foreign` (`meal_plan_id`),
  KEY `acc_booking_availability_idx` (`room_id`,`status`,`check_in_at`,`expected_check_out_at`),
  KEY `accommodation_bookings_source_status_index` (`source`,`status`),
  CONSTRAINT `accommodation_bookings_charge_type_id_foreign` FOREIGN KEY (`charge_type_id`) REFERENCES `accommodation_charge_types` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_bookings_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_bookings_meal_plan_id_foreign` FOREIGN KEY (`meal_plan_id`) REFERENCES `accommodation_meal_plans` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_bookings_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_bookings_rate_plan_id_foreign` FOREIGN KEY (`rate_plan_id`) REFERENCES `accommodation_rate_plans` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_bookings_room_id_foreign` FOREIGN KEY (`room_id`) REFERENCES `accommodation_rooms` (`id`) ON DELETE CASCADE,
  CONSTRAINT `accommodation_bookings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `accommodation_bookings`
--

LOCK TABLES `accommodation_bookings` WRITE;
/*!40000 ALTER TABLE `accommodation_bookings` DISABLE KEYS */;
/*!40000 ALTER TABLE `accommodation_bookings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_charge_types`
--

DROP TABLE IF EXISTS `accommodation_charge_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_charge_types` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accommodation_charge_types_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accommodation_charge_types`
--

LOCK TABLES `accommodation_charge_types` WRITE;
/*!40000 ALTER TABLE `accommodation_charge_types` DISABLE KEYS */;
INSERT INTO `accommodation_charge_types` VALUES (1,'BED ONLY',NULL,1,'2026-09-10 15:07:42','2026-09-10 15:07:42'),(2,'BED AND BREAKFAST',NULL,1,'2026-09-10 15:07:42','2026-09-10 15:07:42'),(3,'DEPOSIT',NULL,1,'2026-09-10 15:07:42','2026-09-10 15:07:42'),(4,'PARTIAL PAYMENT',NULL,1,'2026-09-10 15:07:42','2026-09-10 15:07:42');
/*!40000 ALTER TABLE `accommodation_charge_types` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_child_rates`
--

DROP TABLE IF EXISTS `accommodation_child_rates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_child_rates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `rate_plan_id` bigint(20) unsigned NOT NULL,
  `minimum_age` int(10) unsigned NOT NULL DEFAULT 0,
  `maximum_age` int(10) unsigned NOT NULL DEFAULT 17,
  `pricing_type` varchar(255) NOT NULL DEFAULT 'free',
  `amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `accommodation_child_rates_rate_plan_id_foreign` (`rate_plan_id`),
  CONSTRAINT `accommodation_child_rates_rate_plan_id_foreign` FOREIGN KEY (`rate_plan_id`) REFERENCES `accommodation_rate_plans` (`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 `accommodation_child_rates`
--

LOCK TABLES `accommodation_child_rates` WRITE;
/*!40000 ALTER TABLE `accommodation_child_rates` DISABLE KEYS */;
/*!40000 ALTER TABLE `accommodation_child_rates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_floors`
--

DROP TABLE IF EXISTS `accommodation_floors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_floors` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `hotel_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `accommodation_floors_hotel_id_foreign` (`hotel_id`),
  CONSTRAINT `accommodation_floors_hotel_id_foreign` FOREIGN KEY (`hotel_id`) REFERENCES `accommodation_hotels` (`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 `accommodation_floors`
--

LOCK TABLES `accommodation_floors` WRITE;
/*!40000 ALTER TABLE `accommodation_floors` DISABLE KEYS */;
INSERT INTO `accommodation_floors` VALUES (1,1,'1ST',NULL,1,'2026-09-10 14:37:11','2026-09-10 14:37:11'),(2,1,'2ND',NULL,1,'2026-09-10 14:37:11','2026-09-10 14:37:11'),(3,1,'3RD',NULL,1,'2026-09-10 14:37:11','2026-09-10 14:37:11'),(4,1,'4TH',NULL,1,'2026-09-10 14:37:11','2026-09-10 14:37:11');
/*!40000 ALTER TABLE `accommodation_floors` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_hotels`
--

DROP TABLE IF EXISTS `accommodation_hotels`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_hotels` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `expected_rooms` int(10) unsigned DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accommodation_hotels`
--

LOCK TABLES `accommodation_hotels` WRITE;
/*!40000 ALTER TABLE `accommodation_hotels` DISABLE KEYS */;
INSERT INTO `accommodation_hotels` VALUES (1,'JL MOTEL','0712345678','jl@gmail.com','Kakamega',10,1,'2026-09-10 13:54:36','2026-09-10 13:54:36');
/*!40000 ALTER TABLE `accommodation_hotels` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_meal_plans`
--

DROP TABLE IF EXISTS `accommodation_meal_plans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_meal_plans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(40) NOT NULL,
  `name` varchar(255) NOT NULL,
  `includes_breakfast` tinyint(1) NOT NULL DEFAULT 0,
  `includes_lunch` tinyint(1) NOT NULL DEFAULT 0,
  `includes_dinner` tinyint(1) NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accommodation_meal_plans_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accommodation_meal_plans`
--

LOCK TABLES `accommodation_meal_plans` WRITE;
/*!40000 ALTER TABLE `accommodation_meal_plans` DISABLE KEYS */;
INSERT INTO `accommodation_meal_plans` VALUES (1,'BED_ONLY','Bed Only',0,0,0,NULL,1,'2026-09-21 18:48:16','2026-09-21 18:48:16'),(2,'BED_BREAKFAST','Bed and Breakfast',1,0,0,NULL,1,'2026-09-21 18:48:16','2026-09-21 18:48:16'),(3,'HALF_BOARD','Half Board',1,0,1,NULL,1,'2026-09-21 18:48:16','2026-09-21 18:48:16'),(4,'FULL_BOARD','Full Board',1,1,1,NULL,1,'2026-09-21 18:48:16','2026-09-21 18:48:16');
/*!40000 ALTER TABLE `accommodation_meal_plans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_rate_plans`
--

DROP TABLE IF EXISTS `accommodation_rate_plans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_rate_plans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `hotel_id` bigint(20) unsigned DEFAULT NULL,
  `room_type_id` bigint(20) unsigned NOT NULL,
  `meal_plan_id` bigint(20) unsigned DEFAULT NULL,
  `code` varchar(60) NOT NULL,
  `name` varchar(255) NOT NULL,
  `base_rate` decimal(14,2) NOT NULL DEFAULT 0.00,
  `base_adults` int(10) unsigned NOT NULL DEFAULT 1,
  `extra_adult_rate` decimal(14,2) NOT NULL DEFAULT 0.00,
  `minimum_stay` int(10) unsigned NOT NULL DEFAULT 1,
  `maximum_stay` int(10) unsigned DEFAULT NULL,
  `is_refundable` tinyint(1) NOT NULL DEFAULT 1,
  `cancellation_policy` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accommodation_rate_plans_code_unique` (`code`),
  KEY `accommodation_rate_plans_hotel_id_foreign` (`hotel_id`),
  KEY `accommodation_rate_plans_meal_plan_id_foreign` (`meal_plan_id`),
  KEY `accommodation_rate_plans_room_type_id_is_active_index` (`room_type_id`,`is_active`),
  CONSTRAINT `accommodation_rate_plans_hotel_id_foreign` FOREIGN KEY (`hotel_id`) REFERENCES `accommodation_hotels` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_rate_plans_meal_plan_id_foreign` FOREIGN KEY (`meal_plan_id`) REFERENCES `accommodation_meal_plans` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_rate_plans_room_type_id_foreign` FOREIGN KEY (`room_type_id`) REFERENCES `accommodation_room_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accommodation_rate_plans`
--

LOCK TABLES `accommodation_rate_plans` WRITE;
/*!40000 ALTER TABLE `accommodation_rate_plans` DISABLE KEYS */;
INSERT INTO `accommodation_rate_plans` VALUES (1,NULL,1,1,'BED-1-SINGLE','Single - Bed Only',1000.00,1,0.00,1,NULL,1,NULL,1,'2026-09-21 18:48:16','2026-09-21 18:48:16'),(2,NULL,2,1,'BED-2-DOUBLE','Double - Bed Only',1200.00,2,0.00,1,NULL,1,NULL,1,'2026-09-21 18:48:16','2026-09-21 18:48:16'),(3,NULL,3,1,'BED-3-FAMILY','Family - Bed Only',1500.00,2,0.00,1,NULL,1,NULL,1,'2026-09-21 18:48:16','2026-09-21 18:48:16');
/*!40000 ALTER TABLE `accommodation_rate_plans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_room_types`
--

DROP TABLE IF EXISTS `accommodation_room_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_room_types` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `default_rate` decimal(14,2) NOT NULL DEFAULT 0.00,
  `capacity` int(10) unsigned NOT NULL DEFAULT 1,
  `standard_adults` int(10) unsigned NOT NULL DEFAULT 1,
  `max_adults` int(10) unsigned NOT NULL DEFAULT 1,
  `max_children` int(10) unsigned NOT NULL DEFAULT 0,
  `max_occupancy` int(10) unsigned NOT NULL DEFAULT 1,
  `allows_children` tinyint(1) NOT NULL DEFAULT 1,
  `minimum_guest_age` int(10) unsigned NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accommodation_room_types`
--

LOCK TABLES `accommodation_room_types` WRITE;
/*!40000 ALTER TABLE `accommodation_room_types` DISABLE KEYS */;
INSERT INTO `accommodation_room_types` VALUES (1,'Single',1000.00,1,1,1,0,1,1,0,NULL,1,'2026-09-09 22:18:46','2026-09-09 22:18:46'),(2,'Double',1200.00,2,2,2,1,2,1,0,NULL,1,'2026-09-09 22:19:03','2026-09-09 22:19:03'),(3,'Family',1500.00,5,2,5,4,5,1,0,NULL,1,'2026-09-09 22:19:16','2026-09-09 22:19:16');
/*!40000 ALTER TABLE `accommodation_room_types` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_rooms`
--

DROP TABLE IF EXISTS `accommodation_rooms`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_rooms` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `hotel_id` bigint(20) unsigned DEFAULT NULL,
  `floor_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `room_type_id` bigint(20) unsigned DEFAULT NULL,
  `room_no` varchar(255) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `floor` varchar(255) DEFAULT NULL,
  `rate` decimal(14,2) NOT NULL DEFAULT 0.00,
  `status` varchar(255) NOT NULL DEFAULT 'vacant',
  `notes` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accommodation_rooms_room_no_unique` (`room_no`),
  KEY `accommodation_rooms_room_type_id_foreign` (`room_type_id`),
  KEY `accommodation_rooms_floor_id_foreign` (`floor_id`),
  KEY `idx_accommodation_rooms_branch_id_status` (`branch_id`,`status`),
  KEY `idx_accommodation_rooms_hotel_id_floor_id` (`hotel_id`,`floor_id`),
  CONSTRAINT `accommodation_rooms_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_rooms_floor_id_foreign` FOREIGN KEY (`floor_id`) REFERENCES `accommodation_floors` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_rooms_hotel_id_foreign` FOREIGN KEY (`hotel_id`) REFERENCES `accommodation_hotels` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accommodation_rooms_room_type_id_foreign` FOREIGN KEY (`room_type_id`) REFERENCES `accommodation_room_types` (`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 `accommodation_rooms`
--

LOCK TABLES `accommodation_rooms` WRITE;
/*!40000 ALTER TABLE `accommodation_rooms` DISABLE KEYS */;
/*!40000 ALTER TABLE `accommodation_rooms` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accommodation_seasonal_rates`
--

DROP TABLE IF EXISTS `accommodation_seasonal_rates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accommodation_seasonal_rates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `rate_plan_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `starts_on` date NOT NULL,
  `ends_on` date NOT NULL,
  `nightly_rate` decimal(14,2) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `acc_season_rate_dates_idx` (`rate_plan_id`,`starts_on`,`ends_on`),
  CONSTRAINT `accommodation_seasonal_rates_rate_plan_id_foreign` FOREIGN KEY (`rate_plan_id`) REFERENCES `accommodation_rate_plans` (`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 `accommodation_seasonal_rates`
--

LOCK TABLES `accommodation_seasonal_rates` WRITE;
/*!40000 ALTER TABLE `accommodation_seasonal_rates` DISABLE KEYS */;
/*!40000 ALTER TABLE `accommodation_seasonal_rates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `accounts`
--

DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `gl_code` varchar(255) DEFAULT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `account_type` varchar(255) DEFAULT NULL,
  `sub_account_type` varchar(255) DEFAULT NULL,
  `parent_account_id` bigint(20) unsigned DEFAULT NULL,
  `currency` varchar(255) NOT NULL DEFAULT 'KES',
  `opening_date` datetime DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accounts_gl_code_unique` (`gl_code`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accounts`
--

LOCK TABLES `accounts` WRITE;
/*!40000 ALTER TABLE `accounts` DISABLE KEYS */;
INSERT INTO `accounts` VALUES (2,'1011','Cash in Hand','asset','cash',NULL,'KES','2026-05-18 14:18:00',1,'2026-05-18 08:18:31','2026-09-22 18:01:46'),(3,'1000','KCB Bank','asset','bank',NULL,'KES','2026-05-18 14:41:00',1,'2026-05-18 08:41:33','2026-09-22 18:01:46'),(4,'1012','Petty Cash','asset','petty_cash',2,'KES','2026-05-18 14:53:00',1,'2026-05-18 08:53:39','2026-09-22 18:01:46'),(5,'1111','M-Pesa','asset','mobile_money',NULL,'KES','2026-05-19 18:42:00',1,'2026-05-19 12:42:57','2026-09-22 18:01:46'),(7,'1010','Legacy M-Pesa / Mobile Money #7','asset',NULL,NULL,'KES',NULL,0,'2026-09-15 18:13:08','2026-09-22 18:01:46'),(8,'1020','Bank / Card Collections','asset','bank',NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-22 18:01:46'),(9,'1030','Cash Sales Clearing','asset','clearing',NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-22 18:01:46'),(10,'1100','Accounts Receivable','asset',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(11,'1200','Inventory','asset',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(12,'1300','Input VAT','asset',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(13,'2000','Accounts Payable','liability',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(14,'2100','Output VAT','liability',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(15,'4000','Sales Revenue','income',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(16,'4010','Sales Returns','income',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(17,'5000','Cost of Goods Sold','expense',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(18,'6000','Operating Expenses','expense',NULL,NULL,'KES',NULL,1,'2026-09-15 18:13:08','2026-09-15 18:13:08'),(19,'1001','Legacy Cash in Hand #19','asset',NULL,NULL,'KES',NULL,0,'2026-09-15 18:14:13','2026-09-22 18:01:46'),(22,'CUSTODIA','Custodian Inventory','asset',NULL,NULL,'KES',NULL,1,'2026-09-21 20:15:22','2026-09-21 20:15:22'),(23,'HOUSEKEE','Housekeeping Supplies','expense',NULL,NULL,'KES',NULL,1,'2026-09-21 20:22:19','2026-09-21 20:22:19'),(24,'TRBANK','Legacy Main Bank Account #24','asset','cash_and_cash_equivalents',NULL,'KES','2026-09-22 20:20:32',0,'2026-09-22 17:20:32','2026-09-22 18:01:46');
/*!40000 ALTER TABLE `accounts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `attendance_days`
--

DROP TABLE IF EXISTS `attendance_days`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attendance_days` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `work_date` date NOT NULL,
  `first_in` datetime DEFAULT NULL,
  `last_out` datetime DEFAULT NULL,
  `worked_minutes` int(10) unsigned NOT NULL DEFAULT 0,
  `late_minutes` int(10) unsigned NOT NULL DEFAULT 0,
  `overtime_minutes` int(10) unsigned NOT NULL DEFAULT 0,
  `status` varchar(255) NOT NULL DEFAULT 'present',
  `source` varchar(255) NOT NULL DEFAULT 'biometric',
  `comment` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attendance_days_branch_id_user_id_work_date_unique` (`branch_id`,`user_id`,`work_date`),
  KEY `attendance_days_user_id_foreign` (`user_id`),
  KEY `attendance_days_work_date_index` (`work_date`),
  KEY `attendance_days_status_index` (`status`),
  CONSTRAINT `attendance_days_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `attendance_days_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `attendance_days`
--

LOCK TABLES `attendance_days` WRITE;
/*!40000 ALTER TABLE `attendance_days` DISABLE KEYS */;
/*!40000 ALTER TABLE `attendance_days` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `attendance_sync_logs`
--

DROP TABLE IF EXISTS `attendance_sync_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attendance_sync_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `device_id` bigint(20) unsigned NOT NULL,
  `started_at` datetime NOT NULL,
  `completed_at` datetime DEFAULT NULL,
  `imported_count` int(10) unsigned NOT NULL DEFAULT 0,
  `skipped_count` int(10) unsigned NOT NULL DEFAULT 0,
  `error_count` int(10) unsigned NOT NULL DEFAULT 0,
  `status` varchar(255) NOT NULL DEFAULT 'running',
  `message` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendance_sync_logs_device_id_foreign` (`device_id`),
  CONSTRAINT `attendance_sync_logs_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `biometric_devices` (`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 `attendance_sync_logs`
--

LOCK TABLES `attendance_sync_logs` WRITE;
/*!40000 ALTER TABLE `attendance_sync_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `attendance_sync_logs` 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,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `module` varchar(255) NOT NULL,
  `action` varchar(255) NOT NULL,
  `auditable_type` varchar(255) DEFAULT NULL,
  `auditable_id` bigint(20) unsigned DEFAULT NULL,
  `reference_no` varchar(255) 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`)),
  `reason` text DEFAULT NULL,
  `ip_address` varchar(255) 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_index` (`user_id`),
  KEY `audit_logs_branch_id_index` (`branch_id`),
  KEY `audit_logs_module_index` (`module`),
  KEY `audit_logs_action_index` (`action`),
  KEY `audit_logs_auditable_type_index` (`auditable_type`),
  KEY `audit_logs_auditable_id_index` (`auditable_id`),
  KEY `audit_logs_reference_no_index` (`reference_no`),
  KEY `idx_audit_logs_branch_id_created_at` (`branch_id`,`created_at`),
  KEY `idx_audit_logs_user_id_created_at` (`user_id`,`created_at`),
  KEY `idx_audit_logs_module_action_created_at` (`module`,`action`,`created_at`),
  KEY `idx_audit_logs_auditable_type_auditable_id` (`auditable_type`,`auditable_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 `audit_logs`
--

LOCK TABLES `audit_logs` WRITE;
/*!40000 ALTER TABLE `audit_logs` DISABLE KEYS */;
INSERT INTO `audit_logs` VALUES (1,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\"}','Successful login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 10:32:22','2026-10-02 10:32:22'),(2,3,2,'auth','idle_logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\",\"idle_minutes\":30}','User automatically logged out after inactivity','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 12:02:14','2026-10-02 12:02:14'),(3,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\"}','Successful login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 14:49:02','2026-10-02 14:49:02'),(4,3,2,'auth','idle_logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\",\"idle_minutes\":30}','User automatically logged out after inactivity','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 15:19:16','2026-10-02 15:19:16'),(5,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\"}','Successful login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:47:15','2026-10-02 21:47:15'),(6,3,2,'settings','created','App\\Models\\SystemSetting',102,'102',NULL,'{\"key\":\"etims_mode\",\"value\":\"demo\",\"group\":\"etims\",\"id\":102}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(7,3,2,'settings','created','App\\Models\\SystemSetting',103,'103',NULL,'{\"key\":\"etims_provider\",\"value\":\"jevapos_demo\",\"group\":\"etims\",\"id\":103}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(8,3,2,'settings','created','App\\Models\\SystemSetting',104,'104',NULL,'{\"key\":\"etims_auto_submit\",\"value\":\"yes\",\"group\":\"etims\",\"id\":104}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(9,3,2,'settings','created','App\\Models\\SystemSetting',105,'105',NULL,'{\"key\":\"etims_require_hs_code\",\"value\":\"no\",\"group\":\"etims\",\"id\":105}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(10,3,2,'settings','created','App\\Models\\SystemSetting',106,'106',NULL,'{\"key\":\"etims_show_receipt_details\",\"value\":\"yes\",\"group\":\"etims\",\"id\":106}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(11,3,2,'settings','created','App\\Models\\SystemSetting',107,'107',NULL,'{\"key\":\"etims_demo_verification_base_url\",\"value\":\"http:\\/\\/localhost\",\"group\":\"etims\",\"id\":107}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(12,3,2,'settings','updated','App\\Models\\SystemSetting',7,'7','{\"value\":\"no\"}','{\"value\":\"yes\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(13,3,2,'settings','etims_settings_updated','App\\Models\\EtimsBranchConfig',1,NULL,'{\"etims_mode\":null,\"etims_provider\":null,\"etims_auto_submit\":null,\"etims_require_hs_code\":null,\"etims_show_receipt_details\":null,\"etims_demo_verification_base_url\":null}','{\"etims_mode\":\"demo\",\"etims_provider\":\"jevapos_demo\",\"etims_auto_submit\":\"yes\",\"branch_id\":\"2\",\"integration_type\":\"vscu\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:54:12','2026-10-02 21:54:12'),(14,3,2,'products','created','App\\Models\\Product',1,'sample',NULL,'{\"name\":\"sample\",\"barcode\":\"1\",\"hs_code\":null,\"etims_item_classification_code\":null,\"etims_item_code\":null,\"etims_origin_country_code\":\"KE\",\"etims_package_unit_code\":null,\"etims_quantity_unit_code\":null,\"product_type\":\"single\",\"inventory_type\":\"inventory\",\"category_id\":\"1\",\"sub_category_id\":null,\"branch_id\":null,\"unit_of_measure_id\":\"1\",\"buying_price\":\"10\",\"retail_price\":\"20\",\"wholesale_price\":0,\"show_on_website\":true,\"website_description\":null,\"stock_quantity\":\"10\",\"alert_quantity\":\"5\",\"vat_method\":\"inclusive\",\"vat_type\":\"standard\",\"vat_rate\":\"16.00\",\"tax_rate_id\":\"1\",\"asset_account_id\":\"1\",\"is_active\":true,\"id\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:55:54','2026-10-02 21:55:54'),(15,3,2,'products','updated','App\\Models\\Product',1,'sample','{\"stock_quantity\":\"10.00\"}','{\"stock_quantity\":7}',NULL,'127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:56:17','2026-10-02 21:56:17'),(16,3,2,'sales','created','App\\Models\\Sale',1,'0001',NULL,'{\"total_amount\":60,\"paid_amount\":60,\"balance_amount\":0,\"items_count\":1}',NULL,'127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:56:17','2026-10-02 21:56:17'),(17,3,2,'etims','demo_document_accepted','App\\Models\\EtimsDocument',1,NULL,NULL,'{\"document_type\":\"sales_invoice\",\"local_reference\":\"0001\",\"control_unit_invoice_no\":\"DEMO-INV-00000001\"}',NULL,'127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-02 21:56:17','2026-10-02 21:56:17'),(18,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\"}','Successful login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 09:26:44','2026-10-03 09:26:44'),(19,3,2,'auth','idle_logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\",\"idle_minutes\":30}','User automatically logged out after inactivity','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 10:06:08','2026-10-03 10:06:08'),(20,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\"}','Successful login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 10:13:57','2026-10-03 10:13:57'),(21,3,2,'auth','idle_logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\",\"idle_minutes\":30}','User automatically logged out after inactivity','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 12:36:08','2026-10-03 12:36:08'),(22,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\"}','Successful login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 12:47:45','2026-10-03 12:47:45'),(23,3,2,'settings','updated','App\\Models\\SystemSetting',1,'1','{\"value\":\"username_password\"}','{\"value\":\"touch_pin\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 12:53:06','2026-10-03 12:53:06'),(24,3,2,'settings','updated','App\\Models\\SystemSetting',5,'5','{\"value\":\"00:00\"}','{\"value\":\"06:00\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 12:53:06','2026-10-03 12:53:06'),(25,3,2,'settings','updated','App\\Models\\SystemSetting',6,'6','{\"value\":\"23:59\"}','{\"value\":\"18:00\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 12:53:06','2026-10-03 12:53:06'),(26,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 12:53:26','2026-10-03 12:53:26'),(27,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"JEVATECH SOLUTIONS\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36','2026-10-03 12:53:43','2026-10-03 12:53:43');
/*!40000 ALTER TABLE `audit_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `biometric_devices`
--

DROP TABLE IF EXISTS `biometric_devices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biometric_devices` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `vendor` varchar(255) NOT NULL DEFAULT 'generic',
  `connection_type` varchar(255) NOT NULL DEFAULT 'webhook',
  `base_url` varchar(255) DEFAULT NULL,
  `device_serial` varchar(255) DEFAULT NULL,
  `ip_address` varchar(255) DEFAULT NULL,
  `port` int(10) unsigned DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `credential` text DEFAULT NULL,
  `api_key_hash` varchar(64) NOT NULL,
  `timezone` varchar(255) NOT NULL DEFAULT 'Africa/Nairobi',
  `last_sync_at` datetime DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'not_tested',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`settings`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `biometric_devices_api_key_hash_unique` (`api_key_hash`),
  KEY `biometric_devices_branch_id_foreign` (`branch_id`),
  KEY `biometric_devices_device_serial_index` (`device_serial`),
  KEY `biometric_devices_status_index` (`status`),
  CONSTRAINT `biometric_devices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`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 `biometric_devices`
--

LOCK TABLES `biometric_devices` WRITE;
/*!40000 ALTER TABLE `biometric_devices` DISABLE KEYS */;
/*!40000 ALTER TABLE `biometric_devices` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `biometric_employee_mappings`
--

DROP TABLE IF EXISTS `biometric_employee_mappings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biometric_employee_mappings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `device_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `device_user_id` varchar(255) NOT NULL,
  `employee_no` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `biometric_employee_mappings_device_id_device_user_id_unique` (`device_id`,`device_user_id`),
  KEY `biometric_employee_mappings_user_id_foreign` (`user_id`),
  KEY `biometric_employee_mappings_device_user_id_index` (`device_user_id`),
  KEY `biometric_employee_mappings_employee_no_index` (`employee_no`),
  CONSTRAINT `biometric_employee_mappings_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `biometric_devices` (`id`) ON DELETE CASCADE,
  CONSTRAINT `biometric_employee_mappings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `biometric_employee_mappings`
--

LOCK TABLES `biometric_employee_mappings` WRITE;
/*!40000 ALTER TABLE `biometric_employee_mappings` DISABLE KEYS */;
/*!40000 ALTER TABLE `biometric_employee_mappings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `biometric_punches`
--

DROP TABLE IF EXISTS `biometric_punches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biometric_punches` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `device_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `device_user_id` varchar(255) DEFAULT NULL,
  `employee_no` varchar(255) DEFAULT NULL,
  `punch_time` datetime NOT NULL,
  `punch_type` varchar(255) NOT NULL DEFAULT 'unknown',
  `verify_mode` varchar(255) DEFAULT NULL,
  `external_uid` varchar(255) NOT NULL,
  `raw_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`raw_payload`)),
  `imported_at` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `biometric_punches_external_uid_unique` (`external_uid`),
  KEY `biometric_punches_device_id_foreign` (`device_id`),
  KEY `biometric_punches_user_id_foreign` (`user_id`),
  KEY `punch_branch_user_time_idx` (`branch_id`,`user_id`,`punch_time`),
  KEY `biometric_punches_device_user_id_index` (`device_user_id`),
  KEY `biometric_punches_employee_no_index` (`employee_no`),
  KEY `biometric_punches_punch_time_index` (`punch_time`),
  CONSTRAINT `biometric_punches_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `biometric_punches_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `biometric_devices` (`id`) ON DELETE CASCADE,
  CONSTRAINT `biometric_punches_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `biometric_punches`
--

LOCK TABLES `biometric_punches` WRITE;
/*!40000 ALTER TABLE `biometric_punches` DISABLE KEYS */;
/*!40000 ALTER TABLE `biometric_punches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `branch_user`
--

DROP TABLE IF EXISTS `branch_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `branch_user` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `branch_user_user_id_branch_id_unique` (`user_id`,`branch_id`),
  KEY `branch_user_branch_id_foreign` (`branch_id`),
  CONSTRAINT `branch_user_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  CONSTRAINT `branch_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `branch_user`
--

LOCK TABLES `branch_user` WRITE;
/*!40000 ALTER TABLE `branch_user` DISABLE KEYS */;
INSERT INTO `branch_user` VALUES (2,3,2,'2026-09-11 21:16:07','2026-09-11 21:16:07');
/*!40000 ALTER TABLE `branch_user` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `branches`
--

DROP TABLE IF EXISTS `branches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `branches` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `is_main` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `branches_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `branches`
--

LOCK TABLES `branches` WRITE;
/*!40000 ALTER TABLE `branches` DISABLE KEYS */;
INSERT INTO `branches` VALUES (2,'JEVATECH SOLUTIONS',NULL,'254741479897','jevatechsolutions@gmail.com','NAIROBI','KENYA','CBD',1,1,'2026-05-13 13:34:58','2026-09-05 15:46:16');
/*!40000 ALTER TABLE `branches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `business_modules`
--

DROP TABLE IF EXISTS `business_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `business_modules` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_id` bigint(20) unsigned DEFAULT NULL,
  `module_id` bigint(20) unsigned NOT NULL,
  `is_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `business_modules_module_id_foreign` (`module_id`),
  CONSTRAINT `business_modules_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `system_modules` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `business_modules`
--

LOCK TABLES `business_modules` WRITE;
/*!40000 ALTER TABLE `business_modules` DISABLE KEYS */;
INSERT INTO `business_modules` VALUES (1,NULL,1,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(2,NULL,2,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(3,NULL,3,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(4,NULL,4,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(5,NULL,5,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(6,NULL,6,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(7,NULL,7,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(8,NULL,8,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(9,NULL,9,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(10,NULL,10,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(11,NULL,11,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(12,NULL,12,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(13,NULL,13,1,'2026-04-15 11:36:49','2026-09-09 21:50:50'),(14,NULL,14,1,'2026-05-13 04:02:43','2026-09-09 21:50:50'),(15,NULL,15,1,'2026-09-05 17:34:49','2026-09-09 21:50:50'),(16,NULL,16,1,'2026-09-08 13:55:26','2026-09-15 17:12:01'),(17,NULL,17,1,'2026-09-09 13:33:29','2026-09-09 21:50:50'),(18,NULL,18,1,'2026-09-09 13:55:03','2026-09-09 21:50:50'),(20,NULL,20,1,'2026-09-09 15:15:40','2026-09-09 21:50:50'),(21,NULL,21,1,'2026-09-09 21:27:17','2026-09-09 21:50:50'),(22,NULL,22,1,'2026-09-09 21:27:17','2026-09-09 21:50:50'),(23,NULL,23,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(24,NULL,24,1,'2026-09-11 20:04:38','2026-09-11 20:04:38'),(25,NULL,25,1,'2026-09-15 17:37:53','2026-09-15 17:37:53'),(26,NULL,26,1,'2026-09-14 19:41:58','2026-09-15 17:12:01'),(27,NULL,27,1,'2026-09-15 10:21:21','2026-09-15 17:12:01'),(28,NULL,28,1,'2026-09-15 17:37:53','2026-09-15 17:37:53'),(29,NULL,29,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(30,NULL,30,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(31,NULL,31,1,'2026-09-29 12:16:32','2026-09-29 12:16:32');
/*!40000 ALTER TABLE `business_modules` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `business_settings`
--

DROP TABLE IF EXISTS `business_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `business_settings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_name` varchar(255) NOT NULL DEFAULT 'JEVAPOS',
  `business_mode` enum('retail','hotel','hybrid') NOT NULL DEFAULT 'retail',
  `currency` varchar(255) NOT NULL DEFAULT 'KES',
  `tax_name` varchar(255) NOT NULL DEFAULT 'VAT',
  `tax_rate` decimal(8,2) NOT NULL DEFAULT 16.00,
  `default_price_tier` varchar(255) NOT NULL DEFAULT 'retail',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL 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 `business_settings`
--

LOCK TABLES `business_settings` WRITE;
/*!40000 ALTER TABLE `business_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `business_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `call_records`
--

DROP TABLE IF EXISTS `call_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `call_records` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `call_no` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `receiver_id` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `updated_by` bigint(20) unsigned DEFAULT NULL,
  `category` enum('sales','inquiry','complain','support','message','other') NOT NULL DEFAULT 'inquiry',
  `subject` varchar(255) NOT NULL,
  `caller_name` varchar(255) NOT NULL,
  `caller_number` varchar(255) DEFAULT NULL,
  `caller_email` varchar(255) DEFAULT NULL,
  `receiver_name` varchar(255) DEFAULT NULL,
  `media_mode` varchar(255) DEFAULT NULL,
  `call_date` datetime NOT NULL,
  `description` text DEFAULT NULL,
  `status` varchar(60) NOT NULL DEFAULT 'completed',
  `outcome` varchar(255) DEFAULT NULL,
  `next_follow_up_at` datetime DEFAULT NULL,
  `recording_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `callable_type` varchar(255) DEFAULT NULL,
  `callable_id` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `call_records_call_no_unique` (`call_no`),
  KEY `call_records_customer_id_foreign` (`customer_id`),
  KEY `call_records_created_by_foreign` (`created_by`),
  KEY `idx_call_records_branch_id_call_date` (`branch_id`,`call_date`),
  KEY `idx_call_records_branch_id_status` (`branch_id`,`status`),
  KEY `call_records_callable_type_callable_id_index` (`callable_type`,`callable_id`),
  KEY `call_records_updated_by_foreign` (`updated_by`),
  KEY `call_records_receiver_id_outcome_call_date_index` (`receiver_id`,`outcome`,`call_date`),
  CONSTRAINT `call_records_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `call_records_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `call_records_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `call_records_receiver_id_foreign` FOREIGN KEY (`receiver_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `call_records_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `call_records`
--

LOCK TABLES `call_records` WRITE;
/*!40000 ALTER TABLE `call_records` DISABLE KEYS */;
INSERT INTO `call_records` VALUES (2,'CL0001',NULL,NULL,NULL,3,3,'sales','Lead recorded','Bamboo hut','074562',NULL,'JEVATECH SOLUTIONS',NULL,'2026-09-29 21:51:40','POS SYSTEM','completed','connected',NULL,NULL,'2026-09-29 18:51:40','2026-09-29 18:51:40','App\\Models\\Lead',5),(3,'CL0003',NULL,2,3,3,3,'sales','Lead recorded','Bamboo hut 2','678922',NULL,'JEVATECH SOLUTIONS',NULL,'2026-09-29 21:54:13','CCTV','completed','connected',NULL,NULL,'2026-09-29 18:54:13','2026-09-29 18:54:13','App\\Models\\Lead',6);
/*!40000 ALTER TABLE `call_records` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `categories`
--

DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `restaurant_printer_name` varchar(255) DEFAULT NULL,
  `restaurant_order_heading` varchar(100) DEFAULT NULL,
  `restaurant_print_station_id` bigint(20) unsigned DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `categories_code_unique` (`code`),
  KEY `idx_categories_branch_id_is_active` (`branch_id`,`is_active`),
  KEY `categories_restaurant_print_station_id_foreign` (`restaurant_print_station_id`),
  CONSTRAINT `categories_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `categories_restaurant_print_station_id_foreign` FOREIGN KEY (`restaurant_print_station_id`) REFERENCES `print_stations` (`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 `categories`
--

LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
INSERT INTO `categories` VALUES (1,2,'Bar',NULL,NULL,'pos80','Captain order',2,1,'2026-09-30 18:47:11','2026-09-30 18:47:59');
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `crm_activities`
--

DROP TABLE IF EXISTS `crm_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `crm_activities` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `subject_type` varchar(255) NOT NULL,
  `subject_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `performed_by` bigint(20) unsigned DEFAULT NULL,
  `activity_type` enum('note','status_change') NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `details` text DEFAULT NULL,
  `from_status` varchar(255) DEFAULT NULL,
  `to_status` varchar(255) DEFAULT NULL,
  `occurred_at` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `crm_activities_subject_type_subject_id_index` (`subject_type`,`subject_id`),
  KEY `crm_activities_performed_by_foreign` (`performed_by`),
  KEY `crm_activities_branch_id_occurred_at_index` (`branch_id`,`occurred_at`),
  CONSTRAINT `crm_activities_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `crm_activities_performed_by_foreign` FOREIGN KEY (`performed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `crm_activities`
--

LOCK TABLES `crm_activities` WRITE;
/*!40000 ALTER TABLE `crm_activities` DISABLE KEYS */;
INSERT INTO `crm_activities` VALUES (3,'App\\Models\\Lead',3,2,3,'note','Lead created','pos system',NULL,NULL,'2026-09-29 16:39:10','2026-09-29 13:39:10','2026-09-29 13:39:10'),(4,'App\\Models\\Lead',3,2,3,'status_change','Status changed',NULL,'new','qualified','2026-09-29 16:57:36','2026-09-29 13:57:36','2026-09-29 13:57:36'),(5,'App\\Models\\Lead',3,2,3,'status_change','Converted to DL0001',NULL,'qualified','converted','2026-09-29 16:58:26','2026-09-29 13:58:26','2026-09-29 13:58:26'),(6,'App\\Models\\Lead',4,NULL,3,'note','Lead created','wtyegsdj',NULL,NULL,'2026-09-29 17:49:37','2026-09-29 14:49:37','2026-09-29 14:49:37'),(7,'App\\Models\\Lead',5,NULL,3,'note','Lead created','POS SYSTEM',NULL,NULL,'2026-09-29 21:51:40','2026-09-29 18:51:40','2026-09-29 18:51:40'),(8,'App\\Models\\Lead',6,2,3,'note','Lead created','CCTV',NULL,NULL,'2026-09-29 21:54:13','2026-09-29 18:54:13','2026-09-29 18:54:13'),(9,'App\\Models\\Lead',6,2,3,'status_change','Status changed',NULL,'cold','warm','2026-09-29 22:00:23','2026-09-29 19:00:23','2026-09-29 19:00:23');
/*!40000 ALTER TABLE `crm_activities` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `crm_follow_ups`
--

DROP TABLE IF EXISTS `crm_follow_ups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `crm_follow_ups` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `followable_type` varchar(255) DEFAULT NULL,
  `followable_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `updated_by` bigint(20) unsigned DEFAULT NULL,
  `completed_by` bigint(20) unsigned DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `details` text DEFAULT NULL,
  `due_at` datetime NOT NULL,
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `priority` enum('low','medium','high','urgent') NOT NULL DEFAULT 'medium',
  `completed_at` datetime DEFAULT NULL,
  `completion_notes` text DEFAULT NULL,
  `legacy_source_type` varchar(255) DEFAULT NULL,
  `legacy_source_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `crm_follow_ups_legacy_unique` (`legacy_source_type`,`legacy_source_id`),
  KEY `crm_follow_ups_followable_type_followable_id_index` (`followable_type`,`followable_id`),
  KEY `crm_follow_ups_created_by_foreign` (`created_by`),
  KEY `crm_follow_ups_updated_by_foreign` (`updated_by`),
  KEY `crm_follow_ups_completed_by_foreign` (`completed_by`),
  KEY `crm_follow_ups_assigned_to_status_due_at_index` (`assigned_to`,`status`,`due_at`),
  KEY `crm_follow_ups_branch_id_status_due_at_index` (`branch_id`,`status`,`due_at`),
  CONSTRAINT `crm_follow_ups_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `crm_follow_ups_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `crm_follow_ups_completed_by_foreign` FOREIGN KEY (`completed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `crm_follow_ups_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `crm_follow_ups_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `crm_follow_ups`
--

LOCK TABLES `crm_follow_ups` WRITE;
/*!40000 ALTER TABLE `crm_follow_ups` DISABLE KEYS */;
INSERT INTO `crm_follow_ups` VALUES (2,'App\\Models\\Lead',3,2,3,3,3,NULL,'werty','wertyu','2026-10-01 17:00:00','pending','medium',NULL,NULL,NULL,NULL,'2026-09-29 14:00:30','2026-09-29 14:00:30'),(3,'App\\Models\\Deal',3,2,3,3,3,NULL,'Follow up','call back tuesday am out of town','2026-10-06 21:58:00','pending','medium',NULL,NULL,NULL,NULL,'2026-09-29 18:58:58','2026-09-29 18:58:58');
/*!40000 ALTER TABLE `crm_follow_ups` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `crm_options`
--

DROP TABLE IF EXISTS `crm_options`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `crm_options` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL,
  `option_type` varchar(30) NOT NULL,
  `name` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `color` varchar(20) DEFAULT NULL,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `crm_options_module_option_type_slug_unique` (`module`,`option_type`,`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `crm_options`
--

LOCK TABLES `crm_options` WRITE;
/*!40000 ALTER TABLE `crm_options` DISABLE KEYS */;
INSERT INTO `crm_options` VALUES (1,'lead','status','Cold','cold','#64748b',1,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(2,'lead','status','Warm','warm','#eab308',2,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(3,'lead','status','Hot','hot','#e84c0d',3,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(4,'lead','status','Completed','completed','#15803d',4,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(5,'lead','category','General','general','#1e4fa8',1,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(6,'deal','status','Cold','cold','#64748b',1,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(7,'deal','status','Warm','warm','#eab308',2,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(8,'deal','status','Hot','hot','#e84c0d',3,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(9,'deal','status','Completed','completed','#15803d',4,1,1,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(10,'deal','category','General','general','#1e4fa8',1,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(11,'call','category','Sales','sales','#1e4fa8',1,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(12,'call','category','Inquiry','inquiry','#1e4fa8',2,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(13,'call','category','Complaint','complain','#1e4fa8',3,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(14,'call','category','Support','support','#1e4fa8',4,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(15,'call','category','Message','message','#1e4fa8',5,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(16,'call','category','Other','other','#1e4fa8',6,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(17,'call','status','No Answer','no_answer','#64748b',1,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(18,'call','status','Busy','busy','#64748b',2,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(19,'call','status','Connected','connected','#64748b',3,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(20,'call','status','Interested','interested','#64748b',4,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(21,'call','status','Not Interested','not_interested','#64748b',5,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(22,'call','status','Wrong Number','wrong_number','#64748b',6,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50'),(23,'call','status','Callback Requested','callback_requested','#64748b',7,1,0,'2026-09-29 18:39:50','2026-09-29 18:39:50');
/*!40000 ALTER TABLE `crm_options` 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,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `tax_pin` varchar(100) DEFAULT NULL,
  `nationality` varchar(255) DEFAULT NULL,
  `id_passport_no` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_customers_branch_id_is_active` (`branch_id`,`is_active`),
  KEY `idx_customers_phone` (`phone`),
  KEY `idx_customers_name` (`name`),
  CONSTRAINT `customers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 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,2,'Walk in','12345678','asdfg@gmail.com',NULL,'P345678987V',NULL,NULL,1,'2026-09-09 22:02:57','2026-09-25 19:40:04'),(9,2,'Kumasu','3456',NULL,NULL,NULL,NULL,NULL,1,'2026-09-29 13:58:26','2026-09-29 13:58:26');
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `damaged_products`
--

DROP TABLE IF EXISTS `damaged_products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `damaged_products` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `damage_no` varchar(255) NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `stock_before` decimal(15,2) NOT NULL DEFAULT 0.00,
  `stock_after` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `damage_date` datetime NOT NULL,
  `responsible_person` varchar(255) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `damaged_products_damage_no_unique` (`damage_no`),
  KEY `damaged_products_product_id_foreign` (`product_id`),
  KEY `damaged_products_user_id_foreign` (`user_id`),
  KEY `idx_damaged_products_branch_id_damage_date` (`branch_id`,`damage_date`),
  CONSTRAINT `damaged_products_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `damaged_products_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `damaged_products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `damaged_products`
--

LOCK TABLES `damaged_products` WRITE;
/*!40000 ALTER TABLE `damaged_products` DISABLE KEYS */;
/*!40000 ALTER TABLE `damaged_products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `deal_follow_ups`
--

DROP TABLE IF EXISTS `deal_follow_ups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `deal_follow_ups` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `deal_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `follow_up_type` enum('call','sms','email','visit','demo','quotation','support','other') NOT NULL DEFAULT 'call',
  `follow_up_at` datetime NOT NULL,
  `next_follow_up_at` datetime DEFAULT NULL,
  `outcome` enum('pending','done','interested','not_interested','no_response','won','lost') NOT NULL DEFAULT 'done',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `deal_follow_ups_deal_id_foreign` (`deal_id`),
  KEY `deal_follow_ups_user_id_foreign` (`user_id`),
  CONSTRAINT `deal_follow_ups_deal_id_foreign` FOREIGN KEY (`deal_id`) REFERENCES `deals` (`id`) ON DELETE CASCADE,
  CONSTRAINT `deal_follow_ups_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `deal_follow_ups`
--

LOCK TABLES `deal_follow_ups` WRITE;
/*!40000 ALTER TABLE `deal_follow_ups` DISABLE KEYS */;
/*!40000 ALTER TABLE `deal_follow_ups` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `deals`
--

DROP TABLE IF EXISTS `deals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `deals` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `lead_id` bigint(20) unsigned DEFAULT NULL,
  `deal_no` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `updated_by` bigint(20) unsigned DEFAULT NULL,
  `customer_name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `source` varchar(255) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `expected_value` decimal(15,2) NOT NULL DEFAULT 0.00,
  `expected_close_date` date DEFAULT NULL,
  `stage` varchar(60) NOT NULL DEFAULT 'warm',
  `status` varchar(60) NOT NULL DEFAULT 'warm',
  `next_follow_up_at` datetime DEFAULT NULL,
  `last_follow_up_at` datetime DEFAULT NULL,
  `last_feedback` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `deals_deal_no_unique` (`deal_no`),
  UNIQUE KEY `deals_lead_id_unique` (`lead_id`),
  KEY `deals_customer_id_foreign` (`customer_id`),
  KEY `deals_created_by_foreign` (`created_by`),
  KEY `idx_deals_branch_id_status` (`branch_id`,`status`),
  KEY `idx_deals_branch_id_next_follow_up_at` (`branch_id`,`next_follow_up_at`),
  KEY `idx_deals_assigned_to_status` (`assigned_to`,`status`),
  KEY `deals_updated_by_foreign` (`updated_by`),
  KEY `deals_assigned_to_stage_status_index` (`assigned_to`,`stage`,`status`),
  CONSTRAINT `deals_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `deals_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `deals_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `deals_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `deals_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE SET NULL,
  CONSTRAINT `deals_updated_by_foreign` FOREIGN KEY (`updated_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 `deals`
--

LOCK TABLES `deals` WRITE;
/*!40000 ALTER TABLE `deals` DISABLE KEYS */;
INSERT INTO `deals` VALUES (3,3,'DL0001',9,2,3,3,3,'Kumasu','3456',NULL,'cold calls',NULL,'Kumasu opportunity','Demo done,quotation send',15000.00,'2026-09-30','quotation','warm',NULL,NULL,NULL,'2026-09-29 13:58:26','2026-09-29 13:58:26'),(4,6,'DL0004',NULL,2,3,3,3,'Bamboo hut 2','678922',NULL,'website','general','Bamboo hut 2 opportunity','CCTV',15000.00,NULL,'warm','warm',NULL,NULL,NULL,'2026-09-29 19:00:23','2026-09-29 19:00:23');
/*!40000 ALTER TABLE `deals` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `departments`
--

DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `departments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `departments_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `departments`
--

LOCK TABLES `departments` WRITE;
/*!40000 ALTER TABLE `departments` DISABLE KEYS */;
INSERT INTO `departments` VALUES (1,'IT',NULL,NULL,1,'2026-05-13 06:09:26','2026-05-13 06:09:26'),(2,'SALES',NULL,NULL,1,'2026-05-13 07:13:52','2026-05-13 07:13:52');
/*!40000 ALTER TABLE `departments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `disciplinary_cases`
--

DROP TABLE IF EXISTS `disciplinary_cases`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `disciplinary_cases` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `reported_by` bigint(20) unsigned NOT NULL,
  `incident_date` date NOT NULL,
  `category` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `action_taken` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `resolved_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `disciplinary_cases_user_id_foreign` (`user_id`),
  KEY `disciplinary_cases_reported_by_foreign` (`reported_by`),
  KEY `disciplinary_cases_incident_date_index` (`incident_date`),
  KEY `disciplinary_cases_status_index` (`status`),
  CONSTRAINT `disciplinary_cases_reported_by_foreign` FOREIGN KEY (`reported_by`) REFERENCES `users` (`id`),
  CONSTRAINT `disciplinary_cases_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `disciplinary_cases`
--

LOCK TABLES `disciplinary_cases` WRITE;
/*!40000 ALTER TABLE `disciplinary_cases` DISABLE KEYS */;
/*!40000 ALTER TABLE `disciplinary_cases` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_contracts`
--

DROP TABLE IF EXISTS `employee_contracts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee_contracts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `contract_type` varchar(255) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `salary` decimal(15,2) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `terms` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_contracts_user_id_foreign` (`user_id`),
  KEY `employee_contracts_start_date_index` (`start_date`),
  KEY `employee_contracts_end_date_index` (`end_date`),
  KEY `employee_contracts_status_index` (`status`),
  CONSTRAINT `employee_contracts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `employee_contracts`
--

LOCK TABLES `employee_contracts` WRITE;
/*!40000 ALTER TABLE `employee_contracts` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_contracts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_notes`
--

DROP TABLE IF EXISTS `employee_notes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee_notes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint(20) unsigned NOT NULL,
  `posted_by_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `department_id` bigint(20) unsigned DEFAULT NULL,
  `note_date` date NOT NULL,
  `note_type` varchar(255) NOT NULL DEFAULT 'performance',
  `note` text NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_notes_employee_id_foreign` (`employee_id`),
  KEY `employee_notes_posted_by_id_foreign` (`posted_by_id`),
  KEY `employee_notes_department_id_foreign` (`department_id`),
  KEY `idx_employee_notes_branch_id_note_date` (`branch_id`,`note_date`),
  CONSTRAINT `employee_notes_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employee_notes_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `employee_notes_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `employee_notes_posted_by_id_foreign` FOREIGN KEY (`posted_by_id`) REFERENCES `users` (`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 `employee_notes`
--

LOCK TABLES `employee_notes` WRITE;
/*!40000 ALTER TABLE `employee_notes` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_notes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_reviews`
--

DROP TABLE IF EXISTS `employee_reviews`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee_reviews` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `reviewer_id` bigint(20) unsigned NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `score` decimal(5,2) NOT NULL DEFAULT 0.00,
  `rating` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'draft',
  `strengths` text DEFAULT NULL,
  `improvements` text DEFAULT NULL,
  `goals` text DEFAULT NULL,
  `employee_comment` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_reviews_user_id_foreign` (`user_id`),
  KEY `employee_reviews_reviewer_id_foreign` (`reviewer_id`),
  KEY `employee_reviews_period_start_index` (`period_start`),
  KEY `employee_reviews_period_end_index` (`period_end`),
  KEY `employee_reviews_status_index` (`status`),
  CONSTRAINT `employee_reviews_reviewer_id_foreign` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `employee_reviews_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `employee_reviews`
--

LOCK TABLES `employee_reviews` WRITE;
/*!40000 ALTER TABLE `employee_reviews` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_reviews` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `etims_branch_configs`
--

DROP TABLE IF EXISTS `etims_branch_configs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `etims_branch_configs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned NOT NULL,
  `taxpayer_pin` varchar(32) DEFAULT NULL,
  `branch_code` varchar(16) NOT NULL DEFAULT '00',
  `device_serial_no` varchar(100) DEFAULT NULL,
  `integration_type` varchar(16) NOT NULL DEFAULT 'vscu',
  `endpoint_url` varchar(255) DEFAULT NULL,
  `api_key` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_connected_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `etims_branch_configs_branch_id_unique` (`branch_id`),
  CONSTRAINT `etims_branch_configs_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `etims_branch_configs`
--

LOCK TABLES `etims_branch_configs` WRITE;
/*!40000 ALTER TABLE `etims_branch_configs` DISABLE KEYS */;
INSERT INTO `etims_branch_configs` VALUES (1,2,'P1234123412Q','00',NULL,'vscu',NULL,NULL,1,NULL,'2026-10-02 21:54:12','2026-10-02 21:54:12');
/*!40000 ALTER TABLE `etims_branch_configs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `etims_documents`
--

DROP TABLE IF EXISTS `etims_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `etims_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `sale_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `original_document_id` bigint(20) unsigned DEFAULT NULL,
  `document_type` varchar(32) NOT NULL DEFAULT 'sales_invoice',
  `environment` varchar(20) NOT NULL DEFAULT 'demo',
  `provider` varchar(40) NOT NULL DEFAULT 'jevapos_demo',
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `local_reference` varchar(100) NOT NULL,
  `control_unit_invoice_no` varchar(100) DEFAULT NULL,
  `kra_receipt_no` varchar(100) DEFAULT NULL,
  `sdc_id` varchar(100) DEFAULT NULL,
  `mrc_no` varchar(100) DEFAULT NULL,
  `internal_data` text DEFAULT NULL,
  `receipt_signature` text DEFAULT NULL,
  `verification_url` text DEFAULT NULL,
  `request_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`request_payload`)),
  `response_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_payload`)),
  `error_message` text DEFAULT NULL,
  `attempt_count` int(10) unsigned NOT NULL DEFAULT 0,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `accepted_at` timestamp NULL DEFAULT NULL,
  `failed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `etims_documents_uuid_unique` (`uuid`),
  KEY `etims_documents_sale_id_foreign` (`sale_id`),
  KEY `etims_documents_original_document_id_foreign` (`original_document_id`),
  KEY `etims_documents_branch_status_created_idx` (`branch_id`,`status`,`created_at`),
  KEY `etims_documents_environment_type_idx` (`environment`,`document_type`),
  KEY `etims_documents_local_reference_index` (`local_reference`),
  CONSTRAINT `etims_documents_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `etims_documents_original_document_id_foreign` FOREIGN KEY (`original_document_id`) REFERENCES `etims_documents` (`id`) ON DELETE SET NULL,
  CONSTRAINT `etims_documents_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`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 `etims_documents`
--

LOCK TABLES `etims_documents` WRITE;
/*!40000 ALTER TABLE `etims_documents` DISABLE KEYS */;
INSERT INTO `etims_documents` VALUES (1,'c4e108ad-1b3d-47a4-a1f6-ab6f7a85c12b',1,2,NULL,'sales_invoice','demo','jevapos_demo','accepted','0001','DEMO-INV-00000001','DEMO-RCT-00000001','DEMO-SDC-001','DEMO-MRC-001','E07A6020A576597774DF97A0','0505A09CB303EDFD4314FB531ED1D2F0','http://localhost/etims/demo/verify/c4e108ad-1b3d-47a4-a1f6-ab6f7a85c12b','{\"seller\":{\"taxpayer_pin\":\"P1234123412Q\",\"branch_code\":\"00\",\"device_serial_no\":null},\"invoice\":{\"invoice_no\":\"0001\",\"sale_date\":\"2026-10-03T00:56:17+03:00\",\"sale_mode\":\"retail\",\"customer_name\":\"Walk in\",\"customer_pin\":\"P345678987V\",\"subtotal\":51.72,\"discount\":0,\"tax\":8.28,\"total\":60},\"items\":[{\"product_id\":1,\"item_code\":\"1\",\"barcode\":\"1\",\"description\":\"sample\",\"hs_code\":null,\"item_classification_code\":null,\"origin_country_code\":\"KE\",\"package_unit_code\":null,\"quantity_unit_code\":\"Pcs\",\"quantity\":3,\"unit_price\":20,\"discount\":0,\"tax_type\":\"standard\",\"tax_rate\":16,\"tax_amount\":8.28,\"line_total\":60}],\"payments\":[{\"method\":\"Mpesa\",\"amount\":60,\"reference\":null}]}','{\"result_code\":\"000\",\"result_message\":\"Accepted by JEVAPOS eTIMS Demo Simulator\",\"demo\":true,\"receipt_no\":\"DEMO-RCT-00000001\",\"control_unit_invoice_no\":\"DEMO-INV-00000001\",\"sdc_id\":\"DEMO-SDC-001\",\"mrc_no\":\"DEMO-MRC-001\",\"internal_data\":\"E07A6020A576597774DF97A0\",\"receipt_signature\":\"0505A09CB303EDFD4314FB531ED1D2F0\",\"verification_url\":\"http:\\/\\/localhost\\/etims\\/demo\\/verify\\/c4e108ad-1b3d-47a4-a1f6-ab6f7a85c12b\",\"accepted_at\":\"2026-10-03T00:56:17+03:00\"}',NULL,1,'2026-10-02 21:56:17','2026-10-02 21:56:17',NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17');
/*!40000 ALTER TABLE `etims_documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `expense_categories`
--

DROP TABLE IF EXISTS `expense_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expense_categories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `expense_categories_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `expense_categories`
--

LOCK TABLES `expense_categories` WRITE;
/*!40000 ALTER TABLE `expense_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `expense_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `expenses`
--

DROP TABLE IF EXISTS `expenses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expenses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `expense_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `payment_method_id` bigint(20) unsigned DEFAULT NULL,
  `department_id` bigint(20) unsigned DEFAULT NULL,
  `expense_category_id` bigint(20) unsigned DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `paid_to` varchar(255) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `reference_no` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `expense_date` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `deleted_by` bigint(20) unsigned DEFAULT NULL,
  `delete_reason` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `expenses_expense_no_unique` (`expense_no`),
  KEY `idx_expenses_branch_id_expense_date` (`branch_id`,`expense_date`),
  KEY `idx_expenses_branch_id_payment_method_id` (`branch_id`,`payment_method_id`),
  KEY `idx_expenses_department_id` (`department_id`),
  KEY `idx_expenses_expense_category_id` (`expense_category_id`),
  KEY `idx_expenses_user_id` (`user_id`),
  KEY `idx_expenses_shift_id` (`shift_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `expenses`
--

LOCK TABLES `expenses` WRITE;
/*!40000 ALTER TABLE `expenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `expenses` 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 `internal_stock_issue_items`
--

DROP TABLE IF EXISTS `internal_stock_issue_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `internal_stock_issue_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `internal_stock_issue_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `quantity_issued` decimal(15,2) NOT NULL,
  `quantity_consumed` decimal(15,2) NOT NULL DEFAULT 0.00,
  `quantity_returned` decimal(15,2) NOT NULL DEFAULT 0.00,
  `quantity_lost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `stock_before` decimal(15,2) NOT NULL DEFAULT 0.00,
  `stock_after` decimal(15,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `isi_item_product_unique` (`internal_stock_issue_id`,`product_id`),
  KEY `internal_stock_issue_items_product_id_index` (`product_id`),
  CONSTRAINT `internal_stock_issue_items_internal_stock_issue_id_foreign` FOREIGN KEY (`internal_stock_issue_id`) REFERENCES `internal_stock_issues` (`id`) ON DELETE CASCADE,
  CONSTRAINT `internal_stock_issue_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `internal_stock_issue_items`
--

LOCK TABLES `internal_stock_issue_items` WRITE;
/*!40000 ALTER TABLE `internal_stock_issue_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `internal_stock_issue_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `internal_stock_issues`
--

DROP TABLE IF EXISTS `internal_stock_issues`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `internal_stock_issues` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `issue_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `department_id` bigint(20) unsigned DEFAULT NULL,
  `issued_by` bigint(20) unsigned NOT NULL,
  `receiver_id` bigint(20) unsigned DEFAULT NULL,
  `received_by` bigint(20) unsigned DEFAULT NULL,
  `issue_type` varchar(30) NOT NULL,
  `status` varchar(30) NOT NULL DEFAULT 'issued',
  `issue_date` datetime NOT NULL,
  `received_at` datetime DEFAULT NULL,
  `purpose` varchar(255) NOT NULL,
  `note` text DEFAULT NULL,
  `total_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `internal_stock_issues_issue_no_unique` (`issue_no`),
  KEY `internal_stock_issues_department_id_foreign` (`department_id`),
  KEY `internal_stock_issues_issued_by_foreign` (`issued_by`),
  KEY `internal_stock_issues_received_by_foreign` (`received_by`),
  KEY `isi_branch_date_idx` (`branch_id`,`issue_date`),
  KEY `isi_receiver_status_idx` (`receiver_id`,`status`),
  CONSTRAINT `internal_stock_issues_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `internal_stock_issues_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `internal_stock_issues_issued_by_foreign` FOREIGN KEY (`issued_by`) REFERENCES `users` (`id`),
  CONSTRAINT `internal_stock_issues_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `internal_stock_issues_receiver_id_foreign` FOREIGN KEY (`receiver_id`) REFERENCES `users` (`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 `internal_stock_issues`
--

LOCK TABLES `internal_stock_issues` WRITE;
/*!40000 ALTER TABLE `internal_stock_issues` DISABLE KEYS */;
/*!40000 ALTER TABLE `internal_stock_issues` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `internal_stock_transactions`
--

DROP TABLE IF EXISTS `internal_stock_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `internal_stock_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `internal_stock_issue_item_id` bigint(20) unsigned NOT NULL,
  `hotel_id` bigint(20) unsigned DEFAULT NULL,
  `room_id` bigint(20) unsigned DEFAULT NULL,
  `booking_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `transaction_type` varchar(30) NOT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `balance_before` decimal(15,2) NOT NULL DEFAULT 0.00,
  `balance_after` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `transaction_date` datetime NOT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `internal_stock_transactions_internal_stock_issue_item_id_foreign` (`internal_stock_issue_item_id`),
  KEY `internal_stock_transactions_hotel_id_foreign` (`hotel_id`),
  KEY `internal_stock_transactions_booking_id_foreign` (`booking_id`),
  KEY `internal_stock_transactions_user_id_foreign` (`user_id`),
  KEY `ist_type_date_idx` (`transaction_type`,`transaction_date`),
  KEY `ist_room_date_idx` (`room_id`,`transaction_date`),
  CONSTRAINT `internal_stock_transactions_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `accommodation_bookings` (`id`) ON DELETE SET NULL,
  CONSTRAINT `internal_stock_transactions_hotel_id_foreign` FOREIGN KEY (`hotel_id`) REFERENCES `accommodation_hotels` (`id`) ON DELETE SET NULL,
  CONSTRAINT `internal_stock_transactions_internal_stock_issue_item_id_foreign` FOREIGN KEY (`internal_stock_issue_item_id`) REFERENCES `internal_stock_issue_items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `internal_stock_transactions_room_id_foreign` FOREIGN KEY (`room_id`) REFERENCES `accommodation_rooms` (`id`) ON DELETE SET NULL,
  CONSTRAINT `internal_stock_transactions_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 `internal_stock_transactions`
--

LOCK TABLES `internal_stock_transactions` WRITE;
/*!40000 ALTER TABLE `internal_stock_transactions` DISABLE KEYS */;
/*!40000 ALTER TABLE `internal_stock_transactions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `journal_entries`
--

DROP TABLE IF EXISTS `journal_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journal_entries` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `entry_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `entry_date` datetime NOT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_id` bigint(20) unsigned DEFAULT NULL,
  `event` varchar(255) DEFAULT NULL,
  `reference_no` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'posted',
  `reversal_of_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `journal_entries_entry_no_unique` (`entry_no`),
  UNIQUE KEY `journal_source_event_unique` (`source_type`,`source_id`,`event`),
  KEY `journal_entries_branch_id_index` (`branch_id`),
  KEY `journal_entries_user_id_index` (`user_id`),
  KEY `journal_entries_entry_date_index` (`entry_date`),
  KEY `journal_entries_source_type_index` (`source_type`),
  KEY `journal_entries_source_id_index` (`source_id`),
  KEY `journal_entries_event_index` (`event`),
  KEY `journal_entries_reference_no_index` (`reference_no`),
  KEY `journal_entries_status_index` (`status`),
  KEY `journal_entries_reversal_of_id_index` (`reversal_of_id`),
  KEY `idx_journal_entries_branch_id_entry_date` (`branch_id`,`entry_date`),
  KEY `idx_journal_entries_branch_id_status_entry_date` (`branch_id`,`status`,`entry_date`),
  KEY `idx_journal_entries_source_type_source_id` (`source_type`,`source_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 `journal_entries`
--

LOCK TABLES `journal_entries` WRITE;
/*!40000 ALTER TABLE `journal_entries` DISABLE KEYS */;
INSERT INTO `journal_entries` VALUES (1,'JE000001',2,3,'2026-10-03 00:56:17','Sale',1,'sale_created','0001','Sale invoice 0001','posted',NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17');
/*!40000 ALTER TABLE `journal_entries` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `journal_entry_lines`
--

DROP TABLE IF EXISTS `journal_entry_lines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journal_entry_lines` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `journal_entry_id` bigint(20) unsigned NOT NULL,
  `account_id` bigint(20) unsigned NOT NULL,
  `account_name` varchar(255) NOT NULL,
  `account_type` varchar(255) DEFAULT NULL,
  `debit` decimal(15,2) NOT NULL DEFAULT 0.00,
  `credit` decimal(15,2) NOT NULL DEFAULT 0.00,
  `memo` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `journal_entry_lines_account_id_foreign` (`account_id`),
  KEY `journal_entry_lines_account_type_index` (`account_type`),
  KEY `idx_journal_entry_lines_journal_entry_id_account_id` (`journal_entry_id`,`account_id`),
  CONSTRAINT `journal_entry_lines_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `journal_entry_lines_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `journal_entry_lines`
--

LOCK TABLES `journal_entry_lines` WRITE;
/*!40000 ALTER TABLE `journal_entry_lines` DISABLE KEYS */;
INSERT INTO `journal_entry_lines` VALUES (1,1,5,'M-Pesa','asset',60.00,0.00,NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17'),(2,1,15,'Sales Revenue','income',0.00,51.72,NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17'),(3,1,14,'Output VAT','liability',0.00,8.28,NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17'),(4,1,17,'Cost of Goods Sold','expense',30.00,0.00,NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17'),(5,1,11,'Inventory','asset',0.00,30.00,NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17');
/*!40000 ALTER TABLE `journal_entry_lines` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leads`
--

DROP TABLE IF EXISTS `leads`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leads` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `lead_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `updated_by` bigint(20) unsigned DEFAULT NULL,
  `business_name` varchar(255) DEFAULT NULL,
  `contact_name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `source` varchar(255) NOT NULL,
  `category` varchar(255) DEFAULT NULL,
  `status` varchar(60) NOT NULL DEFAULT 'cold',
  `notes` text DEFAULT NULL,
  `last_contact_at` datetime DEFAULT NULL,
  `converted_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `leads_lead_no_unique` (`lead_no`),
  KEY `leads_created_by_foreign` (`created_by`),
  KEY `leads_updated_by_foreign` (`updated_by`),
  KEY `leads_branch_id_status_index` (`branch_id`,`status`),
  KEY `leads_assigned_to_status_index` (`assigned_to`,`status`),
  KEY `leads_source_status_index` (`source`,`status`),
  CONSTRAINT `leads_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `leads_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `leads_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `leads_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 `leads`
--

LOCK TABLES `leads` WRITE;
/*!40000 ALTER TABLE `leads` DISABLE KEYS */;
INSERT INTO `leads` VALUES (3,'LD00001',2,NULL,3,3,'Kumasu','Evans','3456',NULL,'cold calls',NULL,'completed','pos system','2026-09-29 13:38:00','2026-09-29 16:58:26','2026-09-29 13:39:10','2026-09-29 13:58:26'),(4,'LD00004',NULL,NULL,3,3,'fdhfshd','udhfsd','73267347',NULL,'hcxhjx',NULL,'cold','wtyegsdj','2026-09-29 17:49:00',NULL,'2026-09-29 14:49:37','2026-09-29 14:49:37'),(5,'LD00005',NULL,NULL,3,3,'Bamboo hut','Methu','074562',NULL,'cold call','general','cold','POS SYSTEM','2026-09-29 21:51:40',NULL,'2026-09-29 18:51:40','2026-09-29 18:51:40'),(6,'LD00006',2,3,3,3,'Bamboo hut 2','Damian','678922',NULL,'website','general','warm','CCTV','2026-09-29 21:54:13',NULL,'2026-09-29 18:54:13','2026-09-29 19:00:23');
/*!40000 ALTER TABLE `leads` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_requests`
--

DROP TABLE IF EXISTS `leave_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leave_requests` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `leave_type_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `days` decimal(6,2) NOT NULL,
  `reason` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `reviewed_by` bigint(20) unsigned DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `decision_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leave_requests_user_id_foreign` (`user_id`),
  KEY `leave_requests_leave_type_id_foreign` (`leave_type_id`),
  KEY `leave_requests_branch_id_foreign` (`branch_id`),
  KEY `leave_requests_reviewed_by_foreign` (`reviewed_by`),
  KEY `leave_requests_start_date_index` (`start_date`),
  KEY `leave_requests_end_date_index` (`end_date`),
  KEY `leave_requests_status_index` (`status`),
  CONSTRAINT `leave_requests_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `leave_requests_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`),
  CONSTRAINT `leave_requests_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `leave_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `leave_requests`
--

LOCK TABLES `leave_requests` WRITE;
/*!40000 ALTER TABLE `leave_requests` DISABLE KEYS */;
/*!40000 ALTER TABLE `leave_requests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_types`
--

DROP TABLE IF EXISTS `leave_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leave_types` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `days_per_year` decimal(6,2) NOT NULL DEFAULT 0.00,
  `is_paid` tinyint(1) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `leave_types_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `leave_types`
--

LOCK TABLES `leave_types` WRITE;
/*!40000 ALTER TABLE `leave_types` DISABLE KEYS */;
INSERT INTO `leave_types` VALUES (1,'Annual Leave',21.00,1,1,'2026-09-22 17:20:32','2026-09-22 17:20:32'),(2,'Sick Leave',14.00,1,1,'2026-09-22 17:20:32','2026-09-22 17:20:32'),(3,'Maternity Leave',90.00,1,1,'2026-09-22 17:20:32','2026-09-22 17:20:32'),(4,'Paternity Leave',14.00,1,1,'2026-09-22 17:20:32','2026-09-22 17:20:32'),(5,'Compassionate Leave',5.00,1,1,'2026-09-22 17:20:32','2026-09-22 17:20:32'),(6,'Unpaid Leave',0.00,0,1,'2026-09-22 17:20:32','2026-09-22 17:20:32');
/*!40000 ALTER TABLE `leave_types` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `license_activations`
--

DROP TABLE IF EXISTS `license_activations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `license_activations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `activation_no` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `client_name` varchar(255) NOT NULL,
  `contact_person` varchar(255) DEFAULT NULL,
  `technician_name` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `computer_serial` varchar(255) DEFAULT NULL,
  `generated_serial` varchar(255) DEFAULT NULL,
  `binding_type` varchar(20) DEFAULT NULL,
  `binding_value` varchar(255) DEFAULT NULL,
  `installation_id` varchar(255) DEFAULT NULL,
  `license_key` text DEFAULT NULL,
  `status` enum('pending','active','rejected','expired') NOT NULL DEFAULT 'pending',
  `requested_at` timestamp NULL DEFAULT NULL,
  `activated_at` timestamp NULL DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `requested_by` bigint(20) unsigned DEFAULT NULL,
  `activated_by` bigint(20) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `license_activations_activation_no_unique` (`activation_no`),
  KEY `license_activations_requested_by_foreign` (`requested_by`),
  KEY `license_activations_activated_by_foreign` (`activated_by`),
  KEY `license_activations_status_created_at_index` (`status`,`created_at`),
  KEY `license_activations_customer_id_index` (`customer_id`),
  KEY `license_activations_computer_serial_index` (`computer_serial`),
  KEY `license_activations_generated_serial_index` (`generated_serial`),
  KEY `license_binding_index` (`binding_type`,`binding_value`),
  CONSTRAINT `license_activations_activated_by_foreign` FOREIGN KEY (`activated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `license_activations_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `license_activations_requested_by_foreign` FOREIGN KEY (`requested_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 `license_activations`
--

LOCK TABLES `license_activations` WRITE;
/*!40000 ALTER TABLE `license_activations` DISABLE KEYS */;
INSERT INTO `license_activations` VALUES (1,'ACT0001',NULL,'JEVATECH SOLUTIONS ERP','VALENTINE',NULL,'0741479897','vallshitakha@gmail.com','JEV-EFDA-MYR2','JEV-EFDA-MYR2',NULL,NULL,NULL,'7DE6A-07BF6-95E86-9CC5F','expired','2026-09-15 13:18:28','2026-09-15 13:20:00','2026-09-15',NULL,3,'jvtch','2026-09-15 13:18:28','2026-09-15 13:20:33'),(2,'ACT0002',NULL,'sample','test',NULL,'0988','fgh@gmail.com','JEV-EFDA-MYR2','JEV-EFDA-MYR2',NULL,NULL,NULL,'5F45E-C44C0-CBA2A-1EFDE','active','2026-09-15 13:24:40','2026-09-15 13:25:19','2026-09-30',NULL,3,'ertyu','2026-09-15 13:24:40','2026-09-15 13:25:19'),(3,'ACT0003',NULL,'test','hjfdf',NULL,'355422',NULL,'JEV-EFDA-MYR2','JEV-EFDA-MYR2',NULL,NULL,NULL,'28B70-D71AC-97181-2ACB2','expired','2026-09-15 13:28:15','2026-09-15 13:28:19','2026-09-14',3,3,NULL,'2026-09-15 13:28:15','2026-09-15 13:28:35'),(4,'ACT0004',NULL,'JEVATECH','VALENTINE','VALENTINE','0741479897','vallshitakha@gmail.com','JEV-EFDA-MYR2','JEV-EFDA-MYR2',NULL,NULL,NULL,'JVL-eyJ2IjoxLCJhY3RpdmF0aW9uX25vIjoiQUNUMDAwNCIsImNsaWVudF9uYW1lIjoiSkVWQVRFQ0giLCJjb21wdXRlcl9zZXJpYWwiOiJKRVYtRUZEQS1NWVIyIiwiZXhwaXJlc19hdCI6bnVsbCwiaXNzdWVkX2F0IjoiMjAyNi0wOS0xNiAxNDoyMDozMSJ9.e1f6d63aac24fb26b6657395ea25978706d257730d1bf41fab502fbdc021fb32','active','2026-09-16 11:15:38','2026-09-16 11:20:31','2030-09-16',NULL,3,'erp','2026-09-16 11:15:38','2026-09-16 11:20:31'),(5,'ACT0005',NULL,'JEVATECH','JEVATECH SOLUTIONS','JEVATECH SOLUTIONS','254727109484',NULL,'SRV-69543B2BF9B89BF2B568','JEV-EFDA-MYR2','server','srv-69543b2bf9b89bf2b568','JEV-EFDA-MYR2','JVL-eyJ2IjoyLCJhY3RpdmF0aW9uX25vIjoiQUNUMDAwNSIsImNsaWVudF9uYW1lIjoiSkVWQVRFQ0giLCJjb21wdXRlcl9zZXJpYWwiOiJTUlYtNjk1NDNCMkJGOUI4OUJGMkI1NjgiLCJpbnN0YWxsYXRpb25faWQiOiJKRVYtRUZEQS1NWVIyIiwiYmluZGluZ190eXBlIjoic2VydmVyIiwiYmluZGluZ192YWx1ZSI6InNydi02OTU0M2IyYmY5Yjg5YmYyYjU2OCIsImV4cGlyZXNfYXQiOm51bGwsImlzc3VlZF9hdCI6IjIwMjYtMDktMjYgMDE6MjY6MTUifQ.WORPv6HV0MUI_jPzjA4gWWqi1cAhotOhraen9E1uwsN1mK3v-1lPtJ_JcajIIQzYEbQJAw_nNy9XioiHbMQ86Roi5v7qbfuzVDtsuLZoMfDOk0M-1PZFJ9SS0Uy0zhcQaPKZFlyYLSeUo2pgKSz4Wgt-2ttDMig_bd2YaALxdEVujq5XXVMPVDVEBxc_knisCuKqw8trTpxIl0baqv18QzpJYc_MFUC7wTFQ7oUZ95zv9MSfl9XhLRvJfveRRDqedpqfuBnHskA3Udh5SQaOYO-14ey1gntS59j6sWLSiQE6lpIG2XR31Qt6SI00Q7KNcr-DPHMgq7JfvSBKZsmCrS1o5KOi76m1le7yXWJgvt6E8JkMEjvfsl1lFjvfjzqb1xtMqiCe8fqUcXzCeFYrBULNEulk7ZUR2_eeXhYRmCDuwAWv32SMu4F1vjYAigsHVz5VEYtrWIdquO8ChcUQLH2HYCdVtWnD3QSkWCVRw_vVM7CahVgRRUfE_g9i5cEk','active','2026-09-25 22:26:15','2026-09-25 22:26:15',NULL,NULL,3,NULL,'2026-09-25 22:26:15','2026-09-25 22:26:15'),(6,'ACT0006',NULL,'jevatech erp','valentine','valentine','0741479897',NULL,'ERP.JEVATECH.COM','JEV-EFDA-MYR2','domain','erp.jevatech.com','JEV-EFDA-MYR2','JVL-eyJ2IjoyLCJhY3RpdmF0aW9uX25vIjoiQUNUMDAwNiIsImNsaWVudF9uYW1lIjoiamV2YXRlY2ggZXJwIiwiY29tcHV0ZXJfc2VyaWFsIjoiRVJQLkpFVkFURUNILkNPTSIsImluc3RhbGxhdGlvbl9pZCI6IkpFVi1FRkRBLU1ZUjIiLCJiaW5kaW5nX3R5cGUiOiJkb21haW4iLCJiaW5kaW5nX3ZhbHVlIjoiZXJwLmpldmF0ZWNoLmNvbSIsImV4cGlyZXNfYXQiOiIyMDI3LTA5LTI2IiwiaXNzdWVkX2F0IjoiMjAyNi0wOS0yNiAwMjoyMDo1MCJ9.oeclntaWfi0BaYIwvvrI6AG_wg48_ntxoQhWxGae4oSC3_wlJtZdKSsETuDLDeapKxIyJIDsk95XuacOdBKkUA4YCFBsUEkwgQNGzCiyJfsCzH6WN1ivLymNXhkP5rX6iK-dUJ3cNXLmuHfWoXM8lw7tJPWGJsWfHZkr02vnYHxWcnBolafcZZflx05Zuke231qXiPUnEWZUsccATzsjUKForDasbwUGWbcX21g5TPfhAY5R1Ku31G_QC8ynxqL04ROpUGVFQHBvEvcJ4NGkxTK7of_4ZUAhTj7DKeq2riKFBs9baW_w2NJ7Y4VQz7ioSGskQPb0FdQ9-vAQv9-kc2QA1RRgSQ6pIJD0hsnTyMtA9s81iCS6M1m6VL2l-1zh1NeEfjvmChWXd4UEp6gUJzUseJiK0VNtvAFsGK8OwbGKCORcRNCu3JdoQEFCcRB2lNVofOawMlY6y3124LACj9nV8bhomy4M7v0Yk2L5oR48Vudqe_4J2Q_uDQ72dGDX','active','2026-09-25 23:20:38','2026-09-25 23:20:50','2027-09-26',3,3,NULL,'2026-09-25 23:20:38','2026-09-25 23:20:50');
/*!40000 ALTER TABLE `license_activations` 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=120 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,'2014_10_12_000000_create_users_table',1),(2,'2014_10_12_100000_create_password_reset_tokens_table',1),(3,'2019_08_19_000000_create_failed_jobs_table',1),(4,'2019_12_14_000001_create_personal_access_tokens_table',1),(5,'2026_04_11_121628_create_business_settings_table',1),(6,'2026_04_11_121659_create_system_modules_table',1),(7,'2026_04_11_121722_create_business_modules_table',1),(8,'2026_04_11_121744_create_roles_table',1),(9,'2026_04_11_121808_create_role_module_permissions_table',1),(10,'2026_04_11_121823_create_price_tiers_table',1),(11,'2026_04_11_121841_create_product_prices_table',1),(12,'2026_04_11_142214_create_products_table',1),(13,'2026_04_13_140242_create_categories_table',1),(14,'2026_04_13_142223_create_sub_categories_table',1),(15,'2026_04_19_123101_create_permissions_table',2),(16,'2026_04_19_123906_create_role_permissions_table',3),(17,'2026_05_13_051543_add_extra_fields_to_users_table',4),(18,'2026_05_13_065639_create_departments_table',5),(19,'2026_05_13_093535_create_branches_table',6),(20,'2026_05_13_182607_add_department_id_to_users_table',7),(21,'2026_05_13_191137_create_accounts_table',8),(22,'2026_05_18_111133_add_chart_fields_to_accounts_table',9),(23,'2026_05_18_115520_create_payment_methods_table',10),(24,'2026_05_19_053045_add_employee_details_to_users_table',11),(25,'2026_05_19_113052_create_system_settings_table',12),(26,'2026_05_19_182837_add_pin_to_users_table',13),(27,'2026_05_25_121551_create_unit_of_measures_table',14),(28,'2026_05_25_141059_add_unit_of_measure_id_to_products_table',15),(29,'2026_05_27_164616_create_sales_table',16),(30,'2026_05_27_165434_create_sale_items_table',17),(31,'2026_05_27_165905_create_payments_table',18),(32,'2026_09_05_000001_add_customer_lpo_description_to_sales_table',19),(33,'2026_09_06_000002_add_tendered_and_change_to_sales_table',20),(34,'2026_09_06_000003_create_restaurant_tables_table',21),(35,'2026_09_06_000004_create_restaurant_orders_table',22),(36,'2026_09_06_000005_add_sale_id_to_restaurant_orders_table',23),(37,'2026_09_07_000010_add_merge_tracking_to_sales_table',24),(38,'2026_09_08_000020_create_purchases_table',25),(39,'2026_09_08_000021_create_purchase_items_table',25),(40,'2026_09_08_000022_create_purchase_payments_table',25),(41,'2026_09_08_000023_add_returned_quantity_to_purchase_items_table',26),(42,'2026_09_08_000024_create_purchase_returns_table',26),(43,'2026_09_08_000025_create_purchase_return_items_table',26),(44,'2026_09_09_000030_create_expenses_table',27),(45,'2026_09_09_000031_create_expense_categories_table',28),(46,'2026_09_09_000032_add_department_to_expenses_table',28),(47,'2026_09_09_000033_create_shifts_table',29),(48,'2026_09_09_000034_add_shift_id_to_sales_payments_expenses',29),(49,'2026_09_09_000035_add_shift_id_to_sale_items_table',29),(50,'2026_09_09_000036_create_shift_stock_counts_table',30),(51,'2026_09_10_000001_create_customers_and_suppliers_tables',31),(52,'2026_09_10_000002_create_bulk_sms_tables',32),(53,'2026_09_10_000003_create_accommodation_tables',33),(54,'2026_09_10_000004_add_payment_method_to_accommodation_bookings_and_credit_method',34),(55,'2026_09_10_000005_add_guest_identity_fields',35),(56,'2026_09_10_000006_create_accommodation_hotels_table',36),(57,'2026_09_10_000007_create_accommodation_floors_table',37),(58,'2026_09_10_000008_create_accommodation_charge_types_table',38),(59,'2026_09_11_000010_create_task_management_tables',39),(60,'2026_09_11_000011_create_quotations_tables',40),(61,'2026_09_12_000001_create_branch_user_table',41),(62,'2026_09_14_000001_create_mpesa_transactions_table',42),(63,'2026_09_14_000002_create_stock_takings_tables',43),(64,'2026_09_14_000003_add_branch_id_to_master_records',44),(65,'2026_09_14_000004_create_stock_transfers_tables',45),(66,'2026_09_14_000005_create_tax_rates_table',46),(67,'2026_09_14_000006_create_deals_management_tables',47),(68,'2026_09_15_000001_create_call_centre_tables',48),(69,'2026_09_15_000002_create_damaged_products_table',49),(70,'2026_09_15_000003_add_responsible_person_to_damaged_products_table',50),(71,'2026_09_15_000004_create_license_activations_table',51),(72,'2026_09_15_000005_add_technician_name_to_license_activations_table',52),(73,'2026_09_15_000006_ensure_task_management_permissions',53),(74,'2026_09_15_000007_ensure_all_module_permissions',54),(75,'2026_09_15_000008_ensure_missing_modules_and_permissions',55),(76,'2026_09_15_000009_separate_stock_transfer_and_damaged_permissions',56),(77,'2026_09_15_000010_remove_legacy_inventory_transfer_damage_permissions',57),(78,'2026_09_15_000011_create_audit_and_journal_foundation',58),(79,'2026_09_15_000012_add_accounting_foundation_permissions',58),(80,'2026_09_15_000013_seed_default_accounting_accounts',59),(81,'2026_09_15_000014_ensure_cash_in_hand_account',60),(82,'2026_09_15_000015_link_credit_payment_method_to_receivables',61),(83,'2026_09_16_000001_expand_license_key_storage',62),(84,'2026_09_16_000003_add_balance_sheet_permission',63),(85,'2026_09_16_000004_add_branch_id_to_restaurant_tables',64),(86,'2026_09_16_000005_add_performance_indexes',65),(87,'2026_09_16_000006_add_backup_permissions',66),(88,'2026_09_21_000001_add_website_product_fields_and_settings_permission',67),(89,'2026_09_21_000002_upgrade_accommodation_pricing_and_reservations',68),(90,'2026_09_21_000003_create_internal_stock_issues_tables',69),(91,'2026_09_21_000004_add_housekeeping_view_all_permission',70),(92,'2026_09_22_000001_create_treasury_projects_hr_attendance_foundation',71),(93,'2026_09_22_000002_add_payroll_and_hr_defaults',72),(94,'2026_09_22_000003_clean_operational_cash_accounts',73),(95,'2026_09_22_000004_add_hr_subpage_permissions',74),(96,'2026_09_22_000005_expand_hr_payroll_workspace',75),(97,'2026_09_22_000006_reorder_system_modules',76),(98,'2026_09_23_000001_add_product_import_permission',77),(99,'2026_09_25_000001_add_supplier_opening_balances',78),(100,'2026_09_25_000002_add_tax_pin_to_customers',79),(101,'2026_09_25_000003_set_global_default_entries',80),(102,'2026_09_26_000001_add_modem_mpesa_integration',81),(103,'2026_09_26_000002_add_mpesa_transaction_indexes',82),(104,'2026_09_26_000003_add_license_installation_binding',83),(105,'2026_09_29_000001_create_unified_crm_workflow',84),(106,'2026_09_29_000002_add_tax_pricing_fields_to_purchase_items',85),(107,'2026_09_29_000003_create_crm_options',86),(108,'2026_09_30_000001_add_restaurant_printer_to_categories',87),(109,'2026_09_30_000002_create_restaurant_print_queue',88),(110,'2026_09_30_000003_add_restaurant_order_heading_to_categories',89),(111,'2026_09_30_000004_make_user_email_optional',90),(112,'2026_10_01_000001_add_own_and_all_record_permissions',91),(113,'2026_10_01_000002_retire_legacy_record_view_permissions',92),(114,'2026_10_01_000003_add_product_sensitive_field_permissions',93),(115,'2026_10_02_000001_add_restaurant_reprint_bill_permission',94),(116,'2026_10_02_000002_add_tax_details_to_sale_items',95),(117,'2026_10_02_000003_add_tax_details_to_quotation_items',96),(118,'2026_10_02_000004_add_landing_page_to_roles',97),(119,'2026_10_03_000001_create_etims_foundation',98);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `mpesa_transactions`
--

DROP TABLE IF EXISTS `mpesa_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mpesa_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(30) NOT NULL,
  `source` varchar(30) NOT NULL DEFAULT 'daraja',
  `status` varchar(30) NOT NULL DEFAULT 'received',
  `merchant_request_id` varchar(255) DEFAULT NULL,
  `checkout_request_id` varchar(255) DEFAULT NULL,
  `transaction_code` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `account_reference` varchar(255) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `sale_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `sms_in_id` bigint(20) unsigned DEFAULT NULL,
  `claimed_by` bigint(20) unsigned DEFAULT NULL,
  `claimed_at` timestamp NULL DEFAULT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),
  `result_description` text DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `mpesa_transactions_sms_in_id_unique` (`sms_in_id`),
  UNIQUE KEY `mpesa_transaction_code_unique` (`transaction_code`),
  KEY `mpesa_transactions_sale_id_foreign` (`sale_id`),
  KEY `mpesa_transactions_merchant_request_id_index` (`merchant_request_id`),
  KEY `mpesa_transactions_checkout_request_id_index` (`checkout_request_id`),
  KEY `mpesa_transactions_transaction_code_index` (`transaction_code`),
  KEY `mpesa_transactions_account_reference_index` (`account_reference`),
  KEY `mpesa_transactions_branch_id_foreign` (`branch_id`),
  KEY `mpesa_transactions_claimed_by_foreign` (`claimed_by`),
  KEY `mpesa_transactions_source_index` (`source`),
  KEY `mpesa_available_transactions_index` (`source`,`status`,`sale_id`,`branch_id`,`processed_at`),
  CONSTRAINT `mpesa_transactions_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `mpesa_transactions_claimed_by_foreign` FOREIGN KEY (`claimed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `mpesa_transactions_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE SET NULL,
  CONSTRAINT `mpesa_transactions_sms_in_id_foreign` FOREIGN KEY (`sms_in_id`) REFERENCES `sms_in` (`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 `mpesa_transactions`
--

LOCK TABLES `mpesa_transactions` WRITE;
/*!40000 ALTER TABLE `mpesa_transactions` DISABLE KEYS */;
/*!40000 ALTER TABLE `mpesa_transactions` 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 `payment_methods`
--

DROP TABLE IF EXISTS `payment_methods`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_methods` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `account_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `bank_name` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_payment_methods_branch_id_is_active` (`branch_id`,`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payment_methods`
--

LOCK TABLES `payment_methods` WRITE;
/*!40000 ALTER TABLE `payment_methods` DISABLE KEYS */;
INSERT INTO `payment_methods` VALUES (2,'Cash',2,2,'Cash',NULL,1,'2026-05-18 09:12:12','2026-05-18 09:12:12'),(3,'Mpesa',5,2,NULL,NULL,1,'2026-05-19 12:43:45','2026-05-19 12:43:45'),(6,'Credit',10,NULL,NULL,'Customer will pay later. The transaction remains pending.',1,'2026-09-09 22:39:48','2026-09-15 18:15:02');
/*!40000 ALTER TABLE `payment_methods` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payments`
--

DROP TABLE IF EXISTS `payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sale_id` bigint(20) unsigned NOT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `payment_method_id` bigint(20) unsigned NOT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `reference_no` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `received_by` bigint(20) unsigned DEFAULT NULL,
  `payment_date` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_payments_sale_id_payment_method_id` (`sale_id`,`payment_method_id`),
  KEY `idx_payments_payment_method_id_payment_date` (`payment_method_id`,`payment_date`),
  KEY `idx_payments_shift_id` (`shift_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 `payments`
--

LOCK TABLES `payments` WRITE;
/*!40000 ALTER TABLE `payments` DISABLE KEYS */;
INSERT INTO `payments` VALUES (1,1,NULL,3,60.00,NULL,NULL,3,'2026-10-03 00:56:17','2026-10-02 21:56:17','2026-10-02 21:56:17');
/*!40000 ALTER TABLE `payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_components`
--

DROP TABLE IF EXISTS `payroll_components`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payroll_components` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `type` enum('earning','deduction') NOT NULL,
  `calculation` enum('fixed','percentage') NOT NULL DEFAULT 'fixed',
  `value` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `is_statutory` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payroll_components_code_unique` (`code`),
  KEY `payroll_components_is_active_index` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payroll_components`
--

LOCK TABLES `payroll_components` WRITE;
/*!40000 ALTER TABLE `payroll_components` DISABLE KEYS */;
/*!40000 ALTER TABLE `payroll_components` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_entries`
--

DROP TABLE IF EXISTS `payroll_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payroll_entries` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `payroll_run_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `basic_salary` decimal(15,2) NOT NULL DEFAULT 0.00,
  `allowances` decimal(15,2) NOT NULL DEFAULT 0.00,
  `other_payments` decimal(15,2) NOT NULL DEFAULT 0.00,
  `gross_pay` decimal(15,2) NOT NULL DEFAULT 0.00,
  `paye` decimal(15,2) NOT NULL DEFAULT 0.00,
  `nssf` decimal(15,2) NOT NULL DEFAULT 0.00,
  `shif` decimal(15,2) NOT NULL DEFAULT 0.00,
  `housing_levy` decimal(15,2) NOT NULL DEFAULT 0.00,
  `advance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `loan` decimal(15,2) NOT NULL DEFAULT 0.00,
  `helb_sacco` decimal(15,2) NOT NULL DEFAULT 0.00,
  `damages` decimal(15,2) NOT NULL DEFAULT 0.00,
  `statutory_deductions` decimal(15,2) NOT NULL DEFAULT 0.00,
  `other_deductions` decimal(15,2) NOT NULL DEFAULT 0.00,
  `net_pay` decimal(15,2) NOT NULL DEFAULT 0.00,
  `payment_method` varchar(255) DEFAULT NULL,
  `bank_name` varchar(255) DEFAULT NULL,
  `bank_account_number` varchar(255) DEFAULT NULL,
  `component_breakdown` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`component_breakdown`)),
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payroll_entries_payroll_run_id_user_id_unique` (`payroll_run_id`,`user_id`),
  KEY `payroll_entries_user_id_foreign` (`user_id`),
  CONSTRAINT `payroll_entries_payroll_run_id_foreign` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_runs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_entries_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 `payroll_entries`
--

LOCK TABLES `payroll_entries` WRITE;
/*!40000 ALTER TABLE `payroll_entries` DISABLE KEYS */;
/*!40000 ALTER TABLE `payroll_entries` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_runs`
--

DROP TABLE IF EXISTS `payroll_runs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payroll_runs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `payroll_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `pay_date` date NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'draft',
  `gross_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `deduction_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `net_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `created_by` bigint(20) unsigned NOT NULL,
  `finalized_by` bigint(20) unsigned DEFAULT NULL,
  `finalized_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payroll_runs_payroll_no_unique` (`payroll_no`),
  KEY `payroll_runs_created_by_foreign` (`created_by`),
  KEY `payroll_runs_finalized_by_foreign` (`finalized_by`),
  KEY `payroll_runs_branch_id_period_start_period_end_index` (`branch_id`,`period_start`,`period_end`),
  KEY `payroll_runs_status_index` (`status`),
  CONSTRAINT `payroll_runs_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `payroll_runs_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `payroll_runs_finalized_by_foreign` FOREIGN KEY (`finalized_by`) REFERENCES `users` (`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 `payroll_runs`
--

LOCK TABLES `payroll_runs` WRITE;
/*!40000 ALTER TABLE `payroll_runs` DISABLE KEYS */;
/*!40000 ALTER TABLE `payroll_runs` 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,
  `module_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_code_unique` (`code`),
  KEY `permissions_module_id_foreign` (`module_id`),
  CONSTRAINT `permissions_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `system_modules` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=456 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 (162,4,'View Products','products.view',NULL,1,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(163,4,'Create Product','products.create',NULL,2,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(164,4,'Update Product','products.update',NULL,3,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(165,4,'Delete Product','products.delete',NULL,4,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(166,4,'Adjust Stock','products.adjust_stock',NULL,5,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(167,5,'View Categories','categories.view',NULL,1,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(168,5,'Create Category','categories.create',NULL,2,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(169,5,'Update Category','categories.update',NULL,3,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(170,5,'Delete Category','categories.delete',NULL,4,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(171,12,'View Users','users.view',NULL,1,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(172,12,'Create User','users.create',NULL,2,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(173,12,'Update User','users.update',NULL,3,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(174,12,'Delete User','users.delete',NULL,4,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(175,12,'Reset User Password','users.reset_password',NULL,5,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(176,12,'View Roles','roles.view',NULL,6,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(177,12,'Create Role','roles.create',NULL,7,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(178,12,'Update Role','roles.update',NULL,8,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(179,12,'Delete Role','roles.delete',NULL,9,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(180,12,'Assign Role Permissions','roles.assign_permissions',NULL,10,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(181,14,'View Human Resource','human_resource.view',NULL,50,1,'2026-05-19 06:57:41','2026-09-22 17:15:56'),(182,18,'View Departments','departments.view',NULL,1,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(183,18,'Create Department','departments.create',NULL,2,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(184,18,'Update Department','departments.update',NULL,3,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(185,18,'Delete Department','departments.delete',NULL,4,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(186,13,'View Settings','settings.view',NULL,1,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(187,13,'View Branches','branches.view',NULL,2,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(188,13,'Create Branch','branches.create',NULL,3,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(189,13,'Update Branch','branches.update',NULL,4,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(190,13,'Delete Branch','branches.delete',NULL,5,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(191,9,'View Accounting','accounting.view',NULL,1,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(192,9,'View Chart of Accounts','accounts.view',NULL,3,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(193,9,'Create Account','accounts.create',NULL,4,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(194,9,'Update Account','accounts.update',NULL,5,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(195,9,'Delete Account','accounts.delete',NULL,6,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(196,9,'View Payment Methods','payment_methods.view',NULL,7,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(197,9,'Create Payment Method','payment_methods.create',NULL,8,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(198,9,'Update Payment Method','payment_methods.update',NULL,9,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(199,9,'Delete Payment Method','payment_methods.delete',NULL,10,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(200,2,'View Retail POS','retail_pos.view',NULL,1,1,'2026-05-19 06:57:41','2026-09-15 17:02:34'),(201,23,'View Task Categories','task_categories.view',NULL,1,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(202,23,'Create Task Category','task_categories.create',NULL,2,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(203,23,'Update Task Category','task_categories.update',NULL,3,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(204,23,'Delete Task Category','task_categories.delete',NULL,4,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(205,23,'Add Own Task','tasks.create_own',NULL,5,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(206,23,'View Own Tasks','tasks.view_own',NULL,6,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(207,23,'Update Own Task','tasks.update_own',NULL,7,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(208,23,'Delete Own Task','tasks.delete_own',NULL,8,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(209,23,'Post Specific Task','tasks.post_specific',NULL,9,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(210,23,'Post General Task','tasks.post_general',NULL,10,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(211,23,'View Others Specific Tasks','tasks.view_others_specific',NULL,11,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(212,23,'View Others General Tasks','tasks.view_others_general',NULL,12,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(213,23,'Assign Task','tasks.assign',NULL,13,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(214,23,'Post Task For Others','tasks.post_for_others',NULL,14,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(215,23,'Post Employee Notes For Others','tasks.employee_notes_for_others',NULL,15,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(216,23,'Clear Overall Pending Tasks For Anyone','tasks.clear_any_pending',NULL,16,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(217,23,'View Task Reports','tasks.reports',NULL,17,1,'2026-09-11 17:31:30','2026-09-15 17:02:34'),(218,1,'View Dashboard','dashboard.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(219,2,'Create Retail Sale','retail_pos.sell',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(220,2,'Save Retail Sale','retail_pos.save',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(221,2,'Save And Print Retail Sale','retail_pos.save_print',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(222,2,'Post Credit Sale','retail_pos.credit_sale',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(223,2,'Create Retail Quotation','retail_pos.quotation',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(224,2,'Suspend Retail Bill','retail_pos.suspend_bill',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(225,2,'Unsuspend Retail Bill','retail_pos.unsuspend_bill',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(226,2,'Add Customer From Retail POS','retail_pos.add_customer',NULL,9,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(227,2,'Use M-Pesa STK Push','retail_pos.mpesa_stk',NULL,10,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(228,3,'View Wholesale POS','wholesale.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(229,3,'Create Wholesale Sale','wholesale.sell',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(230,3,'Save Wholesale Sale','wholesale.save',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(231,3,'Save And Print Wholesale Sale','wholesale.save_print',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(232,3,'Post Wholesale Credit Sale','wholesale.credit_sale',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(233,3,'Create Wholesale Quotation','wholesale.quotation',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(234,3,'Suspend Wholesale Bill','wholesale.suspend_bill',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(235,3,'Unsuspend Wholesale Bill','wholesale.unsuspend_bill',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(236,3,'Add Customer From Wholesale POS','wholesale.add_customer',NULL,9,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(237,3,'Use Wholesale M-Pesa STK Push','wholesale.mpesa_stk',NULL,10,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(238,15,'View Sales','sales.view',NULL,1,0,'2026-09-15 17:02:34','2026-10-01 08:39:02'),(239,15,'View Sale Details','sales.details',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(240,15,'Edit Sale / Add Items','sales.edit_add_items',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(241,15,'Print Receipt','sales.print_receipt',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(242,15,'Print A4 Invoice','sales.print_a4_invoice',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(243,15,'Print Delivery Note','sales.print_delivery_note',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(244,15,'Receive Payment','sales.receive_payment',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(245,15,'Bulk Clear Bills','sales.bulk_clear',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(246,15,'Void / Sale Return','sales.void',NULL,9,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(247,15,'Delete Sale','sales.delete',NULL,10,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(248,15,'View End Of Day / Shift Report','sales.end_day_report',NULL,11,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(249,21,'View Customers','customers.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(250,21,'Create Customer','customers.create',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(251,21,'Update Customer','customers.update',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(252,21,'Delete Customer','customers.delete',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(253,21,'Receive Customer Payment','customers.receive_payment',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(254,21,'View Customer Statement','customers.statement',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(255,21,'View Customer Invoices','customers.invoices',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(256,21,'Manage License Activation','customers.license_activation',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(257,24,'View Quotations','quotations.view',NULL,1,0,'2026-09-15 17:02:34','2026-10-01 08:39:02'),(258,24,'Create Quotation','quotations.create',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(259,24,'Print Quotation','quotations.print',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(260,24,'Convert Quotation to Invoice','quotations.convert',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(261,24,'Delete Quotation','quotations.delete',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(262,22,'View Suppliers','suppliers.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(263,22,'Create Supplier','suppliers.create',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(264,22,'Update Supplier','suppliers.update',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(265,22,'Delete Supplier','suppliers.delete',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(266,4,'View Product Stock','products.stock_view',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(267,5,'View Expense Categories','expense_categories.view',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(268,5,'Create Expense Category','expense_categories.create',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(269,5,'Update Expense Category','expense_categories.update',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(270,5,'Delete Expense Category','expense_categories.delete',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(271,17,'View Expenses','expenses.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(272,17,'Create Expense','expenses.create',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(273,17,'Delete Expense','expenses.delete',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(274,20,'View Shifts','shifts.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(275,20,'Open Shift','shifts.open',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(276,20,'Close Own Shift','shifts.close',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(277,20,'Close Any Shift','shifts.close_any',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(278,20,'View Shift Reports','shifts.reports',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(279,20,'Enter Shift Stock Counts','shifts.stock_counts',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(280,6,'View Restaurant / Bar','restaurant_bar.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(281,6,'Create Restaurant Order','restaurant_bar.order',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(282,6,'Edit Restaurant Order','restaurant_bar.edit_order',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(283,6,'Print Bill','restaurant_bar.print_bill',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(284,6,'Close Table','restaurant_bar.close_table',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(285,6,'Merge Bills','restaurant_bar.merge_bills',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(286,6,'View Open Bills','restaurant_bar.open_bills',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(287,6,'View Uncleared Bills','restaurant_bar.uncleared_bills',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(288,6,'Manage Restaurant Setup','restaurant_bar.setup',NULL,9,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(289,7,'View Accommodation','accommodation.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(290,7,'Manage Hotels','accommodation.hotels',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(291,7,'Manage Floors','accommodation.floors',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(292,7,'Manage Room Types','accommodation.room_types',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(293,7,'Manage Rooms','accommodation.rooms',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(294,7,'Create Guest','accommodation.create_guest',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(295,7,'Check In Guest','accommodation.check_in',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(296,7,'Check Out Guest','accommodation.check_out',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(297,7,'Receive Accommodation Payment','accommodation.receive_payment',NULL,9,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(298,7,'Print Accommodation Receipt','accommodation.print_receipt',NULL,10,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(299,7,'View Accommodation Reports','accommodation.reports',NULL,11,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(300,8,'View Inventory','inventory.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(301,8,'View Stock Value Report','inventory.stock_value',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(302,8,'View Low Stock Report','inventory.low_stock',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(303,8,'View Opening And Closing Stock','inventory.opening_closing',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(304,8,'Start Stock Taking','inventory.stock_taking_start',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(305,8,'Update Stock Taking','inventory.stock_taking_update',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(306,8,'Adjust Stock Taking','inventory.stock_taking_adjust',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(307,8,'Close Stock Taking','inventory.stock_taking_close',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(311,9,'View VAT / Tax Report','accounting.vat_report',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(312,9,'View Tax Rates','tax_rates.view',NULL,11,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(313,9,'Create Tax Rate','tax_rates.create',NULL,12,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(314,9,'Update Tax Rate','tax_rates.update',NULL,13,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(315,9,'Delete Tax Rate','tax_rates.delete',NULL,14,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(316,10,'View Reports','reports.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(317,10,'View Sales Reports','reports.sales',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(318,10,'View Purchase Reports','reports.purchases',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(319,10,'View Inventory Reports','reports.inventory',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(320,10,'View Customer Reports','reports.customers',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(321,10,'View Supplier Reports','reports.suppliers',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(322,10,'View User Reports','reports.users',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(323,10,'Export Reports','reports.export',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(324,10,'Print Reports','reports.print',NULL,9,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(325,11,'View Bulk SMS','bulk_sms.view',NULL,1,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(326,11,'Create SMS Campaign','bulk_sms.create_campaign',NULL,2,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(327,11,'View SMS Campaigns','bulk_sms.view_campaigns',NULL,3,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(328,11,'Manage SMS Templates','bulk_sms.templates',NULL,4,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(329,11,'Send SMS','bulk_sms.send',NULL,5,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(330,13,'Update System Configuration','settings.system_configuration',NULL,6,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(331,13,'Update Invoice Setup','settings.invoice_setup',NULL,7,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(332,13,'Update M-Pesa Settings','settings.mpesa',NULL,8,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(333,13,'Update Bulk SMS Settings','settings.bulk_sms',NULL,9,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(334,13,'Manage Unit Of Measures','settings.unit_of_measures',NULL,10,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(335,16,'View Purchases','purchases.view',NULL,1,0,'2026-09-15 17:12:01','2026-10-01 08:39:02'),(336,16,'Create Purchase','purchases.create',NULL,2,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(337,16,'View Purchase Details','purchases.details',NULL,3,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(338,16,'Edit Purchase / Add Items','purchases.edit_add_items',NULL,4,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(339,16,'Pay Purchase','purchases.pay',NULL,5,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(340,16,'Return Purchase To Supplier','purchases.return',NULL,6,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(341,16,'Print GRN','purchases.print_grn',NULL,7,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(342,16,'Print Purchase Return Note','purchases.print_return_note',NULL,8,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(343,16,'Delete Purchase','purchases.delete',NULL,9,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(344,26,'View Deals','deals.view',NULL,1,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(345,26,'Create Deal','deals.create',NULL,2,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(346,26,'Update Deal','deals.update',NULL,3,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(347,26,'Delete Deal','deals.delete',NULL,4,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(348,26,'Add Deal Follow Up','deals.follow_up',NULL,5,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(349,26,'View Own Deals','deals.view_own',NULL,6,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(350,26,'View Other Deals','deals.view_others',NULL,7,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(351,26,'Transfer Deals','deals.transfer',NULL,8,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(352,26,'View Deals Reports','deals.reports',NULL,9,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(353,27,'View Call Centre','call_centre.view',NULL,1,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(354,27,'Add Call','call_centre.create',NULL,2,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(355,27,'Update Call','call_centre.update',NULL,3,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(356,27,'Delete Call','call_centre.delete',NULL,4,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(357,27,'View Other Calls','call_centre.view_others',NULL,5,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(358,27,'View Call Reports','call_centre.reports',NULL,6,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(359,25,'View Stock Transfers','stock_transfers.view',NULL,900,1,'2026-09-15 17:37:53','2026-09-15 17:37:53'),(360,25,'Create Stock Transfer','stock_transfers.create',NULL,901,1,'2026-09-15 17:37:53','2026-09-15 17:37:53'),(361,25,'View Stock Transfer Details','stock_transfers.details',NULL,902,1,'2026-09-15 17:37:53','2026-09-15 17:37:53'),(362,28,'View Damaged Products','damaged_products.view',NULL,903,1,'2026-09-15 17:37:53','2026-09-15 17:37:53'),(363,28,'Record Damaged Products','damaged_products.create',NULL,904,1,'2026-09-15 17:37:53','2026-09-15 17:37:53'),(364,9,'View Audit Trail','accounting.audit_trail',NULL,950,1,'2026-09-15 18:05:45','2026-09-15 18:05:45'),(365,9,'View General Ledger','accounting.general_ledger',NULL,951,1,'2026-09-15 18:05:45','2026-09-15 18:05:45'),(366,9,'View Trial Balance','accounting.trial_balance',NULL,952,1,'2026-09-15 18:05:45','2026-09-15 18:05:45'),(367,9,'View Profit And Loss','accounting.profit_loss',NULL,953,1,'2026-09-15 18:05:45','2026-09-15 18:05:45'),(368,9,'View Balance Sheet','accounting.balance_sheet',NULL,954,1,'2026-09-16 11:59:25','2026-09-16 11:59:25'),(369,13,'Database Backups','settings.backups',NULL,50,1,'2026-09-16 12:59:32','2026-09-16 12:59:32'),(370,13,'Create Database Backup','settings.backups_create',NULL,51,1,'2026-09-16 12:59:32','2026-09-16 12:59:32'),(371,13,'Download Database Backup','settings.backups_download',NULL,52,1,'2026-09-16 12:59:32','2026-09-16 12:59:32'),(372,13,'Delete Database Backup','settings.backups_delete',NULL,53,1,'2026-09-16 12:59:32','2026-09-16 12:59:32'),(373,13,'Update Website Setup','settings.website',NULL,54,1,'2026-09-21 18:12:42','2026-09-21 18:12:42'),(374,7,'Manage Meal and Rate Plans','accommodation.rate_plans',NULL,30,1,'2026-09-21 18:48:16','2026-09-21 18:48:16'),(375,8,'View Internal Stock Issues','inventory.internal_issues_view',NULL,9,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(376,8,'Create Internal Stock Issue','inventory.internal_issues_create',NULL,10,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(377,8,'Confirm Internal Stock Receipt','inventory.internal_issues_receive',NULL,11,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(378,8,'View Internal Stock Issue Reports','inventory.internal_issues_reports',NULL,12,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(379,7,'View Housekeeping Stock','accommodation.housekeeping_stock',NULL,31,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(380,7,'Receive Housekeeping Stock','accommodation.housekeeping_receive',NULL,32,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(381,7,'Issue Housekeeping Stock To Rooms','accommodation.housekeeping_issue_room',NULL,33,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(382,7,'Return Housekeeping Stock','accommodation.housekeeping_return',NULL,34,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(383,7,'Record Housekeeping Stock Loss','accommodation.housekeeping_loss',NULL,35,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(384,7,'View Housekeeping Stock Reports','accommodation.housekeeping_reports',NULL,36,1,'2026-09-21 19:57:12','2026-09-21 19:57:12'),(385,7,'View All Employees Housekeeping Stock','accommodation.housekeeping_view_all',NULL,37,1,'2026-09-21 20:06:10','2026-09-21 20:06:10'),(386,9,'View Treasury And Cash Flow','accounting.treasury_view',NULL,50,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(387,9,'Record Bank Deposit','accounting.bank_deposit',NULL,51,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(388,9,'Record Account Transfer','accounting.bank_transfer',NULL,52,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(389,9,'Reverse Treasury Transaction','accounting.treasury_reverse',NULL,53,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(390,29,'View Projects','projects.view',NULL,50,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(391,29,'Create Project','projects.create',NULL,51,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(392,29,'Update Project','projects.update',NULL,52,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(393,29,'Manage Project Members','projects.members',NULL,53,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(394,29,'Manage Milestones','projects.milestones',NULL,54,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(395,29,'Manage Project Tasks','projects.tasks',NULL,55,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(396,29,'Post Project Status Update','projects.status_updates',NULL,56,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(397,29,'View Project Reports','projects.reports',NULL,57,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(398,14,'View Employee Directory','human_resource.employees',NULL,51,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(399,14,'Manage Leave Types','human_resource.leave_types',NULL,52,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(400,14,'Create Leave Request','human_resource.leave_create',NULL,53,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(401,14,'Approve Leave Request','human_resource.leave_approve',NULL,54,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(402,14,'Manage Contracts','human_resource.contracts',NULL,55,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(403,14,'Manage Performance Reviews','human_resource.reviews',NULL,56,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(404,14,'Manage Disciplinary Cases','human_resource.discipline',NULL,57,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(405,14,'View HR Reports','human_resource.reports',NULL,58,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(406,30,'View Attendance','attendance.view',NULL,50,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(407,30,'Manage Biometric Devices','attendance.devices',NULL,51,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(408,30,'Map Device Employees','attendance.mappings',NULL,52,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(409,30,'Import Or Sync Attendance','attendance.sync',NULL,53,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(410,30,'Add Manual Attendance','attendance.manual',NULL,54,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(411,30,'Update Attendance Comments','attendance.update',NULL,55,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(412,30,'View Attendance Reports','attendance.reports',NULL,56,1,'2026-09-22 17:15:56','2026-09-22 17:15:56'),(413,14,'Manage Payroll','human_resource.payroll',NULL,60,1,'2026-09-22 17:20:32','2026-09-22 17:20:32'),(414,14,'View Attendance in HR','human_resource.attendance',NULL,70,1,'2026-09-22 18:44:35','2026-09-22 18:44:35'),(415,14,'View Leave Records','human_resource.leave_view',NULL,71,1,'2026-09-22 18:44:35','2026-09-22 18:44:35'),(416,14,'View Task Performance in HR','human_resource.task_performance',NULL,72,1,'2026-09-22 18:44:35','2026-09-22 18:44:35'),(417,14,'Add Employees in HR','human_resource.employee_create',NULL,80,1,'2026-09-22 19:18:54','2026-09-22 19:18:54'),(418,14,'Edit Employee and Payroll Details','human_resource.employee_update',NULL,81,1,'2026-09-22 19:18:54','2026-09-22 19:18:54'),(419,14,'Manage Payroll Setup','human_resource.payroll_setup',NULL,82,1,'2026-09-22 19:18:54','2026-09-22 19:18:54'),(420,4,'Import Products From Excel','products.import',NULL,7,1,'2026-09-22 21:57:12','2026-09-22 21:57:12'),(421,22,'Pay Supplier Opening Balance','suppliers.pay_opening_balance','Record payments against a supplier opening balance.',50,1,'2026-09-25 18:42:24','2026-09-25 18:42:24'),(422,2,'Claim Modem M-Pesa Payment','retail_pos.mpesa_claim',NULL,90,1,'2026-09-25 21:27:39','2026-09-25 21:27:39'),(423,3,'Claim Modem M-Pesa Payment','wholesale.mpesa_claim',NULL,90,1,'2026-09-25 21:27:39','2026-09-25 21:27:39'),(424,15,'View M-Pesa Transactions','sales.mpesa_transactions',NULL,90,1,'2026-09-25 21:27:39','2026-09-25 21:27:39'),(425,31,'View Leads','leads.view',NULL,1,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(426,31,'Create Lead','leads.create',NULL,2,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(427,31,'Update Lead','leads.update',NULL,3,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(428,31,'Delete Lead','leads.delete',NULL,4,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(429,31,'Assign Leads','leads.assign',NULL,5,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(430,31,'Convert Lead To Deal','leads.convert',NULL,6,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(431,31,'View Own Leads','leads.view_own',NULL,7,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(432,31,'View Other Leads','leads.view_others',NULL,8,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(433,31,'Add Lead Notes','leads.add_note',NULL,9,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(434,31,'View My Follow-ups','follow_ups.view',NULL,10,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(435,31,'View Other Users Follow-ups','follow_ups.view_others',NULL,11,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(436,31,'Create Follow-up','follow_ups.create',NULL,12,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(437,31,'Update Or Reschedule Follow-up','follow_ups.update',NULL,13,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(438,31,'Complete Follow-up','follow_ups.complete',NULL,14,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(439,31,'Cancel Follow-up','follow_ups.cancel',NULL,15,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(440,31,'View CRM Reports','crm.reports',NULL,16,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(441,26,'Add Deal Notes','deals.add_note',NULL,10,1,'2026-09-29 12:16:32','2026-09-29 12:16:32'),(442,15,'View Own Sales','sales.view_own',NULL,900,1,'2026-10-01 08:37:35','2026-10-01 08:37:35'),(443,15,'View All Sales','sales.view_all',NULL,901,1,'2026-10-01 08:37:35','2026-10-01 08:37:35'),(444,16,'View Own Purchases','purchases.view_own',NULL,902,1,'2026-10-01 08:37:35','2026-10-01 08:37:35'),(445,16,'View All Purchases','purchases.view_all',NULL,903,1,'2026-10-01 08:37:35','2026-10-01 08:37:35'),(446,24,'View Own Quotations','quotations.view_own',NULL,904,1,'2026-10-01 08:37:35','2026-10-01 08:37:35'),(447,24,'View All Quotations','quotations.view_all',NULL,905,1,'2026-10-01 08:37:35','2026-10-01 08:37:35'),(448,23,'View All Tasks','tasks.view_all',NULL,906,1,'2026-10-01 08:37:35','2026-10-01 08:37:35'),(449,4,'View / Manage Wholesale Price','products.wholesale_price',NULL,8,1,'2026-10-01 20:24:09','2026-10-01 20:24:09'),(450,4,'View / Manage Website Price','products.website_price',NULL,9,1,'2026-10-01 20:24:09','2026-10-01 20:24:09'),(451,4,'View / Manage Online Product Status','products.online_listing',NULL,10,1,'2026-10-01 20:24:09','2026-10-01 20:24:09'),(452,6,'Reprint Uncleared Bill','restaurant_bar.reprint_bill',NULL,9,1,'2026-10-01 21:21:05','2026-10-01 21:21:05'),(453,13,'View eTIMS Setup and Transactions','settings.etims_view',NULL,55,1,'2026-10-02 21:43:57','2026-10-02 21:43:57'),(454,13,'Manage eTIMS Setup','settings.etims_manage',NULL,56,1,'2026-10-02 21:43:57','2026-10-02 21:43:57'),(455,13,'Retry eTIMS Documents','settings.etims_retry',NULL,57,1,'2026-10-02 21:43:57','2026-10-02 21:43:57');
/*!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` varchar(255) 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`)
) ENGINE=InnoDB 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 */;
/*!40000 ALTER TABLE `personal_access_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `price_tiers`
--

DROP TABLE IF EXISTS `price_tiers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `price_tiers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `price_tiers_code_unique` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `price_tiers`
--

LOCK TABLES `price_tiers` WRITE;
/*!40000 ALTER TABLE `price_tiers` DISABLE KEYS */;
/*!40000 ALTER TABLE `price_tiers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `print_jobs`
--

DROP TABLE IF EXISTS `print_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `print_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `print_station_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `document_type` varchar(40) NOT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_id` bigint(20) unsigned DEFAULT NULL,
  `printer_name` varchar(255) NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`payload`)),
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `attempts` int(10) unsigned NOT NULL DEFAULT 0,
  `available_at` timestamp NULL DEFAULT NULL,
  `claimed_at` timestamp NULL DEFAULT NULL,
  `printed_at` timestamp NULL DEFAULT NULL,
  `error_message` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `print_jobs_branch_id_foreign` (`branch_id`),
  KEY `print_jobs_station_status_idx` (`print_station_id`,`status`,`available_at`),
  KEY `print_jobs_source_type_source_id_index` (`source_type`,`source_id`),
  CONSTRAINT `print_jobs_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `print_jobs_print_station_id_foreign` FOREIGN KEY (`print_station_id`) REFERENCES `print_stations` (`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 `print_jobs`
--

LOCK TABLES `print_jobs` WRITE;
/*!40000 ALTER TABLE `print_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `print_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `print_stations`
--

DROP TABLE IF EXISTS `print_stations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `print_stations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `station_code` varchar(40) NOT NULL,
  `api_token_hash` varchar(64) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_seen_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `print_stations_station_code_unique` (`station_code`),
  KEY `print_stations_branch_id_foreign` (`branch_id`),
  CONSTRAINT `print_stations_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `print_stations`
--

LOCK TABLES `print_stations` WRITE;
/*!40000 ALTER TABLE `print_stations` DISABLE KEYS */;
INSERT INTO `print_stations` VALUES (2,2,'kitchen','PRN-7JPCKQNSN6','694d762be814749dd8be23329c63bfde72367a2ce9197c416e924812f746c898',1,NULL,'2026-09-30 18:45:13','2026-09-30 18:45:13'),(3,2,'kitchen','PRN-Z1R9LR3JLY','4f270837c457ed2c3d10f7f156ea97953d4c88dcb131302be573beef04b88812',1,NULL,'2026-09-30 18:46:29','2026-09-30 18:46:29');
/*!40000 ALTER TABLE `print_stations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `product_prices`
--

DROP TABLE IF EXISTS `product_prices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_prices` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `price_tier_id` bigint(20) unsigned NOT NULL,
  `selling_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_prices_product_id_price_tier_id_unique` (`product_id`,`price_tier_id`),
  KEY `product_prices_price_tier_id_foreign` (`price_tier_id`),
  CONSTRAINT `product_prices_price_tier_id_foreign` FOREIGN KEY (`price_tier_id`) REFERENCES `price_tiers` (`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 `product_prices`
--

LOCK TABLES `product_prices` WRITE;
/*!40000 ALTER TABLE `product_prices` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_prices` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `products`
--

DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `barcode` varchar(255) NOT NULL,
  `hs_code` varchar(32) DEFAULT NULL,
  `etims_item_classification_code` varchar(32) DEFAULT NULL,
  `etims_item_code` varchar(64) DEFAULT NULL,
  `etims_origin_country_code` varchar(8) DEFAULT NULL,
  `etims_package_unit_code` varchar(16) DEFAULT NULL,
  `etims_quantity_unit_code` varchar(16) DEFAULT NULL,
  `product_type` enum('single','combo') NOT NULL DEFAULT 'single',
  `inventory_type` enum('inventory','service') NOT NULL DEFAULT 'inventory',
  `category_id` bigint(20) unsigned DEFAULT NULL,
  `sub_category_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `uom` varchar(255) DEFAULT NULL,
  `buying_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `retail_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `wholesale_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `website_price` decimal(15,2) DEFAULT NULL,
  `show_on_website` tinyint(1) NOT NULL DEFAULT 1,
  `website_description` text DEFAULT NULL,
  `stock_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `alert_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit_of_measure_id` bigint(20) unsigned DEFAULT NULL,
  `track_stock` tinyint(1) NOT NULL DEFAULT 1,
  `vat_method` enum('inclusive','exclusive') NOT NULL DEFAULT 'inclusive',
  `vat_type` enum('standard','zero_rated','exempt','non_vat') NOT NULL DEFAULT 'standard',
  `vat_rate` decimal(5,2) NOT NULL DEFAULT 16.00,
  `tax_rate_id` bigint(20) unsigned DEFAULT NULL,
  `income_account_id` bigint(20) unsigned DEFAULT NULL,
  `expense_account_id` bigint(20) unsigned DEFAULT NULL,
  `asset_account_id` bigint(20) unsigned DEFAULT NULL,
  `image_path` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `products_barcode_branch_unique` (`barcode`,`branch_id`),
  KEY `products_tax_rate_id_foreign` (`tax_rate_id`),
  KEY `idx_products_branch_id_is_active` (`branch_id`,`is_active`),
  KEY `idx_products_branch_id_category_id` (`branch_id`,`category_id`),
  KEY `idx_products_category_id_sub_category_id` (`category_id`,`sub_category_id`),
  KEY `idx_products_inventory_type_track_stock` (`inventory_type`,`track_stock`),
  KEY `idx_products_stock_quantity_alert_quantity` (`stock_quantity`,`alert_quantity`),
  KEY `products_hs_code_index` (`hs_code`),
  KEY `products_etims_item_classification_code_index` (`etims_item_classification_code`),
  CONSTRAINT `products_tax_rate_id_foreign` FOREIGN KEY (`tax_rate_id`) REFERENCES `tax_rates` (`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 `products`
--

LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (1,'sample','1',NULL,NULL,NULL,'KE',NULL,NULL,'single','inventory',1,NULL,NULL,NULL,10.00,20.00,0.00,NULL,1,NULL,7.00,5.00,1,1,'inclusive','standard',16.00,1,1,1,1,NULL,1,'2026-10-02 21:55:54','2026-10-02 21:56:17');
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `project_members`
--

DROP TABLE IF EXISTS `project_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_members` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `project_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `role` varchar(255) DEFAULT NULL,
  `allocation_percent` tinyint(3) unsigned NOT NULL DEFAULT 100,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `project_members_project_id_user_id_unique` (`project_id`,`user_id`),
  KEY `project_members_user_id_foreign` (`user_id`),
  CONSTRAINT `project_members_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `project_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `project_members`
--

LOCK TABLES `project_members` WRITE;
/*!40000 ALTER TABLE `project_members` DISABLE KEYS */;
/*!40000 ALTER TABLE `project_members` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `project_milestones`
--

DROP TABLE IF EXISTS `project_milestones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_milestones` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `project_id` bigint(20) unsigned NOT NULL,
  `owner_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `due_date` date DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `completed_at` datetime DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_milestones_project_id_foreign` (`project_id`),
  KEY `project_milestones_owner_id_foreign` (`owner_id`),
  KEY `project_milestones_due_date_index` (`due_date`),
  KEY `project_milestones_status_index` (`status`),
  CONSTRAINT `project_milestones_owner_id_foreign` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `project_milestones_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`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 `project_milestones`
--

LOCK TABLES `project_milestones` WRITE;
/*!40000 ALTER TABLE `project_milestones` DISABLE KEYS */;
/*!40000 ALTER TABLE `project_milestones` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `project_tasks`
--

DROP TABLE IF EXISTS `project_tasks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_tasks` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `task_no` varchar(255) NOT NULL,
  `project_id` bigint(20) unsigned NOT NULL,
  `milestone_id` bigint(20) unsigned DEFAULT NULL,
  `assignee_id` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'backlog',
  `priority` varchar(255) NOT NULL DEFAULT 'medium',
  `start_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `estimated_hours` decimal(8,2) NOT NULL DEFAULT 0.00,
  `actual_hours` decimal(8,2) NOT NULL DEFAULT 0.00,
  `progress` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `blocker` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `project_tasks_task_no_unique` (`task_no`),
  KEY `project_tasks_milestone_id_foreign` (`milestone_id`),
  KEY `project_tasks_assignee_id_foreign` (`assignee_id`),
  KEY `project_tasks_created_by_foreign` (`created_by`),
  KEY `project_tasks_project_id_status_assignee_id_index` (`project_id`,`status`,`assignee_id`),
  KEY `project_tasks_status_index` (`status`),
  KEY `project_tasks_priority_index` (`priority`),
  KEY `project_tasks_due_date_index` (`due_date`),
  CONSTRAINT `project_tasks_assignee_id_foreign` FOREIGN KEY (`assignee_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `project_tasks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `project_tasks_milestone_id_foreign` FOREIGN KEY (`milestone_id`) REFERENCES `project_milestones` (`id`) ON DELETE SET NULL,
  CONSTRAINT `project_tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`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 `project_tasks`
--

LOCK TABLES `project_tasks` WRITE;
/*!40000 ALTER TABLE `project_tasks` DISABLE KEYS */;
/*!40000 ALTER TABLE `project_tasks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `project_updates`
--

DROP TABLE IF EXISTS `project_updates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_updates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `project_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `update_date` date NOT NULL,
  `health` varchar(255) NOT NULL DEFAULT 'on_track',
  `progress` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `summary` text NOT NULL,
  `accomplishments` text DEFAULT NULL,
  `blockers` text DEFAULT NULL,
  `next_steps` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_updates_project_id_foreign` (`project_id`),
  KEY `project_updates_user_id_foreign` (`user_id`),
  KEY `project_updates_update_date_index` (`update_date`),
  CONSTRAINT `project_updates_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `project_updates_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 `project_updates`
--

LOCK TABLES `project_updates` WRITE;
/*!40000 ALTER TABLE `project_updates` DISABLE KEYS */;
/*!40000 ALTER TABLE `project_updates` 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_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `department_id` bigint(20) unsigned DEFAULT NULL,
  `manager_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'planning',
  `priority` varchar(255) NOT NULL DEFAULT 'medium',
  `health` varchar(255) NOT NULL DEFAULT 'on_track',
  `start_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `budget` decimal(15,2) NOT NULL DEFAULT 0.00,
  `actual_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `progress` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `objectives` text DEFAULT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `projects_project_no_unique` (`project_no`),
  KEY `projects_customer_id_foreign` (`customer_id`),
  KEY `projects_department_id_foreign` (`department_id`),
  KEY `projects_manager_id_foreign` (`manager_id`),
  KEY `projects_created_by_foreign` (`created_by`),
  KEY `projects_branch_id_status_due_date_index` (`branch_id`,`status`,`due_date`),
  KEY `projects_status_index` (`status`),
  KEY `projects_priority_index` (`priority`),
  KEY `projects_health_index` (`health`),
  KEY `projects_due_date_index` (`due_date`),
  CONSTRAINT `projects_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `projects_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `projects_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `projects_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `projects_manager_id_foreign` FOREIGN KEY (`manager_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 `projects`
--

LOCK TABLES `projects` WRITE;
/*!40000 ALTER TABLE `projects` DISABLE KEYS */;
/*!40000 ALTER TABLE `projects` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_items`
--

DROP TABLE IF EXISTS `purchase_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `product_name` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `quantity` decimal(15,2) NOT NULL DEFAULT 1.00,
  `returned_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_rate_id` bigint(20) unsigned DEFAULT NULL,
  `tax_type` varchar(40) DEFAULT NULL,
  `tax_rate` decimal(8,2) NOT NULL DEFAULT 0.00,
  `unit_cost_after_tax` decimal(15,2) NOT NULL DEFAULT 0.00,
  `margin_percentage` decimal(8,2) NOT NULL DEFAULT 0.00,
  `selling_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `line_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `uom` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_purchase_items_purchase_id_product_id` (`purchase_id`,`product_id`),
  KEY `idx_purchase_items_product_id` (`product_id`),
  KEY `purchase_items_tax_rate_id_index` (`tax_rate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchase_items`
--

LOCK TABLES `purchase_items` WRITE;
/*!40000 ALTER TABLE `purchase_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_payments`
--

DROP TABLE IF EXISTS `purchase_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` bigint(20) unsigned NOT NULL,
  `payment_method_id` bigint(20) unsigned DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `reference_no` varchar(255) DEFAULT NULL,
  `paid_by` bigint(20) unsigned DEFAULT NULL,
  `payment_date` datetime NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_purchase_payments_purchase_id_payment_method_id` (`purchase_id`,`payment_method_id`),
  KEY `idx_purchase_payments_payment_method_id_payment_date` (`payment_method_id`,`payment_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchase_payments`
--

LOCK TABLES `purchase_payments` WRITE;
/*!40000 ALTER TABLE `purchase_payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_return_items`
--

DROP TABLE IF EXISTS `purchase_return_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_return_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_return_id` bigint(20) unsigned NOT NULL,
  `purchase_item_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `product_name` varchar(255) NOT NULL,
  `quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `line_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL 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 `purchase_return_items`
--

LOCK TABLES `purchase_return_items` WRITE;
/*!40000 ALTER TABLE `purchase_return_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_return_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_returns`
--

DROP TABLE IF EXISTS `purchase_returns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchase_returns` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `return_no` varchar(255) NOT NULL,
  `purchase_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `supplier_name` varchar(255) DEFAULT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `supplier_note` text DEFAULT NULL,
  `return_date` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_returns_return_no_unique` (`return_no`),
  KEY `idx_purchase_returns_purchase_id` (`purchase_id`),
  KEY `idx_purchase_returns_return_date` (`return_date`),
  KEY `idx_purchase_returns_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchase_returns`
--

LOCK TABLES `purchase_returns` WRITE;
/*!40000 ALTER TABLE `purchase_returns` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_returns` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchases`
--

DROP TABLE IF EXISTS `purchases`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `purchases` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `supplier_id` bigint(20) unsigned DEFAULT NULL,
  `supplier_name` varchar(255) DEFAULT NULL,
  `supplier_invoice_no` varchar(255) DEFAULT NULL,
  `purchase_status` varchar(255) NOT NULL DEFAULT 'received',
  `payment_status` varchar(255) NOT NULL DEFAULT 'unpaid',
  `subtotal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `paid_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `balance_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `purchase_date` datetime NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `deleted_by` bigint(20) unsigned DEFAULT NULL,
  `delete_reason` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchases_purchase_no_unique` (`purchase_no`),
  KEY `idx_purchases_branch_id_purchase_date` (`branch_id`,`purchase_date`),
  KEY `idx_purchases_branch_id_payment_status` (`branch_id`,`payment_status`),
  KEY `idx_purchases_branch_id_user_id` (`branch_id`,`user_id`),
  KEY `idx_purchases_supplier_id` (`supplier_id`),
  KEY `idx_purchases_shift_id` (`shift_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchases`
--

LOCK TABLES `purchases` WRITE;
/*!40000 ALTER TABLE `purchases` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchases` 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,
  `product_id` bigint(20) unsigned DEFAULT NULL,
  `product_name` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `quantity` decimal(14,2) NOT NULL,
  `unit_price` decimal(14,2) NOT NULL,
  `discount_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `tax_type` varchar(40) DEFAULT NULL,
  `tax_rate` decimal(8,2) NOT NULL DEFAULT 0.00,
  `tax_name` varchar(255) DEFAULT NULL,
  `line_total` decimal(14,2) NOT NULL,
  `uom` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quotation_items_product_id_foreign` (`product_id`),
  KEY `idx_quotation_items_quotation_id_product_id` (`quotation_id`,`product_id`),
  CONSTRAINT `quotation_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `quotation_items_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`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 `quotation_items`
--

LOCK TABLES `quotation_items` WRITE;
/*!40000 ALTER TABLE `quotation_items` DISABLE KEYS */;
/*!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,
  `quote_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `converted_sale_id` bigint(20) unsigned DEFAULT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `customer_phone` varchar(255) DEFAULT NULL,
  `sale_mode` varchar(255) NOT NULL DEFAULT 'retail',
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `subtotal` decimal(14,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `quote_date` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `quotations_quote_no_unique` (`quote_no`),
  KEY `quotations_user_id_foreign` (`user_id`),
  KEY `quotations_customer_id_foreign` (`customer_id`),
  KEY `quotations_converted_sale_id_foreign` (`converted_sale_id`),
  KEY `idx_quotations_branch_id_quote_date` (`branch_id`,`quote_date`),
  KEY `idx_quotations_branch_id_status` (`branch_id`,`status`),
  CONSTRAINT `quotations_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `quotations_converted_sale_id_foreign` FOREIGN KEY (`converted_sale_id`) REFERENCES `sales` (`id`) ON DELETE SET NULL,
  CONSTRAINT `quotations_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `quotations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `quotations`
--

LOCK TABLES `quotations` WRITE;
/*!40000 ALTER TABLE `quotations` DISABLE KEYS */;
/*!40000 ALTER TABLE `quotations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `restaurant_order_items`
--

DROP TABLE IF EXISTS `restaurant_order_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `restaurant_order_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_order_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `product_name` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `quantity` decimal(15,2) NOT NULL DEFAULT 1.00,
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `line_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `note` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_restaurant_order_items_restaurant_order_id_product_id` (`restaurant_order_id`,`product_id`),
  KEY `idx_restaurant_order_items_product_id` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `restaurant_order_items`
--

LOCK TABLES `restaurant_order_items` WRITE;
/*!40000 ALTER TABLE `restaurant_order_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `restaurant_order_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `restaurant_orders`
--

DROP TABLE IF EXISTS `restaurant_orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `restaurant_orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sale_id` bigint(20) unsigned DEFAULT NULL,
  `restaurant_table_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `customer_phone` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `subtotal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `ordered_at` timestamp NULL DEFAULT NULL,
  `billed_at` timestamp NULL DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_restaurant_orders_branch_id_status` (`branch_id`,`status`),
  KEY `idx_restaurant_orders_user_id_status` (`user_id`,`status`),
  KEY `idx_restaurant_orders_restaurant_table_id_status` (`restaurant_table_id`,`status`),
  KEY `idx_restaurant_orders_sale_id` (`sale_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `restaurant_orders`
--

LOCK TABLES `restaurant_orders` WRITE;
/*!40000 ALTER TABLE `restaurant_orders` DISABLE KEYS */;
/*!40000 ALTER TABLE `restaurant_orders` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `restaurant_tables`
--

DROP TABLE IF EXISTS `restaurant_tables`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `restaurant_tables` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `area` varchar(255) DEFAULT NULL,
  `seats` int(10) unsigned NOT NULL DEFAULT 4,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_restaurant_tables_branch_id_is_active` (`branch_id`,`is_active`),
  CONSTRAINT `restaurant_tables_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `restaurant_tables`
--

LOCK TABLES `restaurant_tables` WRITE;
/*!40000 ALTER TABLE `restaurant_tables` DISABLE KEYS */;
INSERT INTO `restaurant_tables` VALUES (1,NULL,'table 1','main',4,1,'2026-09-06 10:30:56','2026-09-06 10:30:56'),(2,NULL,'Table 2',NULL,4,1,'2026-09-06 15:40:58','2026-09-06 15:40:58'),(3,NULL,'Table 3',NULL,4,1,'2026-09-06 15:41:06','2026-09-06 15:41:06'),(4,NULL,'Table 4',NULL,4,1,'2026-09-06 15:41:14','2026-09-06 15:41:14'),(5,2,'TABLE 5',NULL,4,1,'2026-10-01 21:00:14','2026-10-01 21:00:29');
/*!40000 ALTER TABLE `restaurant_tables` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `role_module_permissions`
--

DROP TABLE IF EXISTS `role_module_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role_module_permissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) unsigned NOT NULL,
  `module_id` bigint(20) unsigned NOT NULL,
  `can_view` tinyint(1) NOT NULL DEFAULT 0,
  `can_create` tinyint(1) NOT NULL DEFAULT 0,
  `can_edit` tinyint(1) NOT NULL DEFAULT 0,
  `can_delete` tinyint(1) NOT NULL DEFAULT 0,
  `can_approve` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_module_permissions_role_id_module_id_unique` (`role_id`,`module_id`),
  KEY `role_module_permissions_module_id_foreign` (`module_id`),
  CONSTRAINT `role_module_permissions_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `system_modules` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_module_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `role_module_permissions`
--

LOCK TABLES `role_module_permissions` WRITE;
/*!40000 ALTER TABLE `role_module_permissions` DISABLE KEYS */;
INSERT INTO `role_module_permissions` VALUES (59,46,2,1,0,0,0,0,'2026-09-22 20:07:06','2026-09-22 20:07:06'),(61,45,1,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(62,45,2,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(63,45,3,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(64,45,4,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(65,45,5,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(66,45,6,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(67,45,7,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(68,45,8,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(69,45,9,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(70,45,10,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(71,45,11,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(72,45,12,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(73,45,13,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(74,45,14,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(75,45,15,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(76,45,16,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(77,45,17,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(78,45,18,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(79,45,20,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(80,45,21,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(81,45,22,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(82,45,23,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(83,45,24,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(84,45,25,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(85,45,26,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(86,45,27,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(87,45,28,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(88,45,29,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(89,45,30,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(90,45,31,1,0,0,0,0,'2026-10-01 20:57:08','2026-10-01 20:57:08');
/*!40000 ALTER TABLE `role_module_permissions` 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` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) unsigned NOT NULL,
  `permission_id` bigint(20) unsigned NOT NULL,
  `is_allowed` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_permissions_role_id_permission_id_unique` (`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 AUTO_INCREMENT=873 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 (559,46,200,1,'2026-09-22 20:07:06','2026-09-22 20:07:06'),(560,46,219,1,'2026-09-22 20:07:06','2026-09-22 20:07:06'),(561,46,221,1,'2026-09-22 20:07:06','2026-09-22 20:07:06'),(562,46,224,1,'2026-09-22 20:07:06','2026-09-22 20:07:06'),(563,46,225,1,'2026-09-22 20:07:06','2026-09-22 20:07:06'),(564,46,226,1,'2026-09-22 20:07:06','2026-09-22 20:07:06'),(567,46,421,0,'2026-09-25 18:42:52','2026-09-25 18:42:52'),(595,45,162,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(596,45,163,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(597,45,164,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(598,45,165,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(599,45,166,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(600,45,167,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(601,45,168,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(602,45,169,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(603,45,170,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(604,45,171,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(605,45,172,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(606,45,173,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(607,45,174,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(608,45,175,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(609,45,176,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(610,45,177,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(611,45,178,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(612,45,179,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(613,45,180,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(614,45,181,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(615,45,182,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(616,45,183,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(617,45,184,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(618,45,185,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(619,45,186,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(620,45,187,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(621,45,188,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(622,45,189,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(623,45,190,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(624,45,191,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(625,45,192,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(626,45,193,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(627,45,194,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(628,45,195,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(629,45,196,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(630,45,197,1,'2026-10-01 20:57:08','2026-10-01 20:57:08'),(631,45,198,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(632,45,199,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(633,45,200,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(634,45,201,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(635,45,202,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(636,45,203,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(637,45,204,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(638,45,205,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(639,45,206,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(640,45,207,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(641,45,208,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(642,45,209,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(643,45,210,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(644,45,211,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(645,45,212,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(646,45,213,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(647,45,214,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(648,45,215,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(649,45,216,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(650,45,217,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(651,45,218,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(652,45,219,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(653,45,221,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(654,45,224,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(655,45,225,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(656,45,226,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(657,45,228,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(658,45,229,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(659,45,230,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(660,45,231,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(661,45,232,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(662,45,233,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(663,45,234,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(664,45,235,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(665,45,236,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(666,45,237,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(667,45,239,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(668,45,240,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(669,45,241,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(670,45,242,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(671,45,243,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(672,45,244,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(673,45,245,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(674,45,246,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(675,45,247,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(676,45,248,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(677,45,249,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(678,45,250,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(679,45,251,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(680,45,252,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(681,45,253,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(682,45,254,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(683,45,255,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(684,45,256,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(685,45,258,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(686,45,259,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(687,45,260,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(688,45,261,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(689,45,262,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(690,45,263,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(691,45,264,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(692,45,265,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(693,45,266,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(694,45,267,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(695,45,268,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(696,45,269,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(697,45,270,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(698,45,271,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(699,45,272,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(700,45,273,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(701,45,274,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(702,45,275,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(703,45,276,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(704,45,277,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(705,45,278,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(706,45,279,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(707,45,280,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(708,45,281,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(709,45,282,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(710,45,283,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(711,45,284,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(712,45,285,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(713,45,286,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(714,45,287,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(715,45,288,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(716,45,289,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(717,45,290,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(718,45,291,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(719,45,292,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(720,45,293,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(721,45,294,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(722,45,295,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(723,45,296,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(724,45,297,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(725,45,298,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(726,45,299,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(727,45,300,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(728,45,301,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(729,45,302,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(730,45,303,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(731,45,304,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(732,45,305,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(733,45,306,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(734,45,307,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(735,45,311,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(736,45,312,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(737,45,313,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(738,45,314,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(739,45,315,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(740,45,316,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(741,45,317,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(742,45,318,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(743,45,319,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(744,45,320,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(745,45,321,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(746,45,322,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(747,45,323,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(748,45,324,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(749,45,325,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(750,45,326,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(751,45,327,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(752,45,328,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(753,45,329,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(754,45,330,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(755,45,331,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(756,45,332,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(757,45,333,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(758,45,334,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(759,45,336,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(760,45,337,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(761,45,338,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(762,45,339,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(763,45,340,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(764,45,341,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(765,45,342,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(766,45,343,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(767,45,344,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(768,45,345,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(769,45,346,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(770,45,347,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(771,45,348,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(772,45,349,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(773,45,350,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(774,45,351,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(775,45,352,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(776,45,353,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(777,45,354,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(778,45,355,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(779,45,356,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(780,45,357,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(781,45,358,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(782,45,359,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(783,45,360,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(784,45,361,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(785,45,362,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(786,45,363,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(787,45,364,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(788,45,365,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(789,45,366,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(790,45,367,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(791,45,368,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(792,45,369,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(793,45,370,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(794,45,371,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(795,45,372,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(796,45,373,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(797,45,374,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(798,45,375,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(799,45,376,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(800,45,377,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(801,45,378,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(802,45,379,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(803,45,380,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(804,45,381,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(805,45,382,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(806,45,383,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(807,45,384,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(808,45,385,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(809,45,386,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(810,45,387,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(811,45,388,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(812,45,389,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(813,45,390,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(814,45,391,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(815,45,392,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(816,45,393,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(817,45,394,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(818,45,395,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(819,45,396,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(820,45,397,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(821,45,398,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(822,45,399,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(823,45,400,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(824,45,401,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(825,45,402,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(826,45,403,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(827,45,404,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(828,45,405,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(829,45,406,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(830,45,407,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(831,45,408,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(832,45,409,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(833,45,410,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(834,45,411,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(835,45,412,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(836,45,413,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(837,45,414,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(838,45,415,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(839,45,416,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(840,45,417,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(841,45,418,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(842,45,419,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(843,45,420,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(844,45,421,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(845,45,422,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(846,45,423,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(847,45,424,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(848,45,425,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(849,45,426,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(850,45,427,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(851,45,428,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(852,45,429,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(853,45,430,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(854,45,431,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(855,45,432,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(856,45,433,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(857,45,434,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(858,45,435,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(859,45,436,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(860,45,437,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(861,45,438,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(862,45,439,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(863,45,440,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(864,45,441,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(865,45,443,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(866,45,445,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(867,45,447,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(868,45,448,1,'2026-10-01 20:57:09','2026-10-01 20:57:09'),(869,45,452,1,'2026-10-01 21:21:05','2026-10-01 21:21:05'),(870,45,453,1,'2026-10-02 21:43:57','2026-10-02 21:43:57'),(871,45,454,1,'2026-10-02 21:43:57','2026-10-02 21:43:57'),(872,45,455,1,'2026-10-02 21:43:57','2026-10-02 21:43:57');
/*!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,
  `code` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `landing_page` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=47 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 (45,'Super Admin','SUPER_ADMIN',NULL,NULL,1,'2026-05-19 02:20:01','2026-05-19 02:20:01'),(46,'cashier','CASHIER',NULL,NULL,1,'2026-05-19 05:49:48','2026-05-19 05:49:48');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sale_items`
--

DROP TABLE IF EXISTS `sale_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sale_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sale_id` bigint(20) unsigned NOT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `product_name` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `quantity` decimal(15,2) NOT NULL DEFAULT 1.00,
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_type` varchar(40) DEFAULT NULL,
  `tax_rate` decimal(8,2) NOT NULL DEFAULT 0.00,
  `tax_name` varchar(120) DEFAULT NULL,
  `line_total` decimal(15,2) NOT NULL DEFAULT 0.00,
  `uom` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_sale_items_sale_id_product_id` (`sale_id`,`product_id`),
  KEY `idx_sale_items_product_id_created_at` (`product_id`,`created_at`),
  KEY `idx_sale_items_shift_id` (`shift_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 `sale_items`
--

LOCK TABLES `sale_items` WRITE;
/*!40000 ALTER TABLE `sale_items` DISABLE KEYS */;
INSERT INTO `sale_items` VALUES (1,1,NULL,1,'sample','1',3.00,20.00,0.00,8.28,'standard',16.00,'VAT 16%',60.00,'Pcs','2026-10-02 21:56:17','2026-10-02 21:56:17');
/*!40000 ALTER TABLE `sale_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sales`
--

DROP TABLE IF EXISTS `sales`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `invoice_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `shift_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `sale_mode` varchar(255) NOT NULL DEFAULT 'retail',
  `sale_status` varchar(255) NOT NULL DEFAULT 'completed',
  `payment_status` varchar(255) NOT NULL DEFAULT 'paid',
  `merged_into_sale_id` bigint(20) unsigned DEFAULT NULL,
  `merged_bill_count` int(10) unsigned NOT NULL DEFAULT 1,
  `lpo_no` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `subtotal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `paid_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tendered_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `balance_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `change_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `sale_date` datetime NOT NULL,
  `note` text DEFAULT NULL,
  `voided_at` datetime DEFAULT NULL,
  `voided_by` bigint(20) unsigned DEFAULT NULL,
  `void_reason` text DEFAULT NULL,
  `room_id` bigint(20) unsigned DEFAULT NULL,
  `guest_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `deleted_by` bigint(20) unsigned DEFAULT NULL,
  `delete_reason` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sales_invoice_no_unique` (`invoice_no`),
  KEY `idx_sales_branch_id_sale_date` (`branch_id`,`sale_date`),
  KEY `idx_sales_branch_id_payment_status` (`branch_id`,`payment_status`),
  KEY `idx_sales_branch_id_sale_mode` (`branch_id`,`sale_mode`),
  KEY `idx_sales_branch_id_user_id` (`branch_id`,`user_id`),
  KEY `idx_sales_customer_id` (`customer_id`),
  KEY `idx_sales_shift_id` (`shift_id`),
  KEY `idx_sales_merged_into_sale_id` (`merged_into_sale_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 `sales`
--

LOCK TABLES `sales` WRITE;
/*!40000 ALTER TABLE `sales` DISABLE KEYS */;
INSERT INTO `sales` VALUES (1,'0001',2,3,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,'12345678',51.72,0.00,8.28,60.00,60.00,60.00,0.00,0.00,'2026-10-03 00:56:17','12345678',NULL,NULL,NULL,NULL,NULL,'2026-10-02 21:56:17','2026-10-02 21:56:17',NULL,NULL,NULL);
/*!40000 ALTER TABLE `sales` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shift_stock_counts`
--

DROP TABLE IF EXISTS `shift_stock_counts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shift_stock_counts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `shift_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `category_id` bigint(20) unsigned DEFAULT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `product_name` varchar(255) NOT NULL,
  `opening_stock` decimal(15,2) NOT NULL DEFAULT 0.00,
  `sold_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `sale_return_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `purchased_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `purchase_return_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `expected_closing_stock` decimal(15,2) NOT NULL DEFAULT 0.00,
  `counted_closing_stock` decimal(15,2) DEFAULT NULL,
  `variance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `selling_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `counted_by` bigint(20) unsigned DEFAULT NULL,
  `counted_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `shift_stock_counts_shift_id_product_id_unique` (`shift_id`,`product_id`),
  KEY `shift_stock_counts_shift_id_category_id_index` (`shift_id`,`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shift_stock_counts`
--

LOCK TABLES `shift_stock_counts` WRITE;
/*!40000 ALTER TABLE `shift_stock_counts` DISABLE KEYS */;
/*!40000 ALTER TABLE `shift_stock_counts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shifts`
--

DROP TABLE IF EXISTS `shifts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shifts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `shift_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `opened_at` datetime NOT NULL,
  `closed_at` datetime DEFAULT NULL,
  `opening_cash` decimal(15,2) NOT NULL DEFAULT 0.00,
  `closing_cash` decimal(15,2) DEFAULT NULL,
  `expected_cash` decimal(15,2) NOT NULL DEFAULT 0.00,
  `cash_difference` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `opening_note` text DEFAULT NULL,
  `closing_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `shifts_shift_no_unique` (`shift_no`),
  KEY `idx_shifts_branch_id_opened_at` (`branch_id`,`opened_at`),
  KEY `idx_shifts_branch_id_status` (`branch_id`,`status`),
  KEY `idx_shifts_user_id_status` (`user_id`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shifts`
--

LOCK TABLES `shifts` WRITE;
/*!40000 ALTER TABLE `shifts` DISABLE KEYS */;
/*!40000 ALTER TABLE `shifts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sms_campaigns`
--

DROP TABLE IF EXISTS `sms_campaigns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sms_campaigns` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `campaign_no` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `sms_template_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `recipient_source` varchar(255) NOT NULL DEFAULT 'manual',
  `message` text NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `recipient_count` int(10) unsigned NOT NULL DEFAULT 0,
  `sent_count` int(10) unsigned NOT NULL DEFAULT 0,
  `delivered_count` int(10) unsigned NOT NULL DEFAULT 0,
  `failed_count` int(10) unsigned NOT NULL DEFAULT 0,
  `sms_units` int(10) unsigned NOT NULL DEFAULT 0,
  `estimated_cost` decimal(14,2) NOT NULL DEFAULT 0.00,
  `scheduled_at` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sms_campaigns_campaign_no_unique` (`campaign_no`),
  KEY `sms_campaigns_sms_template_id_foreign` (`sms_template_id`),
  KEY `sms_campaigns_user_id_foreign` (`user_id`),
  KEY `idx_sms_campaigns_status_created_at` (`status`,`created_at`),
  CONSTRAINT `sms_campaigns_sms_template_id_foreign` FOREIGN KEY (`sms_template_id`) REFERENCES `sms_templates` (`id`) ON DELETE SET NULL,
  CONSTRAINT `sms_campaigns_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `sms_campaigns`
--

LOCK TABLES `sms_campaigns` WRITE;
/*!40000 ALTER TABLE `sms_campaigns` DISABLE KEYS */;
/*!40000 ALTER TABLE `sms_campaigns` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sms_in`
--

DROP TABLE IF EXISTS `sms_in`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sms_in` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sms_text` text NOT NULL,
  `sender_number` varchar(100) DEFAULT NULL,
  `sent_dt` datetime DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `processing_status` varchar(30) NOT NULL DEFAULT 'pending',
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sms_in_branch_id_foreign` (`branch_id`),
  KEY `sms_in_sender_number_index` (`sender_number`),
  KEY `sms_in_sent_dt_index` (`sent_dt`),
  KEY `sms_in_processing_status_index` (`processing_status`),
  CONSTRAINT `sms_in_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`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 `sms_in`
--

LOCK TABLES `sms_in` WRITE;
/*!40000 ALTER TABLE `sms_in` DISABLE KEYS */;
/*!40000 ALTER TABLE `sms_in` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sms_recipients`
--

DROP TABLE IF EXISTS `sms_recipients`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sms_recipients` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sms_campaign_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `phone` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `provider_message_id` varchar(255) DEFAULT NULL,
  `failure_reason` text DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `delivered_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sms_recipients_customer_id_foreign` (`customer_id`),
  KEY `idx_sms_recipients_sms_campaign_id_status` (`sms_campaign_id`,`status`),
  CONSTRAINT `sms_recipients_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `sms_recipients_sms_campaign_id_foreign` FOREIGN KEY (`sms_campaign_id`) REFERENCES `sms_campaigns` (`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 `sms_recipients`
--

LOCK TABLES `sms_recipients` WRITE;
/*!40000 ALTER TABLE `sms_recipients` DISABLE KEYS */;
/*!40000 ALTER TABLE `sms_recipients` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sms_templates`
--

DROP TABLE IF EXISTS `sms_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sms_templates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sms_templates`
--

LOCK TABLES `sms_templates` WRITE;
/*!40000 ALTER TABLE `sms_templates` DISABLE KEYS */;
/*!40000 ALTER TABLE `sms_templates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `stock_taking_items`
--

DROP TABLE IF EXISTS `stock_taking_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stock_taking_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `stock_taking_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned DEFAULT NULL,
  `category_id` bigint(20) unsigned DEFAULT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `product_name` varchar(255) NOT NULL,
  `available_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `buying_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `selling_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `actual_quantity` decimal(15,2) DEFAULT NULL,
  `difference_quantity` decimal(15,2) NOT NULL DEFAULT 0.00,
  `updated_by` bigint(20) unsigned DEFAULT NULL,
  `counted_at` timestamp NULL DEFAULT NULL,
  `adjusted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `stock_taking_items_stock_taking_id_product_id_unique` (`stock_taking_id`,`product_id`),
  KEY `stock_taking_items_product_id_foreign` (`product_id`),
  KEY `stock_taking_items_category_id_foreign` (`category_id`),
  KEY `stock_taking_items_updated_by_foreign` (`updated_by`),
  KEY `idx_stock_taking_items_stock_taking_id_category_id` (`stock_taking_id`,`category_id`),
  CONSTRAINT `stock_taking_items_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_taking_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_taking_items_stock_taking_id_foreign` FOREIGN KEY (`stock_taking_id`) REFERENCES `stock_takings` (`id`) ON DELETE CASCADE,
  CONSTRAINT `stock_taking_items_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`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 `stock_taking_items`
--

LOCK TABLES `stock_taking_items` WRITE;
/*!40000 ALTER TABLE `stock_taking_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_taking_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `stock_takings`
--

DROP TABLE IF EXISTS `stock_takings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stock_takings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `stock_take_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `started_at` timestamp NULL DEFAULT NULL,
  `closed_at` timestamp NULL DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `stock_takings_stock_take_no_unique` (`stock_take_no`),
  KEY `stock_takings_user_id_foreign` (`user_id`),
  KEY `idx_stock_takings_branch_id_status` (`branch_id`,`status`),
  KEY `idx_stock_takings_branch_id_started_at` (`branch_id`,`started_at`),
  CONSTRAINT `stock_takings_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_takings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `stock_takings`
--

LOCK TABLES `stock_takings` WRITE;
/*!40000 ALTER TABLE `stock_takings` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_takings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `stock_transfer_items`
--

DROP TABLE IF EXISTS `stock_transfer_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stock_transfer_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `stock_transfer_id` bigint(20) unsigned NOT NULL,
  `source_product_id` bigint(20) unsigned NOT NULL,
  `destination_product_id` bigint(20) unsigned DEFAULT NULL,
  `product_name` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `source_stock_before` decimal(15,2) NOT NULL DEFAULT 0.00,
  `source_stock_after` decimal(15,2) NOT NULL DEFAULT 0.00,
  `destination_stock_before` decimal(15,2) NOT NULL DEFAULT 0.00,
  `destination_stock_after` decimal(15,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_transfer_items_source_product_id_foreign` (`source_product_id`),
  KEY `stock_transfer_items_destination_product_id_foreign` (`destination_product_id`),
  KEY `idx_stock_transfer_items_stock_transfer_id_source_product_id` (`stock_transfer_id`,`source_product_id`),
  CONSTRAINT `stock_transfer_items_destination_product_id_foreign` FOREIGN KEY (`destination_product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_transfer_items_source_product_id_foreign` FOREIGN KEY (`source_product_id`) REFERENCES `products` (`id`),
  CONSTRAINT `stock_transfer_items_stock_transfer_id_foreign` FOREIGN KEY (`stock_transfer_id`) REFERENCES `stock_transfers` (`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 `stock_transfer_items`
--

LOCK TABLES `stock_transfer_items` WRITE;
/*!40000 ALTER TABLE `stock_transfer_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_transfer_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `stock_transfers`
--

DROP TABLE IF EXISTS `stock_transfers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stock_transfers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `transfer_no` varchar(255) NOT NULL,
  `from_branch_id` bigint(20) unsigned NOT NULL,
  `to_branch_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `transfer_date` datetime NOT NULL,
  `status` enum('completed','cancelled') NOT NULL DEFAULT 'completed',
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `stock_transfers_transfer_no_unique` (`transfer_no`),
  KEY `stock_transfers_user_id_foreign` (`user_id`),
  KEY `idx_stock_transfers_from_branch_id_transfer_date` (`from_branch_id`,`transfer_date`),
  KEY `idx_stock_transfers_to_branch_id_transfer_date` (`to_branch_id`,`transfer_date`),
  KEY `idx_stock_transfers_status_transfer_date` (`status`,`transfer_date`),
  CONSTRAINT `stock_transfers_from_branch_id_foreign` FOREIGN KEY (`from_branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `stock_transfers_to_branch_id_foreign` FOREIGN KEY (`to_branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `stock_transfers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `stock_transfers`
--

LOCK TABLES `stock_transfers` WRITE;
/*!40000 ALTER TABLE `stock_transfers` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_transfers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sub_categories`
--

DROP TABLE IF EXISTS `sub_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sub_categories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `category_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sub_categories_code_unique` (`code`),
  KEY `sub_categories_category_id_foreign` (`category_id`),
  KEY `idx_sub_categories_branch_id_category_id` (`branch_id`,`category_id`),
  KEY `idx_sub_categories_branch_id_is_active` (`branch_id`,`is_active`),
  CONSTRAINT `sub_categories_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `sub_categories_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`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 `sub_categories`
--

LOCK TABLES `sub_categories` WRITE;
/*!40000 ALTER TABLE `sub_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `sub_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `supplier_opening_balance_payments`
--

DROP TABLE IF EXISTS `supplier_opening_balance_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `supplier_opening_balance_payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `supplier_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `payment_method_id` bigint(20) unsigned NOT NULL,
  `paid_by` bigint(20) unsigned DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL,
  `reference_no` varchar(255) DEFAULT NULL,
  `payment_date` datetime NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_opening_balance_payments_payment_method_id_foreign` (`payment_method_id`),
  KEY `supplier_opening_balance_payments_paid_by_foreign` (`paid_by`),
  KEY `supplier_ob_payments_supplier_date_idx` (`supplier_id`,`payment_date`),
  KEY `supplier_ob_payments_branch_date_idx` (`branch_id`,`payment_date`),
  CONSTRAINT `supplier_opening_balance_payments_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `supplier_opening_balance_payments_paid_by_foreign` FOREIGN KEY (`paid_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `supplier_opening_balance_payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`),
  CONSTRAINT `supplier_opening_balance_payments_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `supplier_opening_balance_payments`
--

LOCK TABLES `supplier_opening_balance_payments` WRITE;
/*!40000 ALTER TABLE `supplier_opening_balance_payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `supplier_opening_balance_payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `suppliers`
--

DROP TABLE IF EXISTS `suppliers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `suppliers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `opening_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `opening_balance_date` date DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_suppliers_branch_id_is_active` (`branch_id`,`is_active`),
  KEY `idx_suppliers_phone` (`phone`),
  KEY `idx_suppliers_name` (`name`),
  CONSTRAINT `suppliers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`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 `suppliers`
--

LOCK TABLES `suppliers` WRITE;
/*!40000 ALTER TABLE `suppliers` DISABLE KEYS */;
INSERT INTO `suppliers` VALUES (1,2,'Default',NULL,NULL,NULL,0.00,NULL,1,'2026-09-09 22:03:40','2026-09-14 18:20:44');
/*!40000 ALTER TABLE `suppliers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `system_modules`
--

DROP TABLE IF EXISTS `system_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `system_modules` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_core` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `system_modules_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `system_modules`
--

LOCK TABLES `system_modules` WRITE;
/*!40000 ALTER TABLE `system_modules` DISABLE KEYS */;
INSERT INTO `system_modules` VALUES (1,'Dashboard','dashboard','fas fa-home',NULL,1,1,1,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(2,'Retail POS','retail_pos','fas fa-cash-register',NULL,0,1,2,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(3,'Wholesale','wholesale','fas fa-boxes',NULL,0,1,3,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(4,'Products','products','fas fa-box',NULL,0,1,12,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(5,'Categories','categories','fas fa-tags',NULL,0,1,14,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(6,'Restaurant / Bar','restaurant_bar','fas fa-utensils',NULL,0,1,4,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(7,'Accommodation','accommodation','fas fa-bed',NULL,0,1,5,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(8,'Inventory','inventory','fas fa-warehouse',NULL,0,1,13,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(9,'Accounting','accounting','fas fa-calculator',NULL,0,1,18,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(10,'Reports','reports','fas fa-chart-bar',NULL,0,1,17,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(11,'Bulk SMS','bulk_sms','fas fa-sms',NULL,0,1,20,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(12,'Users','users','fas fa-users',NULL,0,1,28,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(13,'Settings','settings','fas fa-cogs',NULL,1,1,29,'2026-04-15 11:36:10','2026-09-22 19:55:50'),(14,'Human Resource','human_resource','fas fa-user-tie',NULL,0,1,21,'2026-05-13 04:01:43','2026-09-22 19:55:50'),(15,'Sales','sales','fas fa-receipt',NULL,0,1,6,'2026-09-05 17:23:34','2026-09-22 19:55:50'),(16,'Purchases','purchases','fas fa-shopping-cart','Record and view stock purchases',0,1,10,'2026-09-08 13:55:26','2026-09-22 19:55:50'),(17,'Expenses','expenses','fas fa-money-bill-wave',NULL,0,1,11,'2026-09-09 13:33:29','2026-09-22 19:55:50'),(18,'Departments','departments','fas fa-sitemap',NULL,0,1,19,'2026-09-09 13:55:03','2026-09-22 19:55:50'),(20,'Shift Management','shift-management','fas fa-clock',NULL,0,1,27,'2026-09-09 15:15:40','2026-09-22 19:55:50'),(21,'Customers','customers','fas fa-user-friends',NULL,0,1,8,'2026-09-09 21:27:16','2026-09-22 19:55:50'),(22,'Suppliers','suppliers','fas fa-truck',NULL,0,1,9,'2026-09-09 21:27:17','2026-09-22 19:55:50'),(23,'Task Management','task-management','fas fa-tasks','Assign, track, review, and report staff tasks.',0,1,22,'2026-09-11 17:31:30','2026-09-22 19:55:50'),(24,'Quotations','quotations','fas fa-file-invoice','Create, print, and convert quotations to invoices.',0,1,7,'2026-09-11 20:04:38','2026-09-22 19:55:50'),(25,'Stock Transfers','stock-transfers','fas fa-exchange-alt','Transfer stock from one branch to another.',0,1,16,'2026-09-14 16:07:44','2026-09-22 19:55:50'),(26,'Deals Management','deals-management','fas fa-handshake','Track leads, deals, follow-ups, quotations and customer conversion activity.',0,1,23,'2026-09-14 19:41:58','2026-09-22 19:55:50'),(27,'Call Centre','call-centre','fas fa-phone-alt','Record calls, caller details, support issues, inquiries, complaints and follow-ups.',0,1,24,'2026-09-15 10:21:21','2026-09-22 19:55:50'),(28,'Damaged Products','damaged-products','fas fa-exclamation-triangle','Record damaged stock and reduce inventory quantities.',0,1,15,'2026-09-15 11:11:24','2026-09-22 19:55:50'),(29,'Project Management','project-management','fas fa-project-diagram','Plan projects, milestones, delivery tasks, budgets, and status updates.',0,1,25,'2026-09-22 17:15:56','2026-09-22 19:55:50'),(30,'Biometric Attendance','biometric-attendance','fas fa-fingerprint','Connect attendance devices and reconcile employee clocking.',0,1,26,'2026-09-22 17:15:56','2026-09-22 19:55:50'),(31,'Leads Management','leads-management','fas fa-user-plus','Capture, qualify, assign and convert prospects into deals.',0,1,20,'2026-09-29 12:16:32','2026-09-29 12:16:32');
/*!40000 ALTER TABLE `system_modules` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `system_settings`
--

DROP TABLE IF EXISTS `system_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `system_settings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `group` varchar(255) DEFAULT NULL,
  `key` varchar(255) NOT NULL,
  `value` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `system_settings_key_unique` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `system_settings`
--

LOCK TABLES `system_settings` WRITE;
/*!40000 ALTER TABLE `system_settings` DISABLE KEYS */;
INSERT INTO `system_settings` VALUES (1,'system','login_mode','touch_pin','2026-05-19 14:42:32','2026-10-03 12:53:06'),(2,'system','pos_mode','retail','2026-05-19 14:42:32','2026-10-01 15:50:07'),(3,'tax','vat_enabled','yes','2026-05-19 14:42:32','2026-05-19 14:42:32'),(4,'tax','vat_rate','16','2026-05-19 14:42:32','2026-05-19 14:42:32'),(5,'shift','shift_start_time','06:00','2026-05-19 14:42:32','2026-10-03 12:53:06'),(6,'shift','shift_end_time','18:00','2026-05-19 14:42:32','2026-10-03 12:53:06'),(7,'etims','etims_enabled','yes','2026-05-19 14:42:32','2026-10-02 21:54:12'),(8,'etims','hs_code_enabled','no','2026-05-19 14:42:32','2026-05-19 14:42:32'),(9,'restaurant','auto_logout_after_order','no','2026-05-19 14:42:32','2026-10-01 20:59:58'),(10,'invoice','print_mode','receipt_only','2026-05-19 14:42:32','2026-09-14 19:05:56'),(11,'system','default_landing_page','dashboard','2026-05-25 08:56:54','2026-10-01 20:16:26'),(12,'shift','shift_start_day','today','2026-05-25 08:56:54','2026-05-25 08:56:54'),(13,'shift','shift_end_day','today','2026-05-25 08:56:54','2026-09-09 15:52:55'),(14,'shift','allow_shift_management','no','2026-05-25 08:56:54','2026-09-22 20:09:14'),(15,'invoice','receipt_size','80','2026-09-05 16:40:49','2026-09-14 19:05:56'),(16,'sales','sales_default_entries','100','2026-09-05 21:23:20','2026-10-01 15:50:07'),(17,'localization','app_timezone','Africa/Nairobi','2026-09-05 21:23:20','2026-09-05 21:23:20'),(18,'localization','currency_code','KES','2026-09-05 21:23:20','2026-09-05 21:35:52'),(19,'localization','currency_exchange_rate','1','2026-09-05 21:23:20','2026-09-05 21:39:12'),(20,'restaurant','restaurant_print_mode','bill_kitchen_order','2026-09-06 09:57:28','2026-10-01 20:59:58'),(21,'restaurant','restaurant_receipt_printer','','2026-09-06 09:57:28','2026-09-06 09:57:28'),(22,'restaurant','restaurant_bill_printer','','2026-09-06 09:57:28','2026-09-06 09:57:28'),(23,'restaurant','restaurant_kitchen_printer','','2026-09-06 09:57:28','2026-09-06 09:57:28'),(24,'restaurant','restaurant_allow_item_note','0','2026-09-06 15:19:48','2026-09-07 07:20:58'),(25,'restaurant','restaurant_enable_tables','1','2026-09-07 07:18:11','2026-10-01 20:59:58'),(26,'restaurant','restaurant_show_customer_name','0','2026-09-07 08:07:07','2026-09-07 08:08:01'),(27,'restaurant','restaurant_show_keyboard','0','2026-09-07 08:07:07','2026-09-07 08:07:07'),(28,'restaurant','restaurant_show_numbers','1','2026-09-07 08:07:07','2026-10-01 20:59:58'),(29,'accommodation','accommodation_hotel_name','JL MOTEL','2026-09-09 22:18:11','2026-09-09 22:18:11'),(30,'accommodation','accommodation_hotel_phone','0712345678','2026-09-09 22:18:11','2026-09-09 22:18:11'),(31,'accommodation','accommodation_hotel_email','jl@gmail.com','2026-09-09 22:18:11','2026-09-09 22:18:11'),(32,'accommodation','accommodation_hotel_address','Kakamega','2026-09-09 22:18:11','2026-09-09 22:18:11'),(33,'accommodation','accommodation_expected_rooms','10','2026-09-09 22:18:11','2026-09-09 22:18:11'),(34,'mpesa','mpesa_environment','sandbox','2026-09-14 10:45:37','2026-09-14 10:45:37'),(35,'mpesa','mpesa_shortcode','7890','2026-09-14 10:45:37','2026-09-14 10:45:37'),(36,'mpesa','mpesa_shortcode_type','paybill','2026-09-14 10:45:37','2026-09-14 10:45:37'),(37,'mpesa','mpesa_account_reference','','2026-09-14 10:45:37','2026-09-14 10:45:37'),(38,'mpesa','mpesa_stk_callback_url','http://localhost/jevapos.com/public/mpesa/callbacks/stk','2026-09-14 10:45:37','2026-09-14 10:45:37'),(39,'mpesa','mpesa_c2b_validation_url','http://localhost/jevapos.com/public/mpesa/callbacks/c2b/validation','2026-09-14 10:45:37','2026-09-14 10:45:37'),(40,'mpesa','mpesa_c2b_confirmation_url','http://localhost/jevapos.com/public/mpesa/callbacks/c2b/confirmation','2026-09-14 10:45:37','2026-09-14 10:45:37'),(41,'mpesa','mpesa_b2c_result_url','http://localhost/jevapos.com/public/mpesa/callbacks/b2c/result','2026-09-14 10:45:37','2026-09-14 10:45:37'),(42,'mpesa','mpesa_b2c_timeout_url','http://localhost/jevapos.com/public/mpesa/callbacks/b2c/timeout','2026-09-14 10:45:37','2026-09-14 10:45:37'),(43,'mpesa','mpesa_stk_enabled','no','2026-09-14 10:45:37','2026-09-14 10:45:37'),(44,'mpesa','mpesa_c2b_enabled','no','2026-09-14 10:45:37','2026-09-14 10:45:37'),(45,'mpesa','mpesa_b2c_enabled','no','2026-09-14 10:45:37','2026-09-14 10:45:37'),(46,'mpesa','mpesa_consumer_key','eyJpdiI6Ii8zZUxKQm5DUGFkU0dCbzBzWG1VNEE9PSIsInZhbHVlIjoidGczZzY2a0p3c0lwbndQOGpUKzgvQT09IiwibWFjIjoiNzIwMzMzMTE4OWFjYTk4NTY3NmVhNzdlMzdkNDhmYjVlZjU3N2M4Mjc1OGI2ZTcxZGU0MzgwMzFiYzhiNjY3OCIsInRhZyI6IiJ9','2026-09-14 10:45:37','2026-09-14 10:45:37'),(47,'mpesa','mpesa_consumer_secret','eyJpdiI6Ii9scXptNVJOcG80M3pTalBLeE4zNnc9PSIsInZhbHVlIjoicjdsL3RBcDdBVTVDME1jU01aUHU1Zz09IiwibWFjIjoiMjYzNDRkYmJlZTNlYzVkYjc1OWFiNDU3ZDJjZDc4ZGE4NzM5NDEwNjQ2ZWVlZTYyNWMwNmE1YWVhNGRiNGE5NCIsInRhZyI6IiJ9','2026-09-14 10:45:37','2026-09-14 10:45:37'),(48,'mpesa','mpesa_passkey','eyJpdiI6InpUdGVGU2pJS1FteXBjdVZaRHdYQkE9PSIsInZhbHVlIjoiTUFYSlovWlk5blo4clAzZmMzZU42QT09IiwibWFjIjoiZGMzMGYxOTJiNmJiZWJkMDk5YmY4NzdlODA3Y2MzYjNiZWM1OTcxZGY5OGFiYTJhMmEzM2NjMzg4ZTBhZTY5YyIsInRhZyI6IiJ9','2026-09-14 10:45:37','2026-09-14 10:45:37'),(49,'invoice','invoice_title','Receipt / Invoice','2026-09-14 19:05:56','2026-09-14 19:05:56'),(50,'invoice','receipt_footer','Thank you.','2026-09-14 19:05:56','2026-09-14 19:05:56'),(51,'invoice','show_branch_details_on_invoice','yes','2026-09-14 19:05:56','2026-09-14 19:05:56'),(52,'invoice','show_customer_details_on_invoice','yes','2026-09-14 19:05:56','2026-09-14 19:05:56'),(53,'invoice','show_tax_summary_on_invoice','yes','2026-09-14 19:05:56','2026-09-14 19:05:56'),(54,'invoice','show_cashier_name_on_invoice','yes','2026-09-14 19:05:56','2026-09-14 19:05:56'),(55,'invoice','cash_receipt_template','thermal','2026-09-14 19:30:09','2026-09-14 19:30:09'),(56,'invoice','unpaid_invoice_template','a4','2026-09-14 19:30:09','2026-09-14 19:30:09'),(57,'invoice','kitchen_order_template','thermal_no_prices','2026-09-14 19:30:09','2026-09-14 19:30:09'),(58,'invoice','delivery_note_template','a4_no_prices','2026-09-14 19:30:09','2026-09-14 19:30:09'),(59,'invoice','quotation_template','a4','2026-09-14 19:30:09','2026-09-14 19:30:09'),(60,'invoice','grn_template','a4','2026-09-14 19:30:09','2026-09-14 19:30:09'),(61,'invoice','credit_note_template','a4','2026-09-14 19:30:09','2026-09-14 19:30:09'),(62,'invoice','debit_note_template','a4','2026-09-14 19:30:09','2026-09-14 19:30:09'),(63,'stock','allow_overselling','no','2026-09-15 11:11:24','2026-09-15 11:11:24'),(64,'bulk_sms','sms_provider','africastalking','2026-09-15 11:16:07','2026-09-15 11:16:07'),(65,'bulk_sms','sms_environment','sandbox','2026-09-15 11:16:07','2026-09-15 11:16:07'),(66,'bulk_sms','sms_provider_username',NULL,'2026-09-15 11:16:07','2026-09-15 11:16:07'),(67,'bulk_sms','sms_provider_api_key',NULL,'2026-09-15 11:16:07','2026-09-15 11:16:07'),(68,'bulk_sms','sms_sender_id',NULL,'2026-09-15 11:16:07','2026-09-15 11:16:07'),(69,'bulk_sms','sms_default_country_code','+254','2026-09-15 11:16:07','2026-09-15 11:16:07'),(70,'bulk_sms','sms_estimated_cost_per_unit','0','2026-09-15 11:16:07','2026-09-15 11:16:07'),(71,'bulk_sms','sms_balance',NULL,'2026-09-15 11:16:07','2026-09-15 11:16:07'),(72,'license','license_generated_serial','JEV-EFDA-MYR2','2026-09-15 13:11:14','2026-09-15 13:11:14'),(73,'license','license_status','active','2026-09-15 13:25:39','2026-09-15 13:25:39'),(74,'license','license_key','JVL-eyJ2IjoyLCJhY3RpdmF0aW9uX25vIjoiQUNUMDAwNSIsImNsaWVudF9uYW1lIjoiSkVWQVRFQ0giLCJjb21wdXRlcl9zZXJpYWwiOiJTUlYtNjk1NDNCMkJGOUI4OUJGMkI1NjgiLCJpbnN0YWxsYXRpb25faWQiOiJKRVYtRUZEQS1NWVIyIiwiYmluZGluZ190eXBlIjoic2VydmVyIiwiYmluZGluZ192YWx1ZSI6InNydi02OTU0M2IyYmY5Yjg5YmYyYjU2OCIsImV4cGlyZXNfYXQiOm51bGwsImlzc3VlZF9hdCI6IjIwMjYtMDktMjYgMDE6MjY6MTUifQ.WORPv6HV0MUI_jPzjA4gWWqi1cAhotOhraen9E1uwsN1mK3v-1lPtJ_JcajIIQzYEbQJAw_nNy9XioiHbMQ86Roi5v7qbfuzVDtsuLZoMfDOk0M-1PZFJ9SS0Uy0zhcQaPKZFlyYLSeUo2pgKSz4Wgt-2ttDMig_bd2YaALxdEVujq5XXVMPVDVEBxc_knisCuKqw8trTpxIl0baqv18QzpJYc_MFUC7wTFQ7oUZ95zv9MSfl9XhLRvJfveRRDqedpqfuBnHskA3Udh5SQaOYO-14ey1gntS59j6sWLSiQE6lpIG2XR31Qt6SI00Q7KNcr-DPHMgq7JfvSBKZsmCrS1o5KOi76m1le7yXWJgvt6E8JkMEjvfsl1lFjvfjzqb1xtMqiCe8fqUcXzCeFYrBULNEulk7ZUR2_eeXhYRmCDuwAWv32SMu4F1vjYAigsHVz5VEYtrWIdquO8ChcUQLH2HYCdVtWnD3QSkWCVRw_vVM7CahVgRRUfE_g9i5cEk','2026-09-15 13:25:39','2026-09-25 22:26:15'),(75,'license','license_activation_no','ACT0005','2026-09-15 13:25:39','2026-09-25 22:26:15'),(76,'license','license_client_name','JEVATECH','2026-09-15 13:25:39','2026-09-16 11:15:38'),(77,'license','license_expires_at',NULL,'2026-09-15 13:25:39','2026-09-16 11:21:31'),(78,'license','license_contact_person','VALENTINE','2026-09-16 11:15:38','2026-09-16 11:15:38'),(79,'license','license_technician_name','VALENTINE','2026-09-16 11:15:38','2026-09-16 11:15:38'),(80,'license','license_phone','0741479897','2026-09-16 11:15:38','2026-09-16 11:15:38'),(81,'license','license_computer_serial','SRV-69543B2BF9B89BF2B568','2026-09-16 11:15:38','2026-09-25 22:26:15'),(82,'backup','backup_directory','C:\\JEVAPOS_BACKUPS','2026-09-16 13:05:06','2026-09-16 13:05:06'),(83,'backup','mysqldump_path','E:\\xampp\\mysql\\bin\\mysqldump.exe','2026-09-16 13:05:06','2026-09-16 13:05:06'),(84,'backup','backup_retention_days','30','2026-09-16 13:05:06','2026-09-16 13:05:06'),(85,'website','website_integration_key','eyJpdiI6InVDZWdHQkR1L2JlNGNyOWU3MkRlRHc9PSIsInZhbHVlIjoidW9WbE9MTWJmM3B5Mmc1V2plcnp4aUlENXJ6b3ZaUUNObkxwS1VOZXowc3FqL0pqUnRWNmxOQnp4WnB6WUhuTEJhVjNjVVdqRGZnbWZHRW9JcGhDeXBEU3pTN2RyRHRHenRoWXllS0hBbHc9IiwibWFjIjoiZjlhNGUxNzQ4NTExMmQzMDEwMzM1YjZmZWExY2ZlOWVmZDUwYjkyMTk0MTk1Mjk0NmI0ZjIxZGY3MmVkOTc0MyIsInRhZyI6IiJ9','2026-09-21 18:12:27','2026-09-21 18:12:27'),(86,'system','default_entries','100','2026-09-25 19:38:13','2026-10-01 15:50:07'),(87,'invoice','business_tax_pin','','2026-09-25 19:39:34','2026-09-25 19:39:34'),(88,'invoice','show_customer_pin_on_invoice','yes','2026-09-25 19:39:34','2026-09-25 19:39:34'),(89,'invoice','show_discount_on_invoice','yes','2026-09-25 19:39:34','2026-09-25 19:39:34'),(90,'sales','pos_duplicate_product_behavior','increase_quantity','2026-09-25 20:49:28','2026-09-25 20:49:28'),(91,'license','license_installation_id','JEV-EFDA-MYR2','2026-09-25 22:26:15','2026-09-25 22:26:15'),(92,'license','license_binding_type','server','2026-09-25 22:26:15','2026-09-25 22:26:15'),(93,'license','license_binding_value','srv-69543b2bf9b89bf2b568','2026-09-25 22:26:15','2026-09-25 22:26:15'),(94,'restaurant','restaurant_print_agent_enabled','no','2026-09-30 18:47:59','2026-09-30 18:47:59'),(95,'restaurant','restaurant_print_agent_server_url','http://localhost/jevapos.com/public/api','2026-09-30 18:47:59','2026-09-30 18:47:59'),(96,'restaurant','restaurant_bill_print_station_id','','2026-09-30 18:47:59','2026-09-30 18:47:59'),(97,'restaurant','restaurant_bill_printer_name','','2026-09-30 18:47:59','2026-09-30 18:47:59'),(98,'restaurant','restaurant_default_order_print_station_id','','2026-09-30 18:47:59','2026-09-30 18:47:59'),(99,'restaurant','restaurant_default_order_printer_name','','2026-09-30 18:47:59','2026-09-30 18:47:59'),(100,'security','idle_timeout_minutes','30','2026-10-01 15:50:07','2026-10-01 15:50:07'),(101,'accounting','transaction_edit_days','30','2026-10-01 15:50:07','2026-10-01 15:50:07'),(102,'etims','etims_mode','demo','2026-10-02 21:54:12','2026-10-02 21:54:12'),(103,'etims','etims_provider','jevapos_demo','2026-10-02 21:54:12','2026-10-02 21:54:12'),(104,'etims','etims_auto_submit','yes','2026-10-02 21:54:12','2026-10-02 21:54:12'),(105,'etims','etims_require_hs_code','no','2026-10-02 21:54:12','2026-10-02 21:54:12'),(106,'etims','etims_show_receipt_details','yes','2026-10-02 21:54:12','2026-10-02 21:54:12'),(107,'etims','etims_demo_verification_base_url','http://localhost','2026-10-02 21:54:12','2026-10-02 21:54:12');
/*!40000 ALTER TABLE `system_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `task_categories`
--

DROP TABLE IF EXISTS `task_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `task_categories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `default_measurement_mode` varchar(255) NOT NULL DEFAULT 'number',
  `default_target_value` decimal(12,2) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `task_categories_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `task_categories`
--

LOCK TABLES `task_categories` WRITE;
/*!40000 ALTER TABLE `task_categories` DISABLE KEYS */;
INSERT INTO `task_categories` VALUES (1,'Cold Calls','Daily outbound prospecting calls.','number',10.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(2,'Social Media Posts','Facebook, Instagram, TikTok, X and other posts.','number',1.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(3,'Physical Marketing','Field visits and direct marketing.','number',1.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(4,'Follow Ups','Client and prospect follow-up contacts.','number',5.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(5,'Existing Clients','Existing client check-ins and relationship tasks.','number',1.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(6,'Emails Sent','Sales, support or operational emails sent.','number',1.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(7,'Emails Received','Important emails received and handled.','number',1.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(8,'Support Done','Support work completed for clients.','number',1.00,1,'2026-09-11 17:31:30','2026-09-11 17:31:30'),(9,'Contact Search','New business contact research.','number',1.00,1,'2026-09-11 17:31:31','2026-09-11 17:31:31'),(10,'Images Created','Marketing or client image design work.','number',1.00,1,'2026-09-11 17:31:31','2026-09-11 17:31:31'),(12,'Quotations Sent','Quotations prepared and sent.','number',1.00,1,'2026-09-11 17:31:31','2026-09-11 17:31:31'),(13,'Invoices Sent','Invoices prepared and sent.','number',1.00,1,'2026-09-11 17:31:31','2026-09-11 17:31:31'),(14,'Demos Done','Product or service demos completed.','number',1.00,1,'2026-09-11 17:31:31','2026-09-11 17:31:31'),(15,'Installations','Client installations or setup work.','number',1.00,1,'2026-09-11 17:31:31','2026-09-11 17:31:31'),(16,'Blogs','Blog posts written or published.','number',2.00,1,'2026-09-11 17:31:31','2026-09-11 17:31:31');
/*!40000 ALTER TABLE `task_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `task_progress_updates`
--

DROP TABLE IF EXISTS `task_progress_updates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `task_progress_updates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `task_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `achieved_value` decimal(12,2) DEFAULT NULL,
  `progress_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_progress_updates_task_id_foreign` (`task_id`),
  KEY `task_progress_updates_user_id_foreign` (`user_id`),
  CONSTRAINT `task_progress_updates_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE,
  CONSTRAINT `task_progress_updates_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 `task_progress_updates`
--

LOCK TABLES `task_progress_updates` WRITE;
/*!40000 ALTER TABLE `task_progress_updates` DISABLE KEYS */;
/*!40000 ALTER TABLE `task_progress_updates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tasks`
--

DROP TABLE IF EXISTS `tasks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasks` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `task_no` varchar(255) NOT NULL,
  `task_category_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `department_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_to_id` bigint(20) unsigned DEFAULT NULL,
  `assigned_by_id` bigint(20) unsigned DEFAULT NULL,
  `supervisor_id` bigint(20) unsigned DEFAULT NULL,
  `task_type` varchar(255) NOT NULL DEFAULT 'specific',
  `subject` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `priority` varchar(255) NOT NULL DEFAULT 'normal',
  `status` varchar(255) NOT NULL DEFAULT 'new',
  `measurement_mode` varchar(255) NOT NULL DEFAULT 'number',
  `target_value` decimal(12,2) DEFAULT NULL,
  `achieved_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `start_date` datetime DEFAULT NULL,
  `due_date` datetime DEFAULT NULL,
  `sms_action` varchar(255) NOT NULL DEFAULT 'none',
  `completed_at` datetime DEFAULT NULL,
  `verified_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tasks_task_no_unique` (`task_no`),
  KEY `tasks_task_category_id_foreign` (`task_category_id`),
  KEY `tasks_department_id_foreign` (`department_id`),
  KEY `tasks_assigned_by_id_foreign` (`assigned_by_id`),
  KEY `tasks_supervisor_id_foreign` (`supervisor_id`),
  KEY `idx_tasks_branch_id_status` (`branch_id`,`status`),
  KEY `idx_tasks_branch_id_due_date` (`branch_id`,`due_date`),
  KEY `idx_tasks_assigned_to_id_status` (`assigned_to_id`,`status`),
  CONSTRAINT `tasks_assigned_by_id_foreign` FOREIGN KEY (`assigned_by_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_assigned_to_id_foreign` FOREIGN KEY (`assigned_to_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_supervisor_id_foreign` FOREIGN KEY (`supervisor_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tasks_task_category_id_foreign` FOREIGN KEY (`task_category_id`) REFERENCES `task_categories` (`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 `tasks`
--

LOCK TABLES `tasks` WRITE;
/*!40000 ALTER TABLE `tasks` DISABLE KEYS */;
/*!40000 ALTER TABLE `tasks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tax_rates`
--

DROP TABLE IF EXISTS `tax_rates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_rates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `tax_type` enum('standard','zero_rated','exempt','non_taxable','withholding','levy','excise') NOT NULL DEFAULT 'standard',
  `calculation_type` enum('percentage','fixed') NOT NULL DEFAULT 'percentage',
  `rate` decimal(8,2) NOT NULL DEFAULT 0.00,
  `price_method` enum('inclusive','exclusive') NOT NULL DEFAULT 'inclusive',
  `applies_to` enum('sales','purchases','both') NOT NULL DEFAULT 'both',
  `sales_account` varchar(255) DEFAULT NULL,
  `purchase_account` varchar(255) DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tax_rates`
--

LOCK TABLES `tax_rates` WRITE;
/*!40000 ALTER TABLE `tax_rates` DISABLE KEYS */;
INSERT INTO `tax_rates` VALUES (1,'VAT 16%','VAT16','standard','percentage',16.00,'inclusive','both',NULL,NULL,1,1,'Standard Kenyan VAT.','2026-09-14 16:46:51','2026-09-14 16:46:51'),(2,'Zero Rated','ZERO','zero_rated','percentage',0.00,'inclusive','both',NULL,NULL,0,1,'Taxable at 0%.','2026-09-14 16:46:51','2026-09-14 16:46:51'),(3,'Exempt','EXEMPT','exempt','percentage',0.00,'inclusive','both',NULL,NULL,0,1,'Exempt from VAT.','2026-09-14 16:46:51','2026-09-14 16:46:51'),(4,'Non Taxable','NON','non_taxable','percentage',0.00,'inclusive','both',NULL,NULL,0,1,'Outside tax scope.','2026-09-14 16:46:51','2026-09-14 16:46:51');
/*!40000 ALTER TABLE `tax_rates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `treasury_transactions`
--

DROP TABLE IF EXISTS `treasury_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `treasury_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `transaction_no` varchar(255) NOT NULL,
  `branch_id` bigint(20) unsigned NOT NULL,
  `transaction_type` varchar(255) NOT NULL,
  `source_account_id` bigint(20) unsigned NOT NULL,
  `destination_account_id` bigint(20) unsigned NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `transaction_date` datetime NOT NULL,
  `reference_no` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'posted',
  `created_by` bigint(20) unsigned NOT NULL,
  `reversed_by` bigint(20) unsigned DEFAULT NULL,
  `reversed_at` datetime DEFAULT NULL,
  `reversal_reason` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `treasury_transactions_transaction_no_unique` (`transaction_no`),
  KEY `treasury_transactions_source_account_id_foreign` (`source_account_id`),
  KEY `treasury_transactions_destination_account_id_foreign` (`destination_account_id`),
  KEY `treasury_transactions_created_by_foreign` (`created_by`),
  KEY `treasury_transactions_reversed_by_foreign` (`reversed_by`),
  KEY `treasury_branch_date_type_idx` (`branch_id`,`transaction_date`,`transaction_type`),
  KEY `treasury_transactions_transaction_type_index` (`transaction_type`),
  KEY `treasury_transactions_transaction_date_index` (`transaction_date`),
  KEY `treasury_transactions_reference_no_index` (`reference_no`),
  KEY `treasury_transactions_status_index` (`status`),
  CONSTRAINT `treasury_transactions_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `treasury_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `treasury_transactions_destination_account_id_foreign` FOREIGN KEY (`destination_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `treasury_transactions_reversed_by_foreign` FOREIGN KEY (`reversed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `treasury_transactions_source_account_id_foreign` FOREIGN KEY (`source_account_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `treasury_transactions`
--

LOCK TABLES `treasury_transactions` WRITE;
/*!40000 ALTER TABLE `treasury_transactions` DISABLE KEYS */;
/*!40000 ALTER TABLE `treasury_transactions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `unit_of_measures`
--

DROP TABLE IF EXISTS `unit_of_measures`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `unit_of_measures` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `short_name` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `unit_of_measures`
--

LOCK TABLES `unit_of_measures` WRITE;
/*!40000 ALTER TABLE `unit_of_measures` DISABLE KEYS */;
INSERT INTO `unit_of_measures` VALUES (1,'Pieces','Pcs',NULL,1,'2026-05-25 10:07:12','2026-05-25 10:16:50'),(2,'Kilogram','kg',NULL,1,'2026-05-25 10:07:24','2026-05-25 10:07:24');
/*!40000 ALTER TABLE `unit_of_measures` 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,
  `department_id` bigint(20) unsigned DEFAULT NULL,
  `payment_method_id` bigint(20) unsigned DEFAULT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `middle_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `pin` varchar(255) DEFAULT NULL,
  `role_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `department` varchar(255) DEFAULT NULL,
  `job_title` varchar(255) DEFAULT NULL,
  `employee_number` varchar(255) DEFAULT NULL,
  `hire_date` date DEFAULT NULL,
  `id_number` varchar(255) DEFAULT NULL,
  `kra_pin` varchar(255) DEFAULT NULL,
  `nssf_number` varchar(255) DEFAULT NULL,
  `sha_number` varchar(255) DEFAULT NULL,
  `bank_name` varchar(255) DEFAULT NULL,
  `bank_account_number` varchar(255) DEFAULT NULL,
  `payment_method` varchar(255) DEFAULT NULL,
  `basic_salary` decimal(15,2) DEFAULT NULL,
  `house_allowance` decimal(15,2) DEFAULT NULL,
  `other_allowance` decimal(15,2) DEFAULT NULL,
  `physical_address` text DEFAULT NULL,
  `next_of_kin` varchar(255) DEFAULT NULL,
  `emergency_contact` varchar(255) DEFAULT NULL,
  `profile_photo` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_login_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `updated_by` bigint(20) unsigned DEFAULT NULL,
  `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`),
  UNIQUE KEY `users_username_unique` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=7 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 (3,1,2,'JEVATECH','JEVA','SOLUTIONS','user','JEVATECH SOLUTIONS','user@gmail.com','254741479897',NULL,'$2y$12$WqVhH75V4erz9YZRPj9Jw.OkEGNlECA71o5jr4UiTzQS6seubtFHq',NULL,45,2,NULL,'TECHNICIAN','01','2025-09-26','12345','A12345L','12345','12345','KCB','12345',NULL,1000.00,NULL,NULL,'NAIROBI','JEVATECH','25471234',NULL,1,NULL,NULL,NULL,NULL,'2026-05-19 05:14:46','2026-09-29 16:45:58');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping events for database 'jevapos'
--

--
-- Dumping routines for database 'jevapos'
--
/*!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-10-03 16:12:16
