-- 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 AUTO_INCREMENT=2 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 */;
INSERT INTO `accommodation_bookings` VALUES (1,3,2,1,6,3,'ACC0001','CNF2609210001','James Angome','0716546736','Kenyan','367839',1,0,'[]','walk_in','2026-09-22 23:25:00','2026-09-23 23:25:00',NULL,'2026-09-21 20:26:41',1,1200.00,1200.00,0.00,0.00,'{\"nights\":1,\"adults\":1,\"children\":0,\"child_ages\":[],\"base_amount\":1200,\"occupancy_amount\":0,\"extras_amount\":0,\"total_amount\":1200,\"average_nightly_rate\":1200,\"rate_plan\":\"Double - Bed Only\",\"meal_plan\":\"Bed Only\",\"nightly\":[{\"date\":\"2026-09-22\",\"base_rate\":1200,\"extra_adults\":0,\"children\":0,\"total\":1200}]}',1200.00,0.00,6,NULL,1200.00,'unpaid','reserved',NULL,'2026-09-21 20:26:41','2026-09-21 20:26:41');
/*!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 AUTO_INCREMENT=12 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 */;
INSERT INTO `accommodation_rooms` VALUES (1,1,1,NULL,1,'1','BUFFALO','1ST',1000.00,'occupied',NULL,1,'2026-09-09 22:26:16','2026-09-10 14:54:30'),(2,1,2,NULL,3,'2','ELEPHANT','2ND',1500.00,'vacant',NULL,1,'2026-09-09 22:26:33','2026-09-10 13:56:18'),(3,1,3,NULL,2,'3','RHINO','3RD',1200.00,'vacant',NULL,1,'2026-09-09 22:26:46','2026-09-10 13:56:24'),(4,1,1,NULL,1,'4','TIGER','1ST',1000.00,'occupied',NULL,1,'2026-09-10 13:57:35','2026-09-10 14:56:02'),(5,1,2,NULL,3,'5','LION','2ND',1500.00,'vacant',NULL,1,'2026-09-10 13:57:50','2026-09-10 13:57:50'),(6,1,3,NULL,2,'6','ZEBRA','3RD',1200.00,'vacant',NULL,1,'2026-09-10 13:58:09','2026-09-10 13:58:09'),(7,1,1,NULL,1,'7','GIRAFFE','1ST',1000.00,'vacant',NULL,1,'2026-09-10 13:59:30','2026-09-10 13:59:30'),(8,1,3,NULL,3,'8','ANTELOPE','3RD',1500.00,'vacant',NULL,1,'2026-09-10 14:01:41','2026-09-10 14:01:41'),(9,1,2,NULL,2,'9','KANGAROO','2ND',1200.00,'vacant',NULL,1,'2026-09-10 14:07:17','2026-09-10 14:07:17'),(10,1,3,NULL,2,'10','PANDA','3RD',1200.00,'vacant',NULL,1,'2026-09-10 14:07:49','2026-09-10 14:07:49'),(11,1,4,NULL,2,'11','FOX','4TH',1200.00,'vacant',NULL,1,'2026-09-10 14:11:03','2026-09-10 14:11:03');
/*!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 AUTO_INCREMENT=3 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=108 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,'sales','created','App\\Models\\Sale',7,'0007',NULL,'{\"total_amount\":170,\"paid_amount\":170,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 10:48:16','2026-09-16 10:48:16'),(2,3,2,'products','updated','App\\Models\\Product',2,'SUPA LOAF','{\"retail_price\":\"200.00\",\"custom_price\":\"0.00\",\"track_stock\":1,\"income_account_id\":1,\"expense_account_id\":1,\"asset_account_id\":1,\"is_active\":1}','{\"retail_price\":\"190\",\"custom_price\":0,\"track_stock\":true,\"income_account_id\":null,\"expense_account_id\":null,\"asset_account_id\":null,\"is_active\":true}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:09:52','2026-09-16 11:09:52'),(3,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:13:58','2026-09-16 11:13:58'),(4,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:14:11','2026-09-16 11:14:11'),(5,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:14:41','2026-09-16 11:14:41'),(6,NULL,NULL,'settings','updated','App\\Models\\SystemSetting',76,'76','{\"value\":\"sample\"}','{\"value\":\"JEVATECH\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:15:38','2026-09-16 11:15:38'),(7,NULL,NULL,'settings','created','App\\Models\\SystemSetting',78,'78',NULL,'{\"key\":\"license_contact_person\",\"value\":\"VALENTINE\",\"group\":\"license\",\"id\":78}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:15:38','2026-09-16 11:15:38'),(8,NULL,NULL,'settings','created','App\\Models\\SystemSetting',79,'79',NULL,'{\"key\":\"license_technician_name\",\"value\":\"VALENTINE\",\"group\":\"license\",\"id\":79}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:15:38','2026-09-16 11:15:38'),(9,NULL,NULL,'settings','created','App\\Models\\SystemSetting',80,'80',NULL,'{\"key\":\"license_phone\",\"value\":\"0741479897\",\"group\":\"license\",\"id\":80}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:15:38','2026-09-16 11:15:38'),(10,NULL,NULL,'settings','created','App\\Models\\SystemSetting',81,'81',NULL,'{\"key\":\"license_computer_serial\",\"value\":\"JEV-EFDA-MYR2\",\"group\":\"license\",\"id\":81}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:15:38','2026-09-16 11:15:38'),(11,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:15:53','2026-09-16 11:15:53'),(12,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:21:20','2026-09-16 11:21:20'),(13,NULL,NULL,'settings','updated','App\\Models\\SystemSetting',74,'74','{\"value\":\"5F45E-C44C0-CBA2A-1EFDE\"}','{\"value\":\"JVL-eyJ2IjoxLCJhY3RpdmF0aW9uX25vIjoiQUNUMDAwNCIsImNsaWVudF9uYW1lIjoiSkVWQVRFQ0giLCJjb21wdXRlcl9zZXJpYWwiOiJKRVYtRUZEQS1NWVIyIiwiZXhwaXJlc19hdCI6bnVsbCwiaXNzdWVkX2F0IjoiMjAyNi0wOS0xNiAxNDoyMDozMSJ9.e1f6d63aac24fb26b6657395ea25978706d257730d1bf41fab502fbdc021fb32\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:21:31','2026-09-16 11:21:31'),(14,NULL,NULL,'settings','updated','App\\Models\\SystemSetting',75,'75','{\"value\":\"ACT0002\"}','{\"value\":\"ACT0004\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:21:31','2026-09-16 11:21:31'),(15,NULL,NULL,'settings','updated','App\\Models\\SystemSetting',77,'77','{\"value\":\"2026-09-30\"}','{\"value\":null}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:21:31','2026-09-16 11:21:31'),(16,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 11:21:40','2026-09-16 11:21:40'),(17,3,2,'products','updated','App\\Models\\Product',1,'GRACIE YOGHURT 500ML','{\"stock_quantity\":\"1.00\"}','{\"stock_quantity\":0}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 12:50:42','2026-09-16 12:50:42'),(18,3,2,'sales','created','App\\Models\\Sale',8,'0008',NULL,'{\"total_amount\":170,\"paid_amount\":170,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 12:50:42','2026-09-16 12:50:42'),(19,3,2,'settings','database_backup_created',NULL,NULL,NULL,NULL,'{\"file\":\"jevapos_20260916_160315.sql\",\"size\":\"184.43 KB\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:03:15','2026-09-16 13:03:15'),(20,3,2,'settings','created','App\\Models\\SystemSetting',82,'82',NULL,'{\"key\":\"backup_directory\",\"value\":\"C:\\\\JEVAPOS_BACKUPS\",\"group\":\"backup\",\"id\":82}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:05:06','2026-09-16 13:05:06'),(21,3,2,'settings','created','App\\Models\\SystemSetting',83,'83',NULL,'{\"key\":\"mysqldump_path\",\"value\":\"E:\\\\xampp\\\\mysql\\\\bin\\\\mysqldump.exe\",\"group\":\"backup\",\"id\":83}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:05:06','2026-09-16 13:05:06'),(22,3,2,'settings','created','App\\Models\\SystemSetting',84,'84',NULL,'{\"key\":\"backup_retention_days\",\"value\":\"30\",\"group\":\"backup\",\"id\":84}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:05:06','2026-09-16 13:05:06'),(23,3,2,'settings','backup_settings_updated',NULL,NULL,NULL,NULL,'{\"backup_directory\":\"C:\\\\JEVAPOS_BACKUPS\",\"retention_days\":\"30\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:05:06','2026-09-16 13:05:06'),(24,3,2,'settings','database_backup_created',NULL,NULL,NULL,NULL,'{\"file\":\"jevapos_20260916_160509.sql\",\"size\":\"186.33 KB\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:05:10','2026-09-16 13:05:10'),(25,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:14:58','2026-09-16 13:14:58'),(26,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:16:55','2026-09-16 13:16:55'),(27,3,2,'products','created','App\\Models\\Product',3,'ilara yoghurt 500ml',NULL,'{\"name\":\"ilara yoghurt 500ml\",\"barcode\":\"3\",\"product_type\":\"single\",\"inventory_type\":\"inventory\",\"category_id\":\"2\",\"sub_category_id\":\"1\",\"branch_id\":\"2\",\"unit_of_measure_id\":\"1\",\"buying_price\":\"70\",\"retail_price\":\"120\",\"wholesale_price\":\"100\",\"stock_quantity\":\"10\",\"alert_quantity\":\"0\",\"vat_method\":\"inclusive\",\"vat_type\":\"standard\",\"vat_rate\":\"16.00\",\"tax_rate_id\":\"1\",\"asset_account_id\":\"1\",\"is_active\":true,\"id\":3}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:17:50','2026-09-16 13:17:50'),(28,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:46:42','2026-09-16 13:46:42'),(29,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:47:34','2026-09-16 13:47:34'),(30,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"10.00\"}','{\"stock_quantity\":8}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:48:17','2026-09-16 13:48:17'),(31,3,2,'sales','created','App\\Models\\Sale',9,'0009',NULL,'{\"total_amount\":240,\"paid_amount\":240,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:48:17','2026-09-16 13:48:17'),(32,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"8.00\"}','{\"stock_quantity\":7}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:50:05','2026-09-16 13:50:05'),(33,3,2,'sales','created','App\\Models\\Sale',10,'0010',NULL,'{\"total_amount\":120,\"paid_amount\":120,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:50:05','2026-09-16 13:50:05'),(34,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36','2026-09-16 13:50:17','2026-09-16 13:50:17'),(35,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 17:55:16','2026-09-21 17:55:16'),(36,3,2,'settings','created','App\\Models\\SystemSetting',85,'85',NULL,'{\"key\":\"website_integration_key\",\"value\":\"eyJpdiI6InVDZWdHQkR1L2JlNGNyOWU3MkRlRHc9PSIsInZhbHVlIjoidW9WbE9MTWJmM3B5Mmc1V2plcnp4aUlENXJ6b3ZaUUNObkxwS1VOZXowc3FqL0pqUnRWNmxOQnp4WnB6WUhuTEJhVjNjVVdqRGZnbWZHRW9JcGhDeXBEU3pTN2RyRHRHenRoWXllS0hBbHc9IiwibWFjIjoiZjlhNGUxNzQ4NTExMmQzMDEwMzM1YjZmZWExY2ZlOWVmZDUwYjkyMTk0MTk1Mjk0NmI0ZjIxZGY3MmVkOTc0MyIsInRhZyI6IiJ9\",\"group\":\"website\",\"id\":85}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 18:12:27','2026-09-21 18:12:27'),(41,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"7.00\"}','{\"stock_quantity\":5}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:15:22','2026-09-21 20:15:22'),(42,3,2,'accounting','created','App\\Models\\Account',22,'Custodian Inventory',NULL,'{\"account_name\":\"Custodian Inventory\",\"gl_code\":\"CUSTODIA\",\"account_type\":\"asset\",\"currency\":\"KES\",\"is_active\":true,\"id\":22}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:15:22','2026-09-21 20:15:22'),(43,3,2,'inventory','internal_stock_issued','App\\Models\\InternalStockIssue',3,'ISI00001',NULL,'{\"issue_type\":\"custody\",\"receiver_id\":3,\"quantity\":2,\"total_cost\":\"140.00\"}','House keeping','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:15:22','2026-09-21 20:15:22'),(44,3,2,'inventory','custodian_stock_received','App\\Models\\InternalStockIssue',3,'ISI00001',NULL,'{\"received_by\":3}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:16:54','2026-09-21 20:16:54'),(45,3,2,'accounting','created','App\\Models\\Account',23,'Housekeeping Supplies',NULL,'{\"account_name\":\"Housekeeping Supplies\",\"gl_code\":\"HOUSEKEE\",\"account_type\":\"expense\",\"currency\":\"KES\",\"is_active\":true,\"id\":23}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:22:19','2026-09-21 20:22:19'),(46,3,2,'accommodation','housekeeping_stock_issued_to_room','App\\Models\\InternalStockTransaction',2,'ISI00001',NULL,'{\"product\":\"ilara yoghurt 500ml\",\"room\":\"ANTELOPE\",\"quantity\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:22:20','2026-09-21 20:22:20'),(47,3,2,'customers','created','App\\Models\\Customer',6,'James Angome',NULL,'{\"branch_id\":2,\"name\":\"James Angome\",\"phone\":\"0716546736\",\"nationality\":\"Kenyan\",\"id_passport_no\":\"367839\",\"is_active\":true,\"id\":6}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:26:41','2026-09-21 20:26:41'),(48,3,2,'accommodation','housekeeping_stock_issued_to_room','App\\Models\\InternalStockTransaction',3,'ISI00001',NULL,'{\"product\":\"ilara yoghurt 500ml\",\"room\":\"LION\",\"quantity\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-21 20:33:50','2026-09-21 20:33:50'),(49,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 16:25:33','2026-09-22 16:25:33'),(50,3,2,'project','created','App\\Models\\Project',1,'Mutti matt',NULL,'{\"name\":\"Mutti matt\",\"branch_id\":\"2\",\"customer_id\":\"2\",\"department_id\":\"1\",\"manager_id\":\"2\",\"priority\":\"medium\",\"start_date\":\"2026-09-22 00:00:00\",\"due_date\":\"2026-09-24 00:00:00\",\"budget\":\"100000\",\"description\":\"POS installation\",\"project_no\":\"PRJ00001\",\"created_by\":3,\"status\":\"planning\",\"health\":\"on_track\",\"id\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:18:21','2026-09-22 17:18:21'),(51,3,2,'project_management','project_created','App\\Models\\Project',1,'PRJ00001',NULL,'{\"name\":\"Mutti matt\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:18:21','2026-09-22 17:18:21'),(52,3,2,'project','updated','App\\Models\\Project',1,'Mutti matt','{\"status\":\"planning\",\"actual_cost\":\"0.00\",\"progress\":0}','{\"status\":\"active\",\"actual_cost\":\"1000\",\"progress\":\"10\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:19:17','2026-09-22 17:19:17'),(53,3,2,'projecttask','created','App\\Models\\ProjectTask',1,'1',NULL,'{\"title\":\"Demo done\",\"milestone_id\":null,\"assignee_id\":\"3\",\"priority\":\"medium\",\"status\":\"in_progress\",\"due_date\":\"2026-09-22 00:00:00\",\"task_no\":\"PT000001\",\"created_by\":3,\"project_id\":1,\"id\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:19:48','2026-09-22 17:19:48'),(54,3,2,'project','updated','App\\Models\\Project',1,'Mutti matt','{\"progress\":10}','{\"progress\":0}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:19:48','2026-09-22 17:19:48'),(55,3,2,'projecttask','updated','App\\Models\\ProjectTask',1,'1','{\"progress\":0}','{\"progress\":\"100\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:20:06','2026-09-22 17:20:06'),(56,3,2,'project','updated','App\\Models\\Project',1,'Mutti matt','{\"progress\":0}','{\"progress\":100}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:20:06','2026-09-22 17:20:06'),(57,3,2,'projecttask','updated','App\\Models\\ProjectTask',1,'1','{\"progress\":100}','{\"progress\":\"20\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:21:05','2026-09-22 17:21:05'),(58,3,2,'project','updated','App\\Models\\Project',1,'Mutti matt','{\"progress\":100}','{\"progress\":20}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:21:05','2026-09-22 17:21:05'),(59,3,2,'projectmilestone','created','App\\Models\\ProjectMilestone',1,'1',NULL,'{\"title\":\"location received\",\"owner_id\":\"3\",\"due_date\":\"2026-09-22 00:00:00\",\"status\":\"pending\",\"project_id\":1,\"id\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:21:50','2026-09-22 17:21:50'),(60,3,2,'project','updated','App\\Models\\Project',1,'Mutti matt','{\"progress\":20}','{\"progress\":\"40\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:22:37','2026-09-22 17:22:37'),(61,3,2,'project','updated','App\\Models\\Project',1,'Mutti matt','{\"actual_cost\":\"1000.00\"}','{\"actual_cost\":\"30000.00\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 17:23:10','2026-09-22 17:23:10'),(64,3,2,'users','updated','App\\Models\\User',4,'cashier cashier','{\"password\":\"[hidden]\",\"role_id\":45}','{\"password\":\"[hidden]\",\"role_id\":\"46\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:07:59','2026-09-22 20:07:59'),(65,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:08:09','2026-09-22 20:08:09'),(66,4,2,'auth','login','App\\Models\\User',4,NULL,NULL,'{\"username\":\"cashier\",\"name\":\"cashier cashier\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:08:26','2026-09-22 20:08:26'),(67,4,2,'auth','logout','App\\Models\\User',4,NULL,NULL,'{\"username\":\"cashier\",\"name\":\"cashier cashier\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:08:42','2026-09-22 20:08:42'),(68,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:08:53','2026-09-22 20:08:53'),(69,3,2,'settings','updated','App\\Models\\SystemSetting',14,'14','{\"value\":\"yes\"}','{\"value\":\"no\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:09:14','2026-09-22 20:09:14'),(70,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:09:20','2026-09-22 20:09:20'),(71,4,2,'auth','login','App\\Models\\User',4,NULL,NULL,'{\"username\":\"cashier\",\"name\":\"cashier cashier\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:09:33','2026-09-22 20:09:33'),(72,4,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"5.00\"}','{\"stock_quantity\":2}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:10:21','2026-09-22 20:10:21'),(73,4,2,'sales','created','App\\Models\\Sale',11,'0011',NULL,'{\"total_amount\":360,\"paid_amount\":360,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 20:10:21','2026-09-22 20:10:21'),(74,4,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"2.00\"}','{\"stock_quantity\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 21:39:02','2026-09-22 21:39:02'),(75,4,2,'sales','created','App\\Models\\Sale',12,'0012',NULL,'{\"total_amount\":120,\"paid_amount\":120,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 21:39:02','2026-09-22 21:39:02'),(76,4,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"1.00\"}','{\"stock_quantity\":0}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 21:39:26','2026-09-22 21:39:26'),(77,4,2,'sales','created','App\\Models\\Sale',13,'0013',NULL,'{\"total_amount\":120,\"paid_amount\":120,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 21:39:26','2026-09-22 21:39:26'),(78,4,2,'auth','logout','App\\Models\\User',4,NULL,NULL,'{\"username\":\"cashier\",\"name\":\"cashier cashier\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 21:46:24','2026-09-22 21:46:24'),(79,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 21:46:37','2026-09-22 21:46:37'),(80,3,2,'auth','failed_login',NULL,NULL,NULL,NULL,'{\"username\":null,\"login_mode\":\"touch_pin\"}','Invalid login credentials','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 22:27:20','2026-09-22 22:27:20'),(81,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 22:27:38','2026-09-22 22:27:38'),(82,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-22 22:29:32','2026-09-22 22:29:32'),(83,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 18:33:37','2026-09-25 18:33:37'),(84,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"0.00\"}','{\"stock_quantity\":10}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:10:37','2026-09-25 19:10:37'),(85,3,2,'purchases','created','App\\Models\\Purchase',3,'P0003',NULL,'{\"total_amount\":700,\"paid_amount\":0,\"balance_amount\":700,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:10:37','2026-09-25 19:10:37'),(86,3,2,'purchases','payment_made','App\\Models\\Purchase',3,'P0003',NULL,'{\"payment_id\":3,\"amount\":700,\"payment_method_id\":\"2\",\"reference_no\":null}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:11:27','2026-09-25 19:11:27'),(87,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"10.00\"}','{\"stock_quantity\":9}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:15:21','2026-09-25 19:15:21'),(88,3,2,'sales','created','App\\Models\\Sale',14,'0014',NULL,'{\"total_amount\":120,\"paid_amount\":120,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:15:21','2026-09-25 19:15:21'),(89,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"9.00\"}','{\"stock_quantity\":8}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:26:01','2026-09-25 19:26:01'),(90,3,2,'sales','created','App\\Models\\Sale',15,'0015',NULL,'{\"total_amount\":120,\"paid_amount\":120,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:26:01','2026-09-25 19:26:01'),(91,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"8.00\"}','{\"stock_quantity\":7}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:26:20','2026-09-25 19:26:20'),(92,3,2,'sales','created','App\\Models\\Sale',16,'0016',NULL,'{\"total_amount\":120,\"paid_amount\":120,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:26:20','2026-09-25 19:26:20'),(93,3,2,'settings','created','App\\Models\\SystemSetting',87,'87',NULL,'{\"key\":\"business_tax_pin\",\"value\":\"\",\"group\":\"invoice\",\"id\":87}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:39:34','2026-09-25 19:39:34'),(94,3,2,'settings','created','App\\Models\\SystemSetting',88,'88',NULL,'{\"key\":\"show_customer_pin_on_invoice\",\"value\":\"yes\",\"group\":\"invoice\",\"id\":88}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:39:34','2026-09-25 19:39:34'),(95,3,2,'settings','created','App\\Models\\SystemSetting',89,'89',NULL,'{\"key\":\"show_discount_on_invoice\",\"value\":\"yes\",\"group\":\"invoice\",\"id\":89}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:39:34','2026-09-25 19:39:34'),(96,3,2,'customers','updated','App\\Models\\Customer',1,'Walk in','{\"phone\":null,\"email\":null,\"tax_pin\":null}','{\"phone\":\"12345678\",\"email\":\"asdfg@gmail.com\",\"tax_pin\":\"P345678987V\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:40:04','2026-09-25 19:40:04'),(97,3,2,'products','updated','App\\Models\\Product',3,'ilara yoghurt 500ml','{\"stock_quantity\":\"7.00\"}','{\"stock_quantity\":6}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:41:00','2026-09-25 19:41:00'),(98,3,2,'sales','created','App\\Models\\Sale',17,'0017',NULL,'{\"total_amount\":120,\"paid_amount\":120,\"balance_amount\":0,\"items_count\":1}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 19:41:00','2026-09-25 19:41:00'),(99,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:08:58','2026-09-25 20:08:58'),(100,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:26:13','2026-09-25 20:26:13'),(101,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:44:26','2026-09-25 20:44:26'),(102,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\",\"login_mode\":\"touch\"}','Successful touch login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:46:45','2026-09-25 20:46:45'),(103,3,2,'settings','updated','App\\Models\\SystemSetting',1,'1','{\"value\":\"touch_pin\"}','{\"value\":\"username_password\"}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:49:28','2026-09-25 20:49:28'),(104,3,2,'settings','created','App\\Models\\SystemSetting',90,'90',NULL,'{\"key\":\"pos_duplicate_product_behavior\",\"value\":\"increase_quantity\",\"group\":\"sales\",\"id\":90}',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:49:28','2026-09-25 20:49:28'),(105,3,2,'auth','logout','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:50:09','2026-09-25 20:50:09'),(106,NULL,NULL,'auth','failed_login',NULL,NULL,NULL,NULL,'{\"username\":\"cashier\",\"login_mode\":\"username_password\"}','Invalid login credentials','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:50:27','2026-09-25 20:50:27'),(107,3,2,'auth','login','App\\Models\\User',3,NULL,NULL,'{\"username\":\"user\",\"name\":\"Valentine Muteshi\"}','Successful login','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-09-25 20:50:35','2026-09-25 20:50:35');
/*!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 AUTO_INCREMENT=5 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 (1,2,2,'2026-09-11 21:16:07','2026-09-11 21:16:07'),(2,3,2,'2026-09-11 21:16:07','2026-09-11 21:16:07'),(3,4,2,'2026-09-11 21:16:07','2026-09-11 21:16:07'),(4,3,3,'2026-09-14 13:39:52','2026-09-14 13:39:52');
/*!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'),(3,'SAMPLE',NULL,NULL,NULL,NULL,NULL,NULL,0,1,'2026-09-12 18:36:31','2026-09-12 18:36:31');
/*!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=31 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');
/*!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,
  `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` enum('new','attended','pending','solved','completed','other') NOT NULL DEFAULT 'new',
  `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,
  PRIMARY KEY (`id`),
  UNIQUE KEY `call_records_call_no_unique` (`call_no`),
  KEY `call_records_customer_id_foreign` (`customer_id`),
  KEY `call_records_receiver_id_foreign` (`receiver_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`),
  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
) ENGINE=InnoDB 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 */;
/*!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,
  `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`),
  CONSTRAINT `categories_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`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 `categories`
--

LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
INSERT INTO `categories` VALUES (2,2,'COLD DRINKS',NULL,NULL,1,'2026-09-14 18:25:42','2026-09-14 18:26:14'),(3,2,'BREAD',NULL,NULL,1,'2026-09-14 18:34:57','2026-09-14 18:34:57');
/*!40000 ALTER TABLE `categories` 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=7 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'),(2,2,'Valentine','0741479897',NULL,NULL,NULL,'Kenyan','7654',1,'2026-09-10 13:06:46','2026-09-14 18:20:17'),(3,2,'test','355422',NULL,NULL,NULL,NULL,NULL,1,'2026-09-10 13:06:46','2026-09-14 18:20:25'),(4,2,'Dylan','075372819',NULL,NULL,NULL,'ke','32123',1,'2026-09-10 14:54:30','2026-09-14 18:20:11'),(5,2,'Muteshi','0712346',NULL,NULL,NULL,'ke','9033',1,'2026-09-10 14:56:02','2026-09-14 18:20:01'),(6,2,'James Angome','0716546736',NULL,NULL,NULL,'Kenyan','367839',1,'2026-09-21 20:26:41','2026-09-21 20:26:41');
/*!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 AUTO_INCREMENT=2 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 */;
INSERT INTO `damaged_products` VALUES (1,'DM0001',2,2,3,2.00,10.00,8.00,100.00,200.00,'2026-09-15 14:55:00','dennis','expired',NULL,'2026-09-15 11:56:18','2026-09-15 11:56:18');
/*!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,
  `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,
  `customer_name` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `source` varchar(255) DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `expected_value` decimal(15,2) NOT NULL DEFAULT 0.00,
  `stage` enum('new','contacted','follow_up','quotation','won','lost') NOT NULL DEFAULT 'new',
  `status` enum('pending','ongoing','won','lost','closed') NOT NULL DEFAULT 'pending',
  `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`),
  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`),
  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
) ENGINE=InnoDB 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 */;
/*!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 `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 AUTO_INCREMENT=2 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 */;
INSERT INTO `expense_categories` VALUES (1,'Rent',NULL,1,'2026-09-09 14:02:43','2026-09-09 14:02:43');
/*!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 AUTO_INCREMENT=4 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 */;
INSERT INTO `internal_stock_issue_items` VALUES (3,3,3,2.00,2.00,0.00,0.00,70.00,7.00,5.00,'2026-09-21 20:15:22','2026-09-21 20:33:50');
/*!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 AUTO_INCREMENT=4 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 */;
INSERT INTO `internal_stock_issues` VALUES (3,'ISI00001',2,NULL,3,3,3,'custody','closed','2026-09-21 23:14:00','2026-09-21 23:16:54','House keeping',NULL,140.00,'2026-09-21 20:15:22','2026-09-21 20:33:50');
/*!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 AUTO_INCREMENT=4 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 */;
INSERT INTO `internal_stock_transactions` VALUES (2,3,1,8,NULL,3,'room_issue',1.00,2.00,1.00,70.00,'2026-09-21 23:21:00',NULL,NULL,'2026-09-21 20:22:19','2026-09-21 20:22:19'),(3,3,1,5,NULL,3,'room_issue',1.00,1.00,0.00,70.00,'2026-09-21 23:29:00',NULL,NULL,'2026-09-21 20:33:50','2026-09-21 20:33:50');
/*!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=23 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-09-16 13:48:16','Sale',7,'sale_created','0007','Sale invoice 0007','posted',NULL,'2026-09-16 10:48:16','2026-09-16 10:48:16'),(2,'JE000002',2,3,'2026-09-16 15:50:42','Sale',8,'sale_created','0008','Sale invoice 0008','posted',NULL,'2026-09-16 12:50:42','2026-09-16 12:50:42'),(3,'JE000003',2,3,'2026-09-16 16:48:17','Sale',9,'sale_created','0009','Sale invoice 0009','posted',NULL,'2026-09-16 13:48:17','2026-09-16 13:48:17'),(4,'JE000004',2,3,'2026-09-16 16:50:05','Sale',10,'sale_created','0010','Sale invoice 0010','posted',NULL,'2026-09-16 13:50:05','2026-09-16 13:50:05'),(8,'JE000005',2,3,'2026-09-21 23:14:00','InternalStockIssue',3,'stock_issued','ISI00001','Internal stock issue ISI00001 - House keeping','posted',NULL,'2026-09-21 20:15:22','2026-09-21 20:15:22'),(9,'JE000009',2,3,'2026-09-21 23:21:00','InternalStockTransaction',2,'room_issue','ISI00001','Custodian stock room_issue for ISI00001','posted',NULL,'2026-09-21 20:22:19','2026-09-21 20:22:19'),(10,'JE000010',2,3,'2026-09-21 23:29:00','InternalStockTransaction',3,'room_issue','ISI00001','Custodian stock room_issue for ISI00001','posted',NULL,'2026-09-21 20:33:50','2026-09-21 20:33:50'),(14,'JE000011',2,4,'2026-09-22 23:10:21','Sale',11,'sale_created','0011','Sale invoice 0011','posted',NULL,'2026-09-22 20:10:21','2026-09-22 20:10:21'),(15,'JE000015',2,4,'2026-09-23 00:39:01','Sale',12,'sale_created','0012','Sale invoice 0012','posted',NULL,'2026-09-22 21:39:02','2026-09-22 21:39:02'),(16,'JE000016',2,4,'2026-09-23 00:39:26','Sale',13,'sale_created','0013','Sale invoice 0013','posted',NULL,'2026-09-22 21:39:26','2026-09-22 21:39:26'),(17,'JE000017',2,3,'2026-09-25 22:10:00','Purchase',3,'purchase_created','P0003','Purchase P0003','posted',NULL,'2026-09-25 19:10:37','2026-09-25 19:10:37'),(18,'JE000018',2,3,'2026-09-25 22:11:27','PurchasePayment',3,'purchase_payment','P0003','Supplier payment for P0003','posted',NULL,'2026-09-25 19:11:27','2026-09-25 19:11:27'),(19,'JE000019',2,3,'2026-09-25 22:15:21','Sale',14,'sale_created','0014','Sale invoice 0014','posted',NULL,'2026-09-25 19:15:21','2026-09-25 19:15:21'),(20,'JE000020',2,3,'2026-09-25 22:26:01','Sale',15,'sale_created','0015','Sale invoice 0015','posted',NULL,'2026-09-25 19:26:01','2026-09-25 19:26:01'),(21,'JE000021',2,3,'2026-09-25 22:26:20','Sale',16,'sale_created','0016','Sale invoice 0016','posted',NULL,'2026-09-25 19:26:20','2026-09-25 19:26:20'),(22,'JE000022',2,3,'2026-09-25 22:41:00','Sale',17,'sale_created','0017','Sale invoice 0017','posted',NULL,'2026-09-25 19:41:00','2026-09-25 19:41:00');
/*!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=79 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,2,'cash at hand','Asset',170.00,0.00,NULL,'2026-09-16 10:48:16','2026-09-16 10:48:16'),(2,1,15,'Sales Revenue','income',0.00,146.55,NULL,'2026-09-16 10:48:16','2026-09-16 10:48:16'),(3,1,14,'Output VAT','liability',0.00,23.45,NULL,'2026-09-16 10:48:16','2026-09-16 10:48:16'),(4,1,17,'Cost of Goods Sold','expense',100.00,0.00,NULL,'2026-09-16 10:48:16','2026-09-16 10:48:16'),(5,1,11,'Inventory','asset',0.00,100.00,NULL,'2026-09-16 10:48:16','2026-09-16 10:48:16'),(6,2,2,'cash at hand','Asset',170.00,0.00,NULL,'2026-09-16 12:50:42','2026-09-16 12:50:42'),(7,2,15,'Sales Revenue','income',0.00,146.55,NULL,'2026-09-16 12:50:42','2026-09-16 12:50:42'),(8,2,14,'Output VAT','liability',0.00,23.45,NULL,'2026-09-16 12:50:42','2026-09-16 12:50:42'),(9,2,17,'Cost of Goods Sold','expense',100.00,0.00,NULL,'2026-09-16 12:50:42','2026-09-16 12:50:42'),(10,2,11,'Inventory','asset',0.00,100.00,NULL,'2026-09-16 12:50:42','2026-09-16 12:50:42'),(11,3,2,'cash at hand','Asset',240.00,0.00,NULL,'2026-09-16 13:48:17','2026-09-16 13:48:17'),(12,3,15,'Sales Revenue','income',0.00,206.90,NULL,'2026-09-16 13:48:17','2026-09-16 13:48:17'),(13,3,14,'Output VAT','liability',0.00,33.10,NULL,'2026-09-16 13:48:17','2026-09-16 13:48:17'),(14,3,17,'Cost of Goods Sold','expense',140.00,0.00,NULL,'2026-09-16 13:48:17','2026-09-16 13:48:17'),(15,3,11,'Inventory','asset',0.00,140.00,NULL,'2026-09-16 13:48:17','2026-09-16 13:48:17'),(16,4,2,'cash at hand','Asset',120.00,0.00,NULL,'2026-09-16 13:50:05','2026-09-16 13:50:05'),(17,4,15,'Sales Revenue','income',0.00,103.45,NULL,'2026-09-16 13:50:05','2026-09-16 13:50:05'),(18,4,14,'Output VAT','liability',0.00,16.55,NULL,'2026-09-16 13:50:05','2026-09-16 13:50:05'),(19,4,17,'Cost of Goods Sold','expense',70.00,0.00,NULL,'2026-09-16 13:50:05','2026-09-16 13:50:05'),(20,4,11,'Inventory','asset',0.00,70.00,NULL,'2026-09-16 13:50:05','2026-09-16 13:50:05'),(27,8,22,'Custodian Inventory','asset',140.00,0.00,NULL,'2026-09-21 20:15:22','2026-09-21 20:15:22'),(28,8,11,'Inventory','asset',0.00,140.00,NULL,'2026-09-21 20:15:22','2026-09-21 20:15:22'),(29,9,23,'Housekeeping Supplies','expense',70.00,0.00,NULL,'2026-09-21 20:22:19','2026-09-21 20:22:19'),(30,9,22,'Custodian Inventory','asset',0.00,70.00,NULL,'2026-09-21 20:22:19','2026-09-21 20:22:19'),(31,10,23,'Housekeeping Supplies','expense',70.00,0.00,NULL,'2026-09-21 20:33:50','2026-09-21 20:33:50'),(32,10,22,'Custodian Inventory','asset',0.00,70.00,NULL,'2026-09-21 20:33:50','2026-09-21 20:33:50'),(39,14,2,'Cash in Hand','asset',360.00,0.00,NULL,'2026-09-22 20:10:21','2026-09-22 20:10:21'),(40,14,15,'Sales Revenue','income',0.00,310.34,NULL,'2026-09-22 20:10:21','2026-09-22 20:10:21'),(41,14,14,'Output VAT','liability',0.00,49.66,NULL,'2026-09-22 20:10:21','2026-09-22 20:10:21'),(42,14,17,'Cost of Goods Sold','expense',210.00,0.00,NULL,'2026-09-22 20:10:21','2026-09-22 20:10:21'),(43,14,11,'Inventory','asset',0.00,210.00,NULL,'2026-09-22 20:10:21','2026-09-22 20:10:21'),(44,15,2,'Cash in Hand','asset',120.00,0.00,NULL,'2026-09-22 21:39:02','2026-09-22 21:39:02'),(45,15,15,'Sales Revenue','income',0.00,103.45,NULL,'2026-09-22 21:39:02','2026-09-22 21:39:02'),(46,15,14,'Output VAT','liability',0.00,16.55,NULL,'2026-09-22 21:39:02','2026-09-22 21:39:02'),(47,15,17,'Cost of Goods Sold','expense',70.00,0.00,NULL,'2026-09-22 21:39:02','2026-09-22 21:39:02'),(48,15,11,'Inventory','asset',0.00,70.00,NULL,'2026-09-22 21:39:02','2026-09-22 21:39:02'),(49,16,2,'Cash in Hand','asset',120.00,0.00,NULL,'2026-09-22 21:39:26','2026-09-22 21:39:26'),(50,16,15,'Sales Revenue','income',0.00,103.45,NULL,'2026-09-22 21:39:26','2026-09-22 21:39:26'),(51,16,14,'Output VAT','liability',0.00,16.55,NULL,'2026-09-22 21:39:26','2026-09-22 21:39:26'),(52,16,17,'Cost of Goods Sold','expense',70.00,0.00,NULL,'2026-09-22 21:39:26','2026-09-22 21:39:26'),(53,16,11,'Inventory','asset',0.00,70.00,NULL,'2026-09-22 21:39:26','2026-09-22 21:39:26'),(54,17,11,'Inventory','asset',603.45,0.00,NULL,'2026-09-25 19:10:37','2026-09-25 19:10:37'),(55,17,12,'Input VAT','asset',96.55,0.00,NULL,'2026-09-25 19:10:37','2026-09-25 19:10:37'),(56,17,13,'Accounts Payable','liability',0.00,700.00,NULL,'2026-09-25 19:10:37','2026-09-25 19:10:37'),(57,18,13,'Accounts Payable','liability',700.00,0.00,NULL,'2026-09-25 19:11:27','2026-09-25 19:11:27'),(58,18,2,'Cash in Hand','asset',0.00,700.00,NULL,'2026-09-25 19:11:27','2026-09-25 19:11:27'),(59,19,2,'Cash in Hand','asset',120.00,0.00,NULL,'2026-09-25 19:15:21','2026-09-25 19:15:21'),(60,19,15,'Sales Revenue','income',0.00,103.45,NULL,'2026-09-25 19:15:21','2026-09-25 19:15:21'),(61,19,14,'Output VAT','liability',0.00,16.55,NULL,'2026-09-25 19:15:21','2026-09-25 19:15:21'),(62,19,17,'Cost of Goods Sold','expense',70.00,0.00,NULL,'2026-09-25 19:15:21','2026-09-25 19:15:21'),(63,19,11,'Inventory','asset',0.00,70.00,NULL,'2026-09-25 19:15:21','2026-09-25 19:15:21'),(64,20,5,'M-Pesa','asset',120.00,0.00,NULL,'2026-09-25 19:26:01','2026-09-25 19:26:01'),(65,20,15,'Sales Revenue','income',0.00,103.45,NULL,'2026-09-25 19:26:01','2026-09-25 19:26:01'),(66,20,14,'Output VAT','liability',0.00,16.55,NULL,'2026-09-25 19:26:01','2026-09-25 19:26:01'),(67,20,17,'Cost of Goods Sold','expense',70.00,0.00,NULL,'2026-09-25 19:26:01','2026-09-25 19:26:01'),(68,20,11,'Inventory','asset',0.00,70.00,NULL,'2026-09-25 19:26:01','2026-09-25 19:26:01'),(69,21,5,'M-Pesa','asset',120.00,0.00,NULL,'2026-09-25 19:26:20','2026-09-25 19:26:20'),(70,21,15,'Sales Revenue','income',0.00,103.45,NULL,'2026-09-25 19:26:20','2026-09-25 19:26:20'),(71,21,14,'Output VAT','liability',0.00,16.55,NULL,'2026-09-25 19:26:20','2026-09-25 19:26:20'),(72,21,17,'Cost of Goods Sold','expense',70.00,0.00,NULL,'2026-09-25 19:26:20','2026-09-25 19:26:20'),(73,21,11,'Inventory','asset',0.00,70.00,NULL,'2026-09-25 19:26:20','2026-09-25 19:26:20'),(74,22,5,'M-Pesa','asset',120.00,0.00,NULL,'2026-09-25 19:41:00','2026-09-25 19:41:00'),(75,22,15,'Sales Revenue','income',0.00,103.45,NULL,'2026-09-25 19:41:00','2026-09-25 19:41:00'),(76,22,14,'Output VAT','liability',0.00,16.55,NULL,'2026-09-25 19:41:00','2026-09-25 19:41:00'),(77,22,17,'Cost of Goods Sold','expense',70.00,0.00,NULL,'2026-09-25 19:41:00','2026-09-25 19:41:00'),(78,22,11,'Inventory','asset',0.00,70.00,NULL,'2026-09-25 19:41:00','2026-09-25 19:41:00');
/*!40000 ALTER TABLE `journal_entry_lines` 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 AUTO_INCREMENT=2 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,
  `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`),
  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=5 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','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','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',3,'test','hjfdf',NULL,'355422',NULL,'JEV-EFDA-MYR2','JEV-EFDA-MYR2','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','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');
/*!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=104 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);
/*!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 AUTO_INCREMENT=2 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=18 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,1,2,300.00,NULL,NULL,3,'2026-09-14 21:30:18','2026-09-14 18:30:18','2026-09-14 18:30:18'),(2,1,1,3,40.00,NULL,NULL,3,'2026-09-14 21:30:18','2026-09-14 18:30:18','2026-09-14 18:30:18'),(3,2,1,2,510.00,NULL,NULL,3,'2026-09-14 21:31:57','2026-09-14 18:31:57','2026-09-14 18:31:57'),(4,3,1,2,510.00,NULL,NULL,3,'2026-09-14 21:50:24','2026-09-14 18:50:24','2026-09-14 18:50:24'),(5,4,1,2,340.00,NULL,NULL,3,'2026-09-14 22:06:17','2026-09-14 19:06:17','2026-09-14 19:06:17'),(6,5,1,2,170.00,NULL,NULL,3,'2026-09-14 22:32:09','2026-09-14 19:32:09','2026-09-14 19:32:09'),(7,7,1,2,170.00,NULL,NULL,3,'2026-09-16 13:48:16','2026-09-16 10:48:16','2026-09-16 10:48:16'),(8,8,1,2,170.00,NULL,NULL,3,'2026-09-16 15:50:42','2026-09-16 12:50:42','2026-09-16 12:50:42'),(9,9,2,2,240.00,NULL,NULL,3,'2026-09-16 16:48:17','2026-09-16 13:48:17','2026-09-16 13:48:17'),(10,10,2,2,120.00,NULL,NULL,3,'2026-09-16 16:50:05','2026-09-16 13:50:05','2026-09-16 13:50:05'),(11,11,NULL,2,360.00,NULL,NULL,4,'2026-09-22 23:10:21','2026-09-22 20:10:21','2026-09-22 20:10:21'),(12,12,NULL,2,120.00,NULL,NULL,4,'2026-09-23 00:39:02','2026-09-22 21:39:02','2026-09-22 21:39:02'),(13,13,NULL,2,120.00,NULL,NULL,4,'2026-09-23 00:39:26','2026-09-22 21:39:26','2026-09-22 21:39:26'),(14,14,NULL,2,120.00,NULL,NULL,3,'2026-09-25 22:15:21','2026-09-25 19:15:21','2026-09-25 19:15:21'),(15,15,NULL,3,120.00,NULL,NULL,3,'2026-09-25 22:26:01','2026-09-25 19:26:01','2026-09-25 19:26:01'),(16,16,NULL,3,120.00,'gfds5432',NULL,3,'2026-09-25 22:26:20','2026-09-25 19:26:20','2026-09-25 19:26:20'),(17,17,NULL,3,120.00,'WERT5',NULL,3,'2026-09-25 22:41:00','2026-09-25 19:41:00','2026-09-25 19:41:00');
/*!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 AUTO_INCREMENT=5 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 */;
INSERT INTO `payroll_entries` VALUES (1,1,2,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL,NULL,NULL,NULL,NULL,'2026-09-22 17:26:57','2026-09-22 17:26:57'),(2,1,3,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL,NULL,NULL,NULL,NULL,'2026-09-22 17:26:57','2026-09-22 17:26:57'),(3,1,4,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL,NULL,NULL,NULL,NULL,'2026-09-22 17:26:57','2026-09-22 17:26:57');
/*!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 AUTO_INCREMENT=3 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 */;
INSERT INTO `payroll_runs` VALUES (1,'PAY00001',2,'2026-09-01','2026-09-30','2026-09-30','finalised',0.00,0.00,0.00,3,3,'2026-09-22 20:27:27','2026-09-22 17:26:57','2026-09-22 17:27:27');
/*!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=425 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,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(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,1,'2026-09-15 17:02:34','2026-09-15 17:02:34'),(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,1,'2026-09-15 17:12:01','2026-09-15 17:12:01'),(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');
/*!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 `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,
  `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`),
  CONSTRAINT `products_tax_rate_id_foreign` FOREIGN KEY (`tax_rate_id`) REFERENCES `tax_rates` (`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 `products`
--

LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (1,'GRACIE YOGHURT 500ML','1','single','inventory',2,1,2,NULL,100.00,170.00,160.00,NULL,1,NULL,0.00,5.00,1,1,'inclusive','standard',16.00,1,NULL,NULL,NULL,NULL,1,'2026-09-14 18:27:58','2026-09-16 12:50:42'),(2,'SUPA LOAF','2','single','inventory',3,2,NULL,NULL,100.00,190.00,150.00,NULL,1,NULL,8.00,10.00,2,1,'inclusive','standard',16.00,1,NULL,NULL,NULL,NULL,1,'2026-09-14 18:36:11','2026-09-16 11:09:52'),(3,'ilara yoghurt 500ml','3','single','inventory',2,1,2,NULL,70.00,120.00,100.00,NULL,1,NULL,6.00,0.00,1,1,'inclusive','standard',16.00,1,1,1,1,NULL,1,'2026-09-16 13:17:50','2026-09-25 19:41:00');
/*!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 AUTO_INCREMENT=2 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 */;
INSERT INTO `project_members` VALUES (1,1,2,NULL,100,'2026-09-22 17:18:21','2026-09-22 17:18:21');
/*!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 AUTO_INCREMENT=2 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 */;
INSERT INTO `project_milestones` VALUES (1,1,3,'location received','2026-09-22','pending',NULL,NULL,'2026-09-22 17:21:50','2026-09-22 17:21:50');
/*!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 AUTO_INCREMENT=3 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 */;
INSERT INTO `project_tasks` VALUES (1,'PT000001',1,NULL,3,3,'Demo done',NULL,'in_progress','medium',NULL,'2026-09-22',NULL,0.00,0.00,20,NULL,'2026-09-22 17:19:48','2026-09-22 17:21:05');
/*!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 AUTO_INCREMENT=2 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 */;
INSERT INTO `project_updates` VALUES (1,1,3,'2026-09-22','on_track',40,'Demo done','demo done','no backups','data entry to begin','2026-09-22 17:22:37','2026-09-22 17:22:37');
/*!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 AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `projects`
--

LOCK TABLES `projects` WRITE;
/*!40000 ALTER TABLE `projects` DISABLE KEYS */;
INSERT INTO `projects` VALUES (1,'PRJ00001',2,2,1,2,'Mutti matt','active','medium','on_track','2026-09-22','2026-09-24',NULL,100000.00,30000.00,40,'POS installation',NULL,3,'2026-09-22 17:18:21','2026-09-22 17:23:10');
/*!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,
  `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`)
) ENGINE=InnoDB AUTO_INCREMENT=4 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 */;
INSERT INTO `purchase_items` VALUES (1,1,2,'SUPA LOAF','2',10.00,0.00,100.00,0.00,137.93,1000.00,NULL,'2026-09-14 18:36:48','2026-09-14 18:36:48'),(2,2,1,'GRACIE YOGHURT 500ML','1',4.00,0.00,100.00,0.00,55.17,400.00,NULL,'2026-09-15 11:25:35','2026-09-15 11:25:35'),(3,3,3,'ilara yoghurt 500ml','3',10.00,0.00,70.00,0.00,96.55,700.00,NULL,'2026-09-25 19:10:37','2026-09-25 19:10:37');
/*!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 AUTO_INCREMENT=4 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 */;
INSERT INTO `purchase_payments` VALUES (1,1,2,1000.00,NULL,3,'2026-09-14 21:36:48',NULL,'2026-09-14 18:36:48','2026-09-14 18:36:48'),(2,2,2,400.00,NULL,3,'2026-09-15 14:25:35',NULL,'2026-09-15 11:25:35','2026-09-15 11:25:35'),(3,3,2,700.00,NULL,3,'2026-09-25 22:11:27',NULL,'2026-09-25 19:11:27','2026-09-25 19:11:27');
/*!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 AUTO_INCREMENT=4 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 */;
INSERT INTO `purchases` VALUES (1,'P0001',2,3,1,1,'Default',NULL,'received','paid',862.07,0.00,137.93,1000.00,1000.00,0.00,'2026-09-14 21:36:00',NULL,'2026-09-14 18:36:48','2026-09-14 18:36:48',NULL,NULL,NULL),(2,'P0002',2,3,1,1,'Default',NULL,'received','paid',344.83,0.00,55.17,400.00,400.00,0.00,'2026-09-15 14:25:00',NULL,'2026-09-15 11:25:35','2026-09-15 11:25:35',NULL,NULL,NULL),(3,'P0003',2,3,NULL,1,'Default',NULL,'received','paid',603.45,0.00,96.55,700.00,700.00,0.00,'2026-09-25 22:10:00',NULL,'2026-09-25 19:10:37','2026-09-25 19:11:27',NULL,NULL,NULL);
/*!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,
  `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=5 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');
/*!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=60 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 (30,45,1,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(31,45,2,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(32,45,3,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(33,45,6,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(34,45,7,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(35,45,15,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(36,45,24,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(37,45,21,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(38,45,22,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(39,45,16,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(40,45,17,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(41,45,4,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(42,45,8,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(43,45,5,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(44,45,28,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(45,45,25,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(46,45,10,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(47,45,9,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(48,45,18,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(49,45,11,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(50,45,14,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(51,45,23,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(52,45,26,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(53,45,27,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(54,45,29,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(55,45,30,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(56,45,20,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(57,45,12,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(58,45,13,1,0,0,0,0,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(59,46,2,1,0,0,0,0,'2026-09-22 20:07:06','2026-09-22 20:07:06');
/*!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=571 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 (308,45,218,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(309,45,200,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(310,45,219,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(311,45,221,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(312,45,224,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(313,45,225,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(314,45,226,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(315,45,228,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(316,45,229,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(317,45,230,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(318,45,231,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(319,45,232,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(320,45,233,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(321,45,234,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(322,45,235,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(323,45,236,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(324,45,237,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(325,45,280,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(326,45,281,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(327,45,282,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(328,45,283,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(329,45,284,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(330,45,285,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(331,45,286,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(332,45,287,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(333,45,288,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(334,45,289,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(335,45,290,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(336,45,291,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(337,45,292,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(338,45,293,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(339,45,294,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(340,45,295,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(341,45,296,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(342,45,297,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(343,45,298,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(344,45,299,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(345,45,374,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(346,45,379,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(347,45,380,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(348,45,381,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(349,45,382,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(350,45,383,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(351,45,384,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(352,45,385,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(353,45,238,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(354,45,239,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(355,45,240,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(356,45,241,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(357,45,242,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(358,45,243,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(359,45,244,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(360,45,245,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(361,45,246,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(362,45,247,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(363,45,248,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(364,45,257,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(365,45,258,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(366,45,259,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(367,45,260,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(368,45,261,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(369,45,249,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(370,45,250,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(371,45,251,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(372,45,252,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(373,45,253,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(374,45,254,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(375,45,255,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(376,45,256,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(377,45,262,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(378,45,263,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(379,45,264,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(380,45,265,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(381,45,335,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(382,45,336,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(383,45,337,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(384,45,338,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(385,45,339,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(386,45,340,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(387,45,341,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(388,45,342,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(389,45,343,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(390,45,271,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(391,45,272,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(392,45,273,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(393,45,162,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(394,45,163,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(395,45,164,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(396,45,165,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(397,45,166,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(398,45,266,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(399,45,300,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(400,45,301,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(401,45,302,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(402,45,303,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(403,45,304,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(404,45,305,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(405,45,306,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(406,45,307,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(407,45,375,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(408,45,376,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(409,45,377,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(410,45,378,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(411,45,167,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(412,45,168,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(413,45,169,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(414,45,170,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(415,45,267,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(416,45,268,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(417,45,269,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(418,45,270,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(419,45,362,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(420,45,363,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(421,45,359,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(422,45,360,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(423,45,361,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(424,45,316,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(425,45,317,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(426,45,318,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(427,45,319,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(428,45,320,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(429,45,321,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(430,45,322,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(431,45,323,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(432,45,324,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(433,45,191,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(434,45,192,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(435,45,193,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(436,45,194,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(437,45,195,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(438,45,196,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(439,45,197,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(440,45,198,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(441,45,199,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(442,45,311,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(443,45,312,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(444,45,313,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(445,45,314,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(446,45,315,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(447,45,364,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(448,45,365,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(449,45,366,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(450,45,367,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(451,45,368,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(452,45,386,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(453,45,387,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(454,45,388,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(455,45,389,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(456,45,182,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(457,45,183,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(458,45,184,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(459,45,185,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(460,45,325,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(461,45,326,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(462,45,327,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(463,45,328,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(464,45,329,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(465,45,181,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(466,45,398,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(467,45,399,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(468,45,400,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(469,45,401,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(470,45,402,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(471,45,403,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(472,45,404,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(473,45,405,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(474,45,413,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(475,45,414,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(476,45,415,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(477,45,416,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(478,45,417,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(479,45,418,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(480,45,419,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(481,45,201,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(482,45,202,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(483,45,203,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(484,45,204,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(485,45,205,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(486,45,206,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(487,45,207,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(488,45,208,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(489,45,209,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(490,45,210,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(491,45,211,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(492,45,212,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(493,45,213,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(494,45,214,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(495,45,215,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(496,45,216,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(497,45,217,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(498,45,344,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(499,45,345,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(500,45,346,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(501,45,347,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(502,45,348,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(503,45,349,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(504,45,350,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(505,45,351,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(506,45,352,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(507,45,353,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(508,45,354,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(509,45,355,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(510,45,356,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(511,45,357,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(512,45,358,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(513,45,390,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(514,45,391,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(515,45,392,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(516,45,393,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(517,45,394,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(518,45,395,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(519,45,396,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(520,45,397,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(521,45,406,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(522,45,407,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(523,45,408,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(524,45,409,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(525,45,410,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(526,45,411,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(527,45,412,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(528,45,274,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(529,45,275,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(530,45,276,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(531,45,277,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(532,45,278,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(533,45,279,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(534,45,171,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(535,45,172,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(536,45,173,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(537,45,174,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(538,45,175,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(539,45,176,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(540,45,177,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(541,45,178,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(542,45,179,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(543,45,180,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(544,45,186,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(545,45,187,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(546,45,188,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(547,45,189,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(548,45,190,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(549,45,330,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(550,45,331,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(551,45,332,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(552,45,333,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(553,45,334,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(554,45,369,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(555,45,370,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(556,45,371,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(557,45,372,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(558,45,373,1,'2026-09-22 20:05:39','2026-09-22 20:05:39'),(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'),(565,45,420,1,'2026-09-22 21:57:12','2026-09-22 21:57:12'),(566,45,421,1,'2026-09-25 18:42:52','2026-09-25 18:42:52'),(567,46,421,0,'2026-09-25 18:42:52','2026-09-25 18:42:52'),(568,45,422,1,'2026-09-25 21:27:39','2026-09-25 21:27:39'),(569,45,423,1,'2026-09-25 21:27:39','2026-09-25 21:27:39'),(570,45,424,1,'2026-09-25 21:27:39','2026-09-25 21:27:39');
/*!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,
  `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,1,'2026-05-19 02:20:01','2026-05-19 02:20:01'),(46,'cashier','CASHIER',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,
  `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=18 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,1,1,'GRACIE YOGHURT 500ML','1',2.00,170.00,0.00,46.90,340.00,'Pcs','2026-09-14 18:30:18','2026-09-14 18:30:18'),(2,2,1,1,'GRACIE YOGHURT 500ML','1',3.00,170.00,0.00,70.34,510.00,'Pcs','2026-09-14 18:31:57','2026-09-14 18:31:57'),(3,3,1,1,'GRACIE YOGHURT 500ML','1',3.00,170.00,0.00,70.34,510.00,'Pcs','2026-09-14 18:50:24','2026-09-14 18:50:24'),(4,4,1,1,'GRACIE YOGHURT 500ML','1',2.00,170.00,0.00,46.90,340.00,'Pcs','2026-09-14 19:06:17','2026-09-14 19:06:17'),(5,5,1,1,'GRACIE YOGHURT 500ML','1',1.00,170.00,0.00,23.45,170.00,'Pcs','2026-09-14 19:32:09','2026-09-14 19:32:09'),(6,6,1,1,'GRACIE YOGHURT 500ML','1',1.00,170.00,0.00,23.45,170.00,'Pcs','2026-09-14 19:32:34','2026-09-14 19:32:34'),(7,7,1,1,'GRACIE YOGHURT 500ML','1',1.00,170.00,0.00,23.45,170.00,'Pcs','2026-09-16 10:48:16','2026-09-16 10:48:16'),(8,8,1,1,'GRACIE YOGHURT 500ML','1',1.00,170.00,0.00,23.45,170.00,'Pcs','2026-09-16 12:50:42','2026-09-16 12:50:42'),(9,9,2,3,'ilara yoghurt 500ml','3',2.00,120.00,0.00,33.10,240.00,'Pcs','2026-09-16 13:48:17','2026-09-16 13:48:17'),(10,10,2,3,'ilara yoghurt 500ml','3',1.00,120.00,0.00,16.55,120.00,'Pcs','2026-09-16 13:50:05','2026-09-16 13:50:05'),(11,11,NULL,3,'ilara yoghurt 500ml','3',3.00,120.00,0.00,49.66,360.00,'Pcs','2026-09-22 20:10:21','2026-09-22 20:10:21'),(12,12,NULL,3,'ilara yoghurt 500ml','3',1.00,120.00,0.00,16.55,120.00,'Pcs','2026-09-22 21:39:01','2026-09-22 21:39:01'),(13,13,NULL,3,'ilara yoghurt 500ml','3',1.00,120.00,0.00,16.55,120.00,'Pcs','2026-09-22 21:39:26','2026-09-22 21:39:26'),(14,14,NULL,3,'ilara yoghurt 500ml','3',1.00,120.00,0.00,16.55,120.00,'Pcs','2026-09-25 19:15:21','2026-09-25 19:15:21'),(15,15,NULL,3,'ilara yoghurt 500ml','3',1.00,120.00,0.00,16.55,120.00,'Pcs','2026-09-25 19:26:01','2026-09-25 19:26:01'),(16,16,NULL,3,'ilara yoghurt 500ml','3',1.00,120.00,0.00,16.55,120.00,'Pcs','2026-09-25 19:26:20','2026-09-25 19:26:20'),(17,17,NULL,3,'ilara yoghurt 500ml','3',1.00,120.00,0.00,16.55,120.00,'Pcs','2026-09-25 19:41:00','2026-09-25 19:41:00');
/*!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=18 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,1,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,293.10,0.00,46.90,340.00,340.00,350.00,0.00,10.00,'2026-09-14 21:30:18',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-14 18:30:18','2026-09-14 18:30:18',NULL,NULL,NULL),(2,'0002',2,3,1,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,439.66,0.00,70.34,510.00,510.00,600.00,0.00,90.00,'2026-09-14 21:31:57',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-14 18:31:57','2026-09-14 18:31:57',NULL,NULL,NULL),(3,'0003',2,3,1,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,439.66,0.00,70.34,510.00,510.00,510.00,0.00,0.00,'2026-09-14 21:50:24',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-14 18:50:24','2026-09-14 18:50:24',NULL,NULL,NULL),(4,'0004',2,3,1,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,293.10,0.00,46.90,340.00,340.00,500.00,0.00,160.00,'2026-09-14 22:06:17',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-14 19:06:17','2026-09-14 19:06:17',NULL,NULL,NULL),(5,'0005',2,3,1,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,146.55,0.00,23.45,170.00,170.00,170.00,0.00,0.00,'2026-09-14 22:32:09',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-14 19:32:09','2026-09-14 19:32:09',NULL,NULL,NULL),(6,'0006',2,3,1,2,'Valentine','retail','pending','unpaid',NULL,1,NULL,'0741479897',146.55,0.00,23.45,170.00,0.00,0.00,170.00,0.00,'2026-09-14 22:32:34','0741479897',NULL,NULL,NULL,NULL,NULL,'2026-09-14 19:32:34','2026-09-14 19:32:34',NULL,NULL,NULL),(7,'0007',2,3,1,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,146.55,0.00,23.45,170.00,170.00,170.00,0.00,0.00,'2026-09-16 13:48:16',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-16 10:48:16','2026-09-16 10:48:16',NULL,NULL,NULL),(8,'0008',2,3,1,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,146.55,0.00,23.45,170.00,170.00,170.00,0.00,0.00,'2026-09-16 15:50:42',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-16 12:50:42','2026-09-16 12:50:42',NULL,NULL,NULL),(9,'0009',2,3,2,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,206.90,0.00,33.10,240.00,240.00,300.00,0.00,60.00,'2026-09-16 16:48:17',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-16 13:48:17','2026-09-16 13:48:17',NULL,NULL,NULL),(10,'0010',2,3,2,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,103.45,0.00,16.55,120.00,120.00,200.00,0.00,80.00,'2026-09-16 16:50:05',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-16 13:50:05','2026-09-16 13:50:05',NULL,NULL,NULL),(11,'0011',2,4,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,310.34,0.00,49.66,360.00,360.00,360.00,0.00,0.00,'2026-09-22 23:10:21',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-22 20:10:21','2026-09-22 20:10:21',NULL,NULL,NULL),(12,'0012',2,4,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,103.45,0.00,16.55,120.00,120.00,200.00,0.00,80.00,'2026-09-23 00:39:01',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-22 21:39:01','2026-09-22 21:39:01',NULL,NULL,NULL),(13,'0013',2,4,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,103.45,0.00,16.55,120.00,120.00,120.00,0.00,0.00,'2026-09-23 00:39:26',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-22 21:39:26','2026-09-22 21:39:26',NULL,NULL,NULL),(14,'0014',2,3,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,103.45,0.00,16.55,120.00,120.00,120.00,0.00,0.00,'2026-09-25 22:15:21',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-25 19:15:21','2026-09-25 19:15:21',NULL,NULL,NULL),(15,'0015',2,3,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,103.45,0.00,16.55,120.00,120.00,120.00,0.00,0.00,'2026-09-25 22:26:01',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-25 19:26:01','2026-09-25 19:26:01',NULL,NULL,NULL),(16,'0016',2,3,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,NULL,103.45,0.00,16.55,120.00,120.00,120.00,0.00,0.00,'2026-09-25 22:26:20',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-25 19:26:20','2026-09-25 19:26:20',NULL,NULL,NULL),(17,'0017',2,3,NULL,1,'Walk in','retail','completed','paid',NULL,1,NULL,'12345678',103.45,0.00,16.55,120.00,120.00,120.00,0.00,0.00,'2026-09-25 22:41:00','12345678',NULL,NULL,NULL,NULL,NULL,'2026-09-25 19:41:00','2026-09-25 19:41:00',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 AUTO_INCREMENT=6 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 */;
INSERT INTO `shift_stock_counts` VALUES (1,1,1,2,'1','GRACIE YOGHURT 500ML',10.00,14.00,0.00,4.00,0.00,0.00,NULL,0.00,100.00,170.00,NULL,NULL,'2026-09-14 18:29:41','2026-09-16 12:51:21'),(2,1,2,3,'2','SUPA LOAF',8.00,0.00,0.00,10.00,0.00,18.00,NULL,0.00,100.00,190.00,NULL,NULL,'2026-09-16 12:51:21','2026-09-16 12:51:21'),(3,2,1,2,'1','GRACIE YOGHURT 500ML',0.00,0.00,0.00,0.00,0.00,0.00,NULL,0.00,100.00,170.00,NULL,NULL,'2026-09-16 13:47:48','2026-09-16 13:47:48'),(4,2,3,2,'3','ilara yoghurt 500ml',10.00,0.00,0.00,0.00,0.00,10.00,NULL,0.00,70.00,120.00,NULL,NULL,'2026-09-16 13:47:48','2026-09-16 13:47:48'),(5,2,2,3,'2','SUPA LOAF',8.00,0.00,0.00,0.00,0.00,8.00,NULL,0.00,100.00,190.00,NULL,NULL,'2026-09-16 13:47:48','2026-09-16 13:47:48');
/*!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 AUTO_INCREMENT=3 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 */;
INSERT INTO `shifts` VALUES (1,'SH0001',2,3,'2026-09-14 21:29:41','2026-09-16 15:51:21',0.00,50.00,2170.00,-2120.00,'closed',NULL,NULL,'2026-09-14 18:29:41','2026-09-16 12:51:21'),(2,'SH0002',2,3,'2026-09-16 16:47:48',NULL,1000.00,NULL,0.00,0.00,'open','change',NULL,'2026-09-16 13:47:48','2026-09-16 13:47:48');
/*!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 AUTO_INCREMENT=2 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 AUTO_INCREMENT=4 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 */;
INSERT INTO `sub_categories` VALUES (1,2,2,'YOGHURT',NULL,NULL,1,'2026-09-14 18:26:36','2026-09-14 18:26:36'),(2,2,3,'BREAD',NULL,NULL,1,'2026-09-14 18:35:11','2026-09-14 18:35:11');
/*!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=31 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');
/*!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=91 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','username_password','2026-05-19 14:42:32','2026-09-25 20:49:28'),(2,'system','pos_mode','restaurant','2026-05-19 14:42:32','2026-07-08 02:40:25'),(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','00:00','2026-05-19 14:42:32','2026-05-19 14:42:32'),(6,'shift','shift_end_time','23:59','2026-05-19 14:42:32','2026-05-19 14:42:32'),(7,'etims','etims_enabled','no','2026-05-19 14:42:32','2026-05-19 14:42:32'),(8,'etims','hs_code_enabled','no','2026-05-19 14:42:32','2026-05-19 14:42:32'),(9,'invoice','auto_logout_after_order','yes','2026-05-19 14:42:32','2026-09-14 19:05:56'),(10,'invoice','print_mode','receipt_only','2026-05-19 14:42:32','2026-09-14 19:05:56'),(11,'system','default_landing_page','retail_pos','2026-05-25 08:56:54','2026-09-06 15:22:18'),(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','10','2026-09-05 21:23:20','2026-09-05 21:23:20'),(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','order_only','2026-09-06 09:57:28','2026-09-06 15:20:18'),(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','0','2026-09-07 07:18:11','2026-09-07 07:18:11'),(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','0','2026-09-07 08:07:07','2026-09-07 08:07:07'),(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-eyJ2IjoxLCJhY3RpdmF0aW9uX25vIjoiQUNUMDAwNCIsImNsaWVudF9uYW1lIjoiSkVWQVRFQ0giLCJjb21wdXRlcl9zZXJpYWwiOiJKRVYtRUZEQS1NWVIyIiwiZXhwaXJlc19hdCI6bnVsbCwiaXNzdWVkX2F0IjoiMjAyNi0wOS0xNiAxNDoyMDozMSJ9.e1f6d63aac24fb26b6657395ea25978706d257730d1bf41fab502fbdc021fb32','2026-09-15 13:25:39','2026-09-16 11:21:31'),(75,'license','license_activation_no','ACT0004','2026-09-15 13:25:39','2026-09-16 11:21:31'),(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','JEV-EFDA-MYR2','2026-09-16 11:15:38','2026-09-16 11:15:38'),(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','10','2026-09-25 19:38:13','2026-09-25 19:38:13'),(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');
/*!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 AUTO_INCREMENT=4 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) NOT 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 (2,1,2,'Admin',NULL,'admin','admin','Admin admin','admin@gmail.com','0727109484',NULL,'$2y$12$hcYuvr9Ce2lzoEbrP7FM4.22jAuIySHngkvV/VdTtYiftA8oqzOc2',NULL,45,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'2026-05-19 05:10:14','2026-05-19 05:10:36'),(3,2,2,'Valentine',NULL,'Muteshi','user','Valentine Muteshi','user@gmail.com','12345678',NULL,'$2y$12$vKmfElgYixnibUrK06xWJuOmTPuykfIMflRY8.G.WeRoMy6eTcJTa',NULL,45,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'2026-05-19 05:14:46','2026-09-14 15:59:42'),(4,2,2,'cashier',NULL,'cashier','cashier','cashier cashier','cashier@gmail.com','123456709',NULL,'$2y$12$NVCmfyoxE1X4tNGnu6CWyuwEbTD4dVFAVP0HAgQ3hLYqNnw0ikUya',NULL,46,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,'2026-05-19 05:15:45','2026-09-22 20:07:59');
/*!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-09-26  0:50:45
