-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 02, 2026 at 01:47 PM
-- Server version: 8.0.42
-- PHP Version: 8.3.7

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!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 */;

--
-- Database: `db_kaspos_21`
--

-- --------------------------------------------------------

--
-- Table structure for table `activity_log`
--

CREATE TABLE `activity_log` (
  `id` bigint UNSIGNED NOT NULL,
  `log_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject_id` bigint UNSIGNED DEFAULT NULL,
  `causer_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `causer_id` bigint UNSIGNED DEFAULT NULL,
  `properties` json DEFAULT NULL,
  `batch_uuid` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `activity_log`
--

INSERT INTO `activity_log` (`id`, `log_name`, `description`, `subject_type`, `event`, `subject_id`, `causer_type`, `causer_id`, `properties`, `batch_uuid`, `created_at`, `updated_at`) VALUES
(1, 'user', 'created', 'App\\Models\\User', 'created', 1, NULL, NULL, '{\"attributes\": {\"name\": \"Superadmin\", \"email\": \"superadmin@gmail.com\", \"password\": \"$2y$12$Zh33tk4vt.kTT.//8aLt4uZ4blA1VllHmQTXv97SFE.WsQ./yFTAW\", \"username\": \"Superadmin\"}}', NULL, '2026-02-02 14:45:28', '2026-02-02 14:45:28'),
(2, 'user', 'created', 'App\\Models\\User', 'created', 2, NULL, NULL, '{\"attributes\": {\"name\": \"Cashier-dev\", \"email\": \"cashier@dev.com\", \"password\": \"$2y$12$QgUutdVO14M53boIaJvB3.nRiz9T0UspU3mrSE9csoZlElAvutfpu\", \"username\": \"cashier-dev\"}}', NULL, '2026-02-02 14:45:33', '2026-02-02 14:45:33');

-- --------------------------------------------------------

--
-- Table structure for table `app_settings`
--

CREATE TABLE `app_settings` (
  `id` bigint UNSIGNED NOT NULL,
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `app_settings`
--

INSERT INTO `app_settings` (`id`, `key`, `name`, `description`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'self_order', 'Fitur Self Order', 'Izinkan aplikasi menggunakan fitur SELF ORDER (Order mandiri)', 1, '2026-02-02 14:46:04', '2026-02-02 14:46:04'),
(2, 'restaurant', 'Fitur Restoran', 'Izinkan aplikasi menggunakan fitur KDS (Kitchen Display)', 1, '2026-02-02 14:46:04', '2026-02-02 14:46:04'),
(3, 'waiter_service', 'Fitur Waiter Service', 'Izinkan aplikasi menggunakan fitur pelayanan waiter', 1, '2026-02-02 14:46:05', '2026-02-02 14:46:05'),
(4, 'partial_payments', 'Fitur Hutang', 'Izinkan aplikasi menggunakan fitur hutang pelanggan', 1, '2026-02-02 14:46:05', '2026-02-02 14:46:05');

-- --------------------------------------------------------

--
-- Table structure for table `bank_accounts`
--

CREATE TABLE `bank_accounts` (
  `id` bigint UNSIGNED NOT NULL,
  `bank_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `barcode_templates`
--

CREATE TABLE `barcode_templates` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `paper_type` enum('roll','sheet') COLLATE utf8mb4_unicode_ci NOT NULL,
  `paper_width_mm` decimal(8,2) NOT NULL,
  `paper_height_mm` decimal(8,2) DEFAULT NULL,
  `label_width_mm` decimal(8,2) NOT NULL,
  `label_height_mm` decimal(8,2) NOT NULL,
  `gap_horizontal_mm` decimal(8,2) NOT NULL DEFAULT '0.00',
  `gap_vertical_mm` decimal(8,2) NOT NULL DEFAULT '0.00',
  `margin_top_mm` decimal(8,2) NOT NULL DEFAULT '0.00',
  `margin_left_mm` decimal(8,2) NOT NULL DEFAULT '0.00',
  `columns` int UNSIGNED DEFAULT NULL,
  `rows` int UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `cache` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `cache_locks` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `cashier_shifts`
--

CREATE TABLE `cashier_shifts` (
  `id` bigint UNSIGNED NOT NULL,
  `shift_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `starting_cash` double NOT NULL DEFAULT '0',
  `ending_cash` double NOT NULL DEFAULT '0',
  `opened_at` datetime DEFAULT NULL,
  `closed_at` datetime DEFAULT NULL,
  `status` enum('open','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `checking_stocks`
--

CREATE TABLE `checking_stocks` (
  `id` bigint UNSIGNED NOT NULL,
  `no_ref` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `due_date` date NOT NULL,
  `type` enum('materials','products') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('draft','done') COLLATE utf8mb4_unicode_ci NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `checking_stock_details`
--

CREATE TABLE `checking_stock_details` (
  `id` bigint UNSIGNED NOT NULL,
  `checking_stock_id` bigint UNSIGNED NOT NULL,
  `items_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items_id` bigint UNSIGNED NOT NULL,
  `stock` double NOT NULL,
  `quantity` double NOT NULL,
  `price` double NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `client_licenses`
--

CREATE TABLE `client_licenses` (
  `id` bigint UNSIGNED NOT NULL,
  `license_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inactive',
  `domain` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activated_at` timestamp NULL DEFAULT NULL,
  `last_verified_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `coupons`
--

CREATE TABLE `coupons` (
  `id` bigint UNSIGNED NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('percentage','rupiah') COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `customers` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_points`
--

CREATE TABLE `customer_points` (
  `id` bigint UNSIGNED NOT NULL,
  `transaction_id` bigint UNSIGNED NOT NULL,
  `customer_id` bigint UNSIGNED NOT NULL,
  `point` double NOT NULL DEFAULT '0',
  `status` enum('expired','active','redeem') COLLATE utf8mb4_unicode_ci NOT NULL,
  `expired_date` date DEFAULT NULL,
  `change_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_point_settings`
--

CREATE TABLE `customer_point_settings` (
  `id` bigint UNSIGNED NOT NULL,
  `spend_amount` double NOT NULL,
  `point_earned` int NOT NULL,
  `expired_in_days` int NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `discount_packages`
--

CREATE TABLE `discount_packages` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_price` double NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `discount_package_items`
--

CREATE TABLE `discount_package_items` (
  `id` bigint UNSIGNED NOT NULL,
  `discount_package_id` bigint UNSIGNED NOT NULL,
  `items_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items_id` bigint UNSIGNED NOT NULL,
  `estimate_price` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `discount_products`
--

CREATE TABLE `discount_products` (
  `id` bigint UNSIGNED NOT NULL,
  `discount_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `discount_type` enum('nominal','percentage') COLLATE utf8mb4_unicode_ci NOT NULL,
  `discount_value` double NOT NULL,
  `discount_quantity` int NOT NULL,
  `all_products` tinyint(1) NOT NULL DEFAULT '0',
  `all_customers` 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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `discount_product_customers`
--

CREATE TABLE `discount_product_customers` (
  `id` bigint UNSIGNED NOT NULL,
  `discount_product_id` bigint UNSIGNED NOT NULL,
  `customer_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `discount_product_items`
--

CREATE TABLE `discount_product_items` (
  `id` bigint UNSIGNED NOT NULL,
  `discount_product_id` bigint UNSIGNED NOT NULL,
  `items_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `expenses`
--

CREATE TABLE `expenses` (
  `id` bigint UNSIGNED NOT NULL,
  `expensee_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reference_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date` date NOT NULL,
  `expense_category_id` bigint UNSIGNED NOT NULL,
  `expense_subcategory_id` bigint UNSIGNED NOT NULL,
  `amount` double NOT NULL,
  `payment_status` enum('paid','unpaid','partial') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpaid',
  `description` text COLLATE utf8mb4_unicode_ci,
  `file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `expense_categories`
--

CREATE TABLE `expense_categories` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `expense_payments`
--

CREATE TABLE `expense_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `expense_id` bigint UNSIGNED NOT NULL,
  `bank_account_id` bigint UNSIGNED DEFAULT NULL,
  `paid_at` date NOT NULL,
  `amount` double NOT NULL,
  `payment_method` enum('cash','transfer') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `expense_subcategories`
--

CREATE TABLE `expense_subcategories` (
  `id` bigint UNSIGNED NOT NULL,
  `expense_category_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint UNSIGNED NOT NULL,
  `reserved_at` int UNSIGNED DEFAULT NULL,
  `available_at` int UNSIGNED NOT NULL,
  `created_at` int UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `materials`
--

CREATE TABLE `materials` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_id` bigint UNSIGNED NOT NULL,
  `minimum_qty` double NOT NULL,
  `price` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `menus`
--

CREATE TABLE `menus` (
  `id` bigint UNSIGNED NOT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_id` bigint UNSIGNED NOT NULL,
  `capital_price` double DEFAULT NULL,
  `selling_price` double NOT NULL,
  `margin` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `migrations` (
  `id` int UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_04_07_004546_create_permission_tables', 1),
(5, '2025_04_09_074147_create_units_table', 1),
(6, '2025_04_10_002106_create_categories_table', 1),
(7, '2025_04_10_021710_create_tables_table', 1),
(8, '2025_04_14_022939_create_suppliers_table', 1),
(9, '2025_04_14_052939_create_materials_table', 1),
(10, '2025_04_17_002727_create_menus_table', 1),
(11, '2025_04_17_024538_create_receipes_table', 1),
(12, '2025_04_21_074228_create_products_table', 1),
(13, '2025_04_21_074411_create_product_variants_table', 1),
(14, '2025_04_24_071237_create_variant_options_table', 1),
(15, '2025_04_24_071254_create_variant_values_table', 1),
(16, '2025_04_24_071406_create_product_variant_values_table', 1),
(17, '2025_04_27_235544_create_stocks_table', 1),
(18, '2025_04_28_000207_create_stock_movements_table', 1),
(19, '2025_04_28_235325_add_has_stock_to_products_table', 1),
(20, '2025_05_03_024722_create_orders_table', 1),
(21, '2025_05_03_024728_create_order_details_table', 1),
(22, '2025_05_12_003731_add_capital_price_to_product_variants_table', 1),
(23, '2025_05_16_030901_add_payment_method_to_orders_table', 1),
(24, '2025_05_17_010344_create_bank_accounts_table', 1),
(25, '2025_05_17_053725_add_discount_to_orders_table', 1),
(26, '2025_05_17_055147_create_order_payments_table', 1),
(27, '2025_05_20_063834_add_notes_to_orders_table', 1),
(28, '2025_05_24_010031_create_purchase_returns_table', 1),
(29, '2025_05_24_010231_create_purchase_return_details_table', 1),
(30, '2025_06_02_053145_add_expired_at_to_purchase_return_details_table', 1),
(31, '2025_06_06_002916_create_checking_stocks_table', 1),
(32, '2025_06_06_002923_create_checking_stock_details_table', 1),
(33, '2025_06_11_003522_add_note_to_checking_stocks_table', 1),
(34, '2025_06_11_005710_create_expense_categories_table', 1),
(35, '2025_06_11_005719_create_expense_subcategories_table', 1),
(36, '2025_06_11_005729_create_expenses_table', 1),
(37, '2025_06_11_011417_create_expense_payments_table', 1),
(38, '2025_06_16_005807_add_file_to_expenses_table', 1),
(39, '2025_06_16_133525_add_created_by_to_expenses_table', 1),
(40, '2025_06_28_044012_create_shifts_table', 1),
(41, '2025_06_28_045511_create_customers_table', 1),
(42, '2025_07_05_060755_create_settings_table', 1),
(43, '2025_07_06_235828_create_coupons_table', 1),
(44, '2025_07_13_063202_create_customer_point_settings_table', 1),
(45, '2025_07_14_122244_create_discount_packages_table', 1),
(46, '2025_07_14_122341_create_discount_package_items_table', 1),
(47, '2025_07_18_022710_add_image_to_discount_packages_table', 1),
(48, '2025_07_20_094638_create_cashier_shifts_table', 1),
(49, '2025_07_20_103459_create_transactions_table', 1),
(50, '2025_07_20_103507_create_transaction_details_table', 1),
(51, '2025_07_25_080638_update_enum_transaction_type_on_transactions_table', 1),
(52, '2025_07_29_074629_add_transaction_date_to_transactions_table', 1),
(53, '2025_08_01_074431_add_bank_account_id_to_transactions_table', 1),
(54, '2025_08_03_022021_create_transaction_returns_table', 1),
(55, '2025_08_03_022027_create_transaction_return_details_table', 1),
(56, '2025_08_10_010351_create_discount_products_table', 1),
(57, '2025_08_10_010401_create_discount_product_items_table', 1),
(58, '2025_08_10_010627_create_discount_product_customers_table', 1),
(59, '2025_08_13_062827_create_customer_points_table', 1),
(60, '2025_08_15_132828_add_expired_date_to_customer_points_table', 1),
(61, '2025_08_19_005907_add_minimum_quantity_to_product_variants_table', 1),
(62, '2025_08_19_032903_create_transaction_payments_table', 1),
(63, '2025_09_08_142615_create_transaction_taxes_table', 1),
(64, '2025_09_11_193724_add_code_to_transaction_taxes_table', 1),
(65, '2025_09_12_081818_create_transaction_kitchens_table', 1),
(66, '2025_09_12_081829_create_transaction_kitchen_items_table', 1),
(67, '2025_09_29_083624_create_activity_log_table', 1),
(68, '2025_09_29_083625_add_event_column_to_activity_log_table', 1),
(69, '2025_09_29_083626_add_batch_uuid_column_to_activity_log_table', 1),
(70, '2025_12_02_113400_create_client_licenses_table', 1),
(71, '2026_01_19_134313_create_app_settings_table', 1),
(72, '2026_01_24_080253_create_barcode_templates_table', 1);

-- --------------------------------------------------------

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(4, 'App\\Models\\User', 1),
(7, 'App\\Models\\User', 2);

-- --------------------------------------------------------

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` bigint UNSIGNED NOT NULL,
  `order_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` bigint UNSIGNED NOT NULL,
  `order_date` date NOT NULL,
  `type` enum('materials','products') COLLATE utf8mb4_unicode_ci NOT NULL,
  `subtotal` double NOT NULL,
  `discount` double DEFAULT NULL,
  `discount_type` enum('percentage','rupiah') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `grand_total` double NOT NULL,
  `payment_method` enum('cash','transfer','credit') COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_status` enum('paid','unpaid','partial') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpaid',
  `order_status` enum('confirmed','received','pending') COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `order_details`
--

CREATE TABLE `order_details` (
  `id` bigint UNSIGNED NOT NULL,
  `order_id` bigint UNSIGNED NOT NULL,
  `items_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items_id` bigint UNSIGNED NOT NULL,
  `quantity` double NOT NULL,
  `price` double NOT NULL,
  `expired_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `order_payments`
--

CREATE TABLE `order_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `order_id` bigint UNSIGNED NOT NULL,
  `bank_account_id` bigint UNSIGNED DEFAULT NULL,
  `paid_at` date NOT NULL,
  `amount` double NOT NULL,
  `payment_method` enum('cash','transfer','retur') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `permissions` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'users-data', 'web', '2026-02-02 14:45:24', '2026-02-02 14:45:24'),
(2, 'users-create', 'web', '2026-02-02 14:45:24', '2026-02-02 14:45:24'),
(3, 'users-update', 'web', '2026-02-02 14:45:25', '2026-02-02 14:45:25'),
(4, 'users-delete', 'web', '2026-02-02 14:45:25', '2026-02-02 14:45:25'),
(5, 'users-show', 'web', '2026-02-02 14:45:25', '2026-02-02 14:45:25'),
(6, 'roles-data', 'web', '2026-02-02 14:45:25', '2026-02-02 14:45:25'),
(7, 'roles-create', 'web', '2026-02-02 14:45:25', '2026-02-02 14:45:25'),
(8, 'roles-update', 'web', '2026-02-02 14:45:26', '2026-02-02 14:45:26'),
(9, 'roles-delete', 'web', '2026-02-02 14:45:26', '2026-02-02 14:45:26'),
(10, 'permissions-data', 'web', '2026-02-02 14:45:26', '2026-02-02 14:45:26'),
(11, 'permissions-create', 'web', '2026-02-02 14:45:26', '2026-02-02 14:45:26'),
(12, 'permissions-update', 'web', '2026-02-02 14:45:27', '2026-02-02 14:45:27'),
(13, 'permissions-delete', 'web', '2026-02-02 14:45:27', '2026-02-02 14:45:27'),
(14, 'materials-data', 'web', '2026-02-02 14:45:29', '2026-02-02 14:45:29'),
(15, 'materials-create', 'web', '2026-02-02 14:45:29', '2026-02-02 14:45:29'),
(16, 'materials-update', 'web', '2026-02-02 14:45:29', '2026-02-02 14:45:29'),
(17, 'materials-delete', 'web', '2026-02-02 14:45:29', '2026-02-02 14:45:29'),
(18, 'materials-show', 'web', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(19, 'units-data', 'web', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(20, 'units-create', 'web', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(21, 'units-update', 'web', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(22, 'units-delete', 'web', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(23, 'pos-data', 'web', '2026-02-02 14:45:32', '2026-02-02 14:45:32'),
(24, 'checking-stocks-data', 'web', '2026-02-02 14:45:33', '2026-02-02 14:45:33'),
(25, 'checking-stocks-create', 'web', '2026-02-02 14:45:33', '2026-02-02 14:45:33'),
(26, 'checking-stocks-update', 'web', '2026-02-02 14:45:34', '2026-02-02 14:45:34'),
(27, 'checking-stocks-delete', 'web', '2026-02-02 14:45:34', '2026-02-02 14:45:34'),
(28, 'checking-stocks-show', 'web', '2026-02-02 14:45:34', '2026-02-02 14:45:34'),
(29, 'coupons-data', 'web', '2026-02-02 14:45:35', '2026-02-02 14:45:35'),
(30, 'coupons-create', 'web', '2026-02-02 14:45:35', '2026-02-02 14:45:35'),
(31, 'coupons-update', 'web', '2026-02-02 14:45:35', '2026-02-02 14:45:35'),
(32, 'coupons-delete', 'web', '2026-02-02 14:45:35', '2026-02-02 14:45:35'),
(33, 'coupons-show', 'web', '2026-02-02 14:45:36', '2026-02-02 14:45:36'),
(34, 'customers-data', 'web', '2026-02-02 14:45:36', '2026-02-02 14:45:36'),
(35, 'customers-create', 'web', '2026-02-02 14:45:36', '2026-02-02 14:45:36'),
(36, 'customers-update', 'web', '2026-02-02 14:45:37', '2026-02-02 14:45:37'),
(37, 'customers-delete', 'web', '2026-02-02 14:45:37', '2026-02-02 14:45:37'),
(38, 'customers-show', 'web', '2026-02-02 14:45:37', '2026-02-02 14:45:37'),
(39, 'discount-packages-data', 'web', '2026-02-02 14:45:38', '2026-02-02 14:45:38'),
(40, 'discount-packages-create', 'web', '2026-02-02 14:45:38', '2026-02-02 14:45:38'),
(41, 'discount-packages-update', 'web', '2026-02-02 14:45:38', '2026-02-02 14:45:38'),
(42, 'discount-packages-delete', 'web', '2026-02-02 14:45:39', '2026-02-02 14:45:39'),
(43, 'discount-packages-show', 'web', '2026-02-02 14:45:39', '2026-02-02 14:45:39'),
(44, 'discount-products-data', 'web', '2026-02-02 14:45:39', '2026-02-02 14:45:39'),
(45, 'discount-products-create', 'web', '2026-02-02 14:45:40', '2026-02-02 14:45:40'),
(46, 'discount-products-update', 'web', '2026-02-02 14:45:40', '2026-02-02 14:45:40'),
(47, 'discount-products-delete', 'web', '2026-02-02 14:45:40', '2026-02-02 14:45:40'),
(48, 'discount-products-show', 'web', '2026-02-02 14:45:40', '2026-02-02 14:45:40'),
(49, 'expense-categories-data', 'web', '2026-02-02 14:45:41', '2026-02-02 14:45:41'),
(50, 'expense-categories-create', 'web', '2026-02-02 14:45:41', '2026-02-02 14:45:41'),
(51, 'expense-categories-update', 'web', '2026-02-02 14:45:41', '2026-02-02 14:45:41'),
(52, 'expense-categories-delete', 'web', '2026-02-02 14:45:41', '2026-02-02 14:45:41'),
(53, 'expenses-data', 'web', '2026-02-02 14:45:42', '2026-02-02 14:45:42'),
(54, 'expenses-create', 'web', '2026-02-02 14:45:42', '2026-02-02 14:45:42'),
(55, 'expenses-update', 'web', '2026-02-02 14:45:42', '2026-02-02 14:45:42'),
(56, 'expenses-delete', 'web', '2026-02-02 14:45:43', '2026-02-02 14:45:43'),
(57, 'expenses-show', 'web', '2026-02-02 14:45:43', '2026-02-02 14:45:43'),
(58, 'expense-subcategories-data', 'web', '2026-02-02 14:45:44', '2026-02-02 14:45:44'),
(59, 'expense-subcategories-create', 'web', '2026-02-02 14:45:44', '2026-02-02 14:45:44'),
(60, 'expense-subcategories-update', 'web', '2026-02-02 14:45:44', '2026-02-02 14:45:44'),
(61, 'expense-subcategories-delete', 'web', '2026-02-02 14:45:44', '2026-02-02 14:45:44'),
(62, 'menus-data', 'web', '2026-02-02 14:45:45', '2026-02-02 14:45:45'),
(63, 'menus-create', 'web', '2026-02-02 14:45:45', '2026-02-02 14:45:45'),
(64, 'menus-update', 'web', '2026-02-02 14:45:45', '2026-02-02 14:45:45'),
(65, 'menus-delete', 'web', '2026-02-02 14:45:46', '2026-02-02 14:45:46'),
(66, 'orders-data', 'web', '2026-02-02 14:45:47', '2026-02-02 14:45:47'),
(67, 'orders-create', 'web', '2026-02-02 14:45:47', '2026-02-02 14:45:47'),
(68, 'orders-update', 'web', '2026-02-02 14:45:47', '2026-02-02 14:45:47'),
(69, 'orders-delete', 'web', '2026-02-02 14:45:47', '2026-02-02 14:45:47'),
(70, 'products-data', 'web', '2026-02-02 14:45:48', '2026-02-02 14:45:48'),
(71, 'products-create', 'web', '2026-02-02 14:45:48', '2026-02-02 14:45:48'),
(72, 'products-update', 'web', '2026-02-02 14:45:49', '2026-02-02 14:45:49'),
(73, 'products-delete', 'web', '2026-02-02 14:45:49', '2026-02-02 14:45:49'),
(74, 'products-show', 'web', '2026-02-02 14:45:49', '2026-02-02 14:45:49'),
(75, 'purchase-returns-data', 'web', '2026-02-02 14:45:50', '2026-02-02 14:45:50'),
(76, 'purchase-returns-create', 'web', '2026-02-02 14:45:50', '2026-02-02 14:45:50'),
(77, 'purchase-returns-update', 'web', '2026-02-02 14:45:50', '2026-02-02 14:45:50'),
(78, 'purchase-returns-delete', 'web', '2026-02-02 14:45:51', '2026-02-02 14:45:51'),
(79, 'purchase-returns-show', 'web', '2026-02-02 14:45:51', '2026-02-02 14:45:51'),
(80, 'report-cash-flow', 'web', '2026-02-02 14:45:51', '2026-02-02 14:45:51'),
(81, 'report-purchase', 'web', '2026-02-02 14:45:52', '2026-02-02 14:45:52'),
(82, 'report-sale', 'web', '2026-02-02 14:45:52', '2026-02-02 14:45:52'),
(83, 'report-stock', 'web', '2026-02-02 14:45:52', '2026-02-02 14:45:52'),
(84, 'report-card-stock', 'web', '2026-02-02 14:45:52', '2026-02-02 14:45:52'),
(85, 'report-profit-loss', 'web', '2026-02-02 14:45:53', '2026-02-02 14:45:53'),
(86, 'suppliers-data', 'web', '2026-02-02 14:45:53', '2026-02-02 14:45:53'),
(87, 'suppliers-create', 'web', '2026-02-02 14:45:53', '2026-02-02 14:45:53'),
(88, 'suppliers-update', 'web', '2026-02-02 14:45:54', '2026-02-02 14:45:54'),
(89, 'suppliers-delete', 'web', '2026-02-02 14:45:54', '2026-02-02 14:45:54'),
(90, 'suppliers-show', 'web', '2026-02-02 14:45:54', '2026-02-02 14:45:54'),
(91, 'transaction-kitchens-data', 'web', '2026-02-02 14:45:55', '2026-02-02 14:45:55'),
(92, 'transaction-kitchens-update', 'web', '2026-02-02 14:45:55', '2026-02-02 14:45:55'),
(93, 'transaction-returns-data', 'web', '2026-02-02 14:45:56', '2026-02-02 14:45:56'),
(94, 'transaction-returns-create', 'web', '2026-02-02 14:45:56', '2026-02-02 14:45:56'),
(95, 'transaction-returns-update', 'web', '2026-02-02 14:45:56', '2026-02-02 14:45:56'),
(96, 'transaction-returns-delete', 'web', '2026-02-02 14:45:56', '2026-02-02 14:45:56'),
(97, 'transaction-returns-show', 'web', '2026-02-02 14:45:57', '2026-02-02 14:45:57'),
(98, 'transactions-data', 'web', '2026-02-02 14:45:57', '2026-02-02 14:45:57'),
(99, 'transactions-payment', 'web', '2026-02-02 14:45:58', '2026-02-02 14:45:58'),
(100, 'transactions-receipt', 'web', '2026-02-02 14:45:58', '2026-02-02 14:45:58'),
(101, 'transactions-invoice', 'web', '2026-02-02 14:45:58', '2026-02-02 14:45:58'),
(102, 'transactions-delete', 'web', '2026-02-02 14:45:58', '2026-02-02 14:45:58'),
(103, 'settings-data', 'web', '2026-02-02 14:46:00', '2026-02-02 14:46:00'),
(104, 'settings-bank', 'web', '2026-02-02 14:46:00', '2026-02-02 14:46:00'),
(105, 'settings-shifts', 'web', '2026-02-02 14:46:00', '2026-02-02 14:46:00'),
(106, 'settings-setting', 'web', '2026-02-02 14:46:00', '2026-02-02 14:46:00'),
(107, 'settings-loyalty', 'web', '2026-02-02 14:46:00', '2026-02-02 14:46:00'),
(108, 'dashboard-data', 'web', '2026-02-02 14:46:01', '2026-02-02 14:46:01'),
(109, 'tables-data', 'web', '2026-02-02 14:46:01', '2026-02-02 14:46:01'),
(110, 'tables-create', 'web', '2026-02-02 14:46:02', '2026-02-02 14:46:02'),
(111, 'tables-update', 'web', '2026-02-02 14:46:02', '2026-02-02 14:46:02'),
(112, 'tables-delete', 'web', '2026-02-02 14:46:02', '2026-02-02 14:46:02'),
(113, 'report-audit-logs', 'web', '2026-02-02 14:46:03', '2026-02-02 14:46:03'),
(114, 'settings-module', 'web', '2026-02-02 14:46:04', '2026-02-02 14:46:04');

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` bigint UNSIGNED NOT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_id` bigint UNSIGNED NOT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `has_variant` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `has_stock` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `product_variants`
--

CREATE TABLE `product_variants` (
  `id` bigint UNSIGNED NOT NULL,
  `barcode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `product_id` bigint UNSIGNED NOT NULL,
  `unit_id` bigint UNSIGNED NOT NULL,
  `price` double NOT NULL,
  `capital_price` double NOT NULL,
  `minimum_quantity` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `product_variant_values`
--

CREATE TABLE `product_variant_values` (
  `id` bigint UNSIGNED NOT NULL,
  `product_variant_id` bigint UNSIGNED NOT NULL,
  `variant_value_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `purchase_returns`
--

CREATE TABLE `purchase_returns` (
  `id` bigint UNSIGNED NOT NULL,
  `order_id` bigint UNSIGNED NOT NULL,
  `return_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `return_date` date NOT NULL,
  `grand_total` text COLLATE utf8mb4_unicode_ci,
  `refund_method` enum('refund','replacement','debt_reduction') COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','confirmed') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `purchase_return_details`
--

CREATE TABLE `purchase_return_details` (
  `id` bigint UNSIGNED NOT NULL,
  `purchase_return_id` bigint UNSIGNED NOT NULL,
  `order_detail_id` bigint UNSIGNED NOT NULL,
  `quantity` double NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci,
  `expired_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `receipes`
--

CREATE TABLE `receipes` (
  `id` bigint UNSIGNED NOT NULL,
  `menu_id` bigint UNSIGNED NOT NULL,
  `material_id` bigint UNSIGNED NOT NULL,
  `quantity` double NOT NULL,
  `price` double NOT NULL,
  `total_price` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `roles` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'users-access', 'web', '2026-02-02 14:45:27', '2026-02-02 14:45:27'),
(2, 'roles-access', 'web', '2026-02-02 14:45:27', '2026-02-02 14:45:27'),
(3, 'permission-access', 'web', '2026-02-02 14:45:28', '2026-02-02 14:45:28'),
(4, 'super-admin', 'web', '2026-02-02 14:45:28', '2026-02-02 14:45:28'),
(5, 'materials-full-access', 'web', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(6, 'units-full-access', 'web', '2026-02-02 14:45:32', '2026-02-02 14:45:32'),
(7, 'cashier', 'web', '2026-02-02 14:45:32', '2026-02-02 14:45:32'),
(8, 'waiter', 'web', '2026-02-02 14:45:32', '2026-02-02 14:45:32'),
(9, 'checking-stocks-full-access', 'web', '2026-02-02 14:45:34', '2026-02-02 14:45:34'),
(10, 'coupons-full-access', 'web', '2026-02-02 14:45:36', '2026-02-02 14:45:36'),
(11, 'customers-full-access', 'web', '2026-02-02 14:45:37', '2026-02-02 14:45:37'),
(12, 'discount-packages-full-access', 'web', '2026-02-02 14:45:39', '2026-02-02 14:45:39'),
(13, 'discount-products-full-access', 'web', '2026-02-02 14:45:40', '2026-02-02 14:45:40'),
(14, 'expense-categories-full-access', 'web', '2026-02-02 14:45:42', '2026-02-02 14:45:42'),
(15, 'expenses-full-access', 'web', '2026-02-02 14:45:43', '2026-02-02 14:45:43'),
(16, 'expense-subcategories-full-access', 'web', '2026-02-02 14:45:44', '2026-02-02 14:45:44'),
(17, 'menus-full-access', 'web', '2026-02-02 14:45:46', '2026-02-02 14:45:46'),
(18, 'orders-full-access', 'web', '2026-02-02 14:45:48', '2026-02-02 14:45:48'),
(19, 'products-full-access', 'web', '2026-02-02 14:45:49', '2026-02-02 14:45:49'),
(20, 'purchase-returns-full-access', 'web', '2026-02-02 14:45:51', '2026-02-02 14:45:51'),
(21, 'reports-full-access', 'web', '2026-02-02 14:45:53', '2026-02-02 14:45:53'),
(22, 'suppliers-full-access', 'web', '2026-02-02 14:45:54', '2026-02-02 14:45:54'),
(23, 'transaction-kitchens-full-access', 'web', '2026-02-02 14:45:55', '2026-02-02 14:45:55'),
(24, 'transaction-returns-full-access', 'web', '2026-02-02 14:45:57', '2026-02-02 14:45:57'),
(25, 'transactions-full-access', 'web', '2026-02-02 14:45:58', '2026-02-02 14:45:58'),
(26, 'settings-full-access', 'web', '2026-02-02 14:46:00', '2026-02-02 14:46:00'),
(27, 'dashboard-full-access', 'web', '2026-02-02 14:46:01', '2026-02-02 14:46:01'),
(28, 'tables-full-access', 'web', '2026-02-02 14:46:03', '2026-02-02 14:46:03'),
(29, 'categories-full-access', 'web', '2026-02-02 14:46:03', '2026-02-02 14:46:03');

-- --------------------------------------------------------

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `role_id` bigint UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(1, 1),
(2, 1),
(3, 1),
(4, 1),
(5, 1),
(6, 2),
(7, 2),
(8, 2),
(9, 2),
(10, 3),
(11, 3),
(12, 3),
(13, 3),
(14, 5),
(15, 5),
(16, 5),
(17, 5),
(18, 5),
(19, 6),
(20, 6),
(21, 6),
(22, 6),
(23, 7),
(24, 9),
(25, 9),
(26, 9),
(27, 9),
(28, 9),
(29, 10),
(30, 10),
(31, 10),
(32, 10),
(33, 10),
(34, 11),
(35, 11),
(36, 11),
(37, 11),
(38, 11),
(39, 12),
(40, 12),
(41, 12),
(42, 12),
(43, 12),
(44, 13),
(45, 13),
(46, 13),
(47, 13),
(48, 13),
(49, 14),
(50, 14),
(51, 14),
(52, 14),
(53, 15),
(54, 15),
(55, 15),
(56, 15),
(57, 15),
(58, 16),
(59, 16),
(60, 16),
(61, 16),
(62, 17),
(63, 17),
(64, 17),
(65, 17),
(66, 18),
(67, 18),
(68, 18),
(69, 18),
(70, 19),
(71, 19),
(72, 19),
(73, 19),
(74, 19),
(75, 20),
(76, 20),
(77, 20),
(78, 20),
(79, 20),
(80, 21),
(81, 21),
(82, 21),
(83, 21),
(84, 21),
(85, 21),
(113, 21),
(86, 22),
(87, 22),
(88, 22),
(89, 22),
(90, 22),
(91, 23),
(92, 23),
(93, 24),
(94, 24),
(95, 24),
(96, 24),
(97, 24),
(98, 25),
(99, 25),
(100, 25),
(101, 25),
(102, 25),
(103, 26),
(104, 26),
(105, 26),
(106, 26),
(107, 26),
(114, 26),
(108, 27),
(109, 28),
(110, 28),
(111, 28),
(112, 28),
(49, 29),
(50, 29),
(51, 29),
(52, 29),
(58, 29),
(59, 29),
(60, 29),
(61, 29);

-- --------------------------------------------------------

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

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `name`, `code`, `value`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Nama Toko', 'NAME', 'Kaspos', 1, '2026-02-02 14:45:59', '2026-02-02 14:45:59'),
(2, 'Alamat Toko', 'ADDRESS', 'Jl. Kayu Utara No 5 Rt/Rw. 01/03 Matraman Jakarta Timur', 1, '2026-02-02 14:45:59', '2026-02-02 14:45:59'),
(3, 'Tlp Toko', 'PHONE', '085174334016', 1, '2026-02-02 14:45:59', '2026-02-02 14:45:59'),
(4, 'Logo Toko', 'LOGO', '/storage/logos/default.png', 1, '2026-02-02 14:45:59', '2026-02-02 14:45:59'),
(5, 'Server Bt 1', 'PRNT', '49535343-fe7d-4ae5-8fa9-9fafd205e455', 1, '2026-02-02 14:45:59', '2026-02-02 14:45:59'),
(6, 'Server Bt 2', 'PRNT', 'e7810a71-73ae-499d-8c15-faa9aef0c3f2', 1, '2026-02-02 14:45:59', '2026-02-02 14:45:59');

-- --------------------------------------------------------

--
-- Table structure for table `shifts`
--

CREATE TABLE `shifts` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shifts`
--

INSERT INTO `shifts` (`id`, `name`, `code`, `start_time`, `end_time`, `created_at`, `updated_at`) VALUES
(1, 'Pagi', '001', '08:00:00', '17:00:00', '2026-02-02 14:46:00', '2026-02-02 14:46:00');

-- --------------------------------------------------------

--
-- Table structure for table `stocks`
--

CREATE TABLE `stocks` (
  `id` bigint UNSIGNED NOT NULL,
  `stockable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stockable_id` bigint UNSIGNED NOT NULL,
  `batch_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` double NOT NULL,
  `expired_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `stock_movements`
--

CREATE TABLE `stock_movements` (
  `id` bigint UNSIGNED NOT NULL,
  `stock_id` bigint UNSIGNED NOT NULL,
  `type` enum('in','out') COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` double NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `suppliers`
--

CREATE TABLE `suppliers` (
  `id` bigint UNSIGNED NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `tables`
--

CREATE TABLE `tables` (
  `id` bigint UNSIGNED NOT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `capacity` int NOT NULL,
  `status` enum('available','occupied','reserved') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` bigint UNSIGNED NOT NULL,
  `invoice` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cashier_shift_id` bigint UNSIGNED NOT NULL,
  `customer_id` bigint UNSIGNED DEFAULT NULL,
  `waiter_id` bigint UNSIGNED DEFAULT NULL,
  `transaction_type` enum('dine_in','takeaway','platform') COLLATE utf8mb4_unicode_ci NOT NULL,
  `table_id` bigint UNSIGNED DEFAULT NULL,
  `platform` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coupon_id` bigint UNSIGNED DEFAULT NULL,
  `status` enum('unpaid','pending','paid','partial') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `notes_noref` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes_transaction_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_ref` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_status` enum('pending','shipped','delivered','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `payment_method` enum('cash','transfer') COLLATE utf8mb4_unicode_ci DEFAULT 'cash',
  `bank_account_id` bigint UNSIGNED DEFAULT NULL,
  `subtotal` double NOT NULL DEFAULT '0',
  `discount` double NOT NULL DEFAULT '0',
  `pay` double NOT NULL DEFAULT '0',
  `change` double NOT NULL DEFAULT '0',
  `grand_total` double NOT NULL DEFAULT '0',
  `transaction_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaction_details`
--

CREATE TABLE `transaction_details` (
  `id` bigint UNSIGNED NOT NULL,
  `transaction_id` bigint UNSIGNED NOT NULL,
  `items_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items_id` bigint UNSIGNED NOT NULL,
  `price` double NOT NULL,
  `quantity` double NOT NULL,
  `discount_type` enum('percentage','rupiah') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `discount` double DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaction_kitchens`
--

CREATE TABLE `transaction_kitchens` (
  `id` bigint UNSIGNED NOT NULL,
  `transaction_id` bigint UNSIGNED NOT NULL,
  `transaction_date` datetime NOT NULL,
  `status` enum('pending','onprogress','success') COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_finish` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaction_kitchen_items`
--

CREATE TABLE `transaction_kitchen_items` (
  `id` bigint UNSIGNED NOT NULL,
  `transaction_kitchen_id` bigint UNSIGNED NOT NULL,
  `transaction_detail_id` bigint UNSIGNED NOT NULL,
  `is_done` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaction_payments`
--

CREATE TABLE `transaction_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `transaction_id` bigint UNSIGNED NOT NULL,
  `bank_account_id` bigint UNSIGNED DEFAULT NULL,
  `paid_at` date NOT NULL,
  `amount` double NOT NULL,
  `payment_method` enum('cash','transfer') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaction_returns`
--

CREATE TABLE `transaction_returns` (
  `id` bigint UNSIGNED NOT NULL,
  `transaction_id` bigint UNSIGNED NOT NULL,
  `return_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `return_date` date NOT NULL,
  `grand_total` text COLLATE utf8mb4_unicode_ci,
  `refund_method` enum('refund','replacement') COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','confirmed') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaction_return_details`
--

CREATE TABLE `transaction_return_details` (
  `id` bigint UNSIGNED NOT NULL,
  `transaction_return_id` bigint UNSIGNED NOT NULL,
  `transaction_detail_id` bigint UNSIGNED NOT NULL,
  `quantity` double NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaction_taxes`
--

CREATE TABLE `transaction_taxes` (
  `id` bigint UNSIGNED NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES
(1, 'pcs', 'Pieces / buah', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(2, 'porsi', 'Porsi / sajian', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(3, 'kg', 'Kilogram', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(4, 'g', 'Gram', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(5, 'liter', 'Liter', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(6, 'ml', 'Milliliter', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(7, 'cup', 'Cup / gelas plastik', '2026-02-02 14:45:30', '2026-02-02 14:45:30'),
(8, 'gelas', 'Gelas', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(9, 'botol', 'Botol', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(10, 'kaleng', 'Kaleng', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(11, 'bungkus', 'Bungkus / pack', '2026-02-02 14:45:31', '2026-02-02 14:45:31'),
(12, 'pak', 'Pack', '2026-02-02 14:45:31', '2026-02-02 14:45:31');

-- --------------------------------------------------------

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

CREATE TABLE `users` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `name`, `username`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Superadmin', 'Superadmin', 'superadmin@gmail.com', NULL, '$2y$12$Zh33tk4vt.kTT.//8aLt4uZ4blA1VllHmQTXv97SFE.WsQ./yFTAW', NULL, '2026-02-02 14:45:28', '2026-02-02 14:45:28'),
(2, 'Cashier-dev', 'cashier-dev', 'cashier@dev.com', NULL, '$2y$12$QgUutdVO14M53boIaJvB3.nRiz9T0UspU3mrSE9csoZlElAvutfpu', NULL, '2026-02-02 14:45:33', '2026-02-02 14:45:33');

-- --------------------------------------------------------

--
-- Table structure for table `variant_options`
--

CREATE TABLE `variant_options` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `variant_values`
--

CREATE TABLE `variant_values` (
  `id` bigint UNSIGNED NOT NULL,
  `variant_option_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activity_log`
--
ALTER TABLE `activity_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subject` (`subject_type`,`subject_id`),
  ADD KEY `causer` (`causer_type`,`causer_id`),
  ADD KEY `activity_log_log_name_index` (`log_name`);

--
-- Indexes for table `app_settings`
--
ALTER TABLE `app_settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `bank_accounts`
--
ALTER TABLE `bank_accounts`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `barcode_templates`
--
ALTER TABLE `barcode_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`);

--
-- Indexes for table `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`);

--
-- Indexes for table `cashier_shifts`
--
ALTER TABLE `cashier_shifts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cashier_shifts_shift_id_foreign` (`shift_id`),
  ADD KEY `cashier_shifts_user_id_foreign` (`user_id`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `checking_stocks`
--
ALTER TABLE `checking_stocks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `checking_stocks_user_id_foreign` (`user_id`);

--
-- Indexes for table `checking_stock_details`
--
ALTER TABLE `checking_stock_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `checking_stock_details_checking_stock_id_foreign` (`checking_stock_id`),
  ADD KEY `checking_stock_details_items_type_items_id_index` (`items_type`,`items_id`);

--
-- Indexes for table `client_licenses`
--
ALTER TABLE `client_licenses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `client_licenses_license_key_unique` (`license_key`);

--
-- Indexes for table `coupons`
--
ALTER TABLE `coupons`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `customer_points`
--
ALTER TABLE `customer_points`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_points_transaction_id_foreign` (`transaction_id`),
  ADD KEY `customer_points_customer_id_foreign` (`customer_id`);

--
-- Indexes for table `customer_point_settings`
--
ALTER TABLE `customer_point_settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `discount_packages`
--
ALTER TABLE `discount_packages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `discount_package_items`
--
ALTER TABLE `discount_package_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `discount_package_items_discount_package_id_foreign` (`discount_package_id`),
  ADD KEY `discount_package_items_items_type_items_id_index` (`items_type`,`items_id`);

--
-- Indexes for table `discount_products`
--
ALTER TABLE `discount_products`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `discount_product_customers`
--
ALTER TABLE `discount_product_customers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `discount_product_customers_discount_product_id_foreign` (`discount_product_id`),
  ADD KEY `discount_product_customers_customer_id_foreign` (`customer_id`);

--
-- Indexes for table `discount_product_items`
--
ALTER TABLE `discount_product_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `discount_product_items_discount_product_id_foreign` (`discount_product_id`),
  ADD KEY `discount_product_items_items_type_items_id_index` (`items_type`,`items_id`);

--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `expenses_expense_category_id_foreign` (`expense_category_id`),
  ADD KEY `expenses_expense_subcategory_id_foreign` (`expense_subcategory_id`),
  ADD KEY `expenses_created_by_foreign` (`created_by`);

--
-- Indexes for table `expense_categories`
--
ALTER TABLE `expense_categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `expense_payments`
--
ALTER TABLE `expense_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `expense_payments_expense_id_foreign` (`expense_id`),
  ADD KEY `expense_payments_bank_account_id_foreign` (`bank_account_id`);

--
-- Indexes for table `expense_subcategories`
--
ALTER TABLE `expense_subcategories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `expense_subcategories_expense_category_id_foreign` (`expense_category_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

--
-- Indexes for table `job_batches`
--
ALTER TABLE `job_batches`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `materials`
--
ALTER TABLE `materials`
  ADD PRIMARY KEY (`id`),
  ADD KEY `materials_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `menus`
--
ALTER TABLE `menus`
  ADD PRIMARY KEY (`id`),
  ADD KEY `menus_category_id_foreign` (`category_id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `orders_supplier_id_foreign` (`supplier_id`),
  ADD KEY `orders_created_by_foreign` (`created_by`);

--
-- Indexes for table `order_details`
--
ALTER TABLE `order_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_details_order_id_foreign` (`order_id`),
  ADD KEY `order_details_items_type_items_id_index` (`items_type`,`items_id`);

--
-- Indexes for table `order_payments`
--
ALTER TABLE `order_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_payments_order_id_foreign` (`order_id`),
  ADD KEY `order_payments_bank_account_id_foreign` (`bank_account_id`);

--
-- Indexes for table `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `products_category_id_foreign` (`category_id`);

--
-- Indexes for table `product_variants`
--
ALTER TABLE `product_variants`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_variants_product_id_foreign` (`product_id`),
  ADD KEY `product_variants_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `product_variant_values`
--
ALTER TABLE `product_variant_values`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_variant_values_product_variant_id_foreign` (`product_variant_id`),
  ADD KEY `product_variant_values_variant_value_id_foreign` (`variant_value_id`);

--
-- Indexes for table `purchase_returns`
--
ALTER TABLE `purchase_returns`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `purchase_returns_return_code_unique` (`return_code`),
  ADD KEY `purchase_returns_order_id_foreign` (`order_id`),
  ADD KEY `purchase_returns_created_by_foreign` (`created_by`);

--
-- Indexes for table `purchase_return_details`
--
ALTER TABLE `purchase_return_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_return_details_purchase_return_id_foreign` (`purchase_return_id`),
  ADD KEY `purchase_return_details_order_detail_id_foreign` (`order_detail_id`);

--
-- Indexes for table `receipes`
--
ALTER TABLE `receipes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `receipes_menu_id_foreign` (`menu_id`),
  ADD KEY `receipes_material_id_foreign` (`material_id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `shifts`
--
ALTER TABLE `shifts`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `stocks`
--
ALTER TABLE `stocks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stocks_stockable_type_stockable_id_index` (`stockable_type`,`stockable_id`),
  ADD KEY `stocks_batch_code_index` (`batch_code`);

--
-- Indexes for table `stock_movements`
--
ALTER TABLE `stock_movements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_movements_stock_id_foreign` (`stock_id`);

--
-- Indexes for table `suppliers`
--
ALTER TABLE `suppliers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tables`
--
ALTER TABLE `tables`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tables_number_unique` (`number`);

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transactions_cashier_shift_id_foreign` (`cashier_shift_id`),
  ADD KEY `transactions_customer_id_foreign` (`customer_id`),
  ADD KEY `transactions_waiter_id_foreign` (`waiter_id`),
  ADD KEY `transactions_table_id_foreign` (`table_id`),
  ADD KEY `transactions_coupon_id_foreign` (`coupon_id`),
  ADD KEY `transactions_bank_account_id_foreign` (`bank_account_id`);

--
-- Indexes for table `transaction_details`
--
ALTER TABLE `transaction_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_details_items_type_items_id_index` (`items_type`,`items_id`);

--
-- Indexes for table `transaction_kitchens`
--
ALTER TABLE `transaction_kitchens`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_kitchens_transaction_id_foreign` (`transaction_id`);

--
-- Indexes for table `transaction_kitchen_items`
--
ALTER TABLE `transaction_kitchen_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_kitchen_items_transaction_kitchen_id_foreign` (`transaction_kitchen_id`),
  ADD KEY `transaction_kitchen_items_transaction_detail_id_foreign` (`transaction_detail_id`);

--
-- Indexes for table `transaction_payments`
--
ALTER TABLE `transaction_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_payments_transaction_id_foreign` (`transaction_id`),
  ADD KEY `transaction_payments_bank_account_id_foreign` (`bank_account_id`);

--
-- Indexes for table `transaction_returns`
--
ALTER TABLE `transaction_returns`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transaction_returns_return_code_unique` (`return_code`),
  ADD KEY `transaction_returns_transaction_id_foreign` (`transaction_id`),
  ADD KEY `transaction_returns_created_by_foreign` (`created_by`);

--
-- Indexes for table `transaction_return_details`
--
ALTER TABLE `transaction_return_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_return_details_transaction_return_id_foreign` (`transaction_return_id`),
  ADD KEY `transaction_return_details_transaction_detail_id_foreign` (`transaction_detail_id`);

--
-- Indexes for table `transaction_taxes`
--
ALTER TABLE `transaction_taxes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- Indexes for table `variant_options`
--
ALTER TABLE `variant_options`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `variant_values`
--
ALTER TABLE `variant_values`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variant_values_variant_option_id_foreign` (`variant_option_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `activity_log`
--
ALTER TABLE `activity_log`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `app_settings`
--
ALTER TABLE `app_settings`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `bank_accounts`
--
ALTER TABLE `bank_accounts`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `barcode_templates`
--
ALTER TABLE `barcode_templates`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `cashier_shifts`
--
ALTER TABLE `cashier_shifts`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `checking_stocks`
--
ALTER TABLE `checking_stocks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `checking_stock_details`
--
ALTER TABLE `checking_stock_details`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `client_licenses`
--
ALTER TABLE `client_licenses`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `coupons`
--
ALTER TABLE `coupons`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_points`
--
ALTER TABLE `customer_points`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_point_settings`
--
ALTER TABLE `customer_point_settings`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `discount_packages`
--
ALTER TABLE `discount_packages`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `discount_package_items`
--
ALTER TABLE `discount_package_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `discount_products`
--
ALTER TABLE `discount_products`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `discount_product_customers`
--
ALTER TABLE `discount_product_customers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `discount_product_items`
--
ALTER TABLE `discount_product_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expenses`
--
ALTER TABLE `expenses`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expense_categories`
--
ALTER TABLE `expense_categories`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expense_payments`
--
ALTER TABLE `expense_payments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expense_subcategories`
--
ALTER TABLE `expense_subcategories`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `materials`
--
ALTER TABLE `materials`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `menus`
--
ALTER TABLE `menus`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=73;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `order_details`
--
ALTER TABLE `order_details`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `order_payments`
--
ALTER TABLE `order_payments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=115;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product_variants`
--
ALTER TABLE `product_variants`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product_variant_values`
--
ALTER TABLE `product_variant_values`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `purchase_returns`
--
ALTER TABLE `purchase_returns`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `purchase_return_details`
--
ALTER TABLE `purchase_return_details`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `receipes`
--
ALTER TABLE `receipes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `shifts`
--
ALTER TABLE `shifts`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `stocks`
--
ALTER TABLE `stocks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `stock_movements`
--
ALTER TABLE `stock_movements`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `suppliers`
--
ALTER TABLE `suppliers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tables`
--
ALTER TABLE `tables`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_details`
--
ALTER TABLE `transaction_details`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_kitchens`
--
ALTER TABLE `transaction_kitchens`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_kitchen_items`
--
ALTER TABLE `transaction_kitchen_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_payments`
--
ALTER TABLE `transaction_payments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_returns`
--
ALTER TABLE `transaction_returns`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_return_details`
--
ALTER TABLE `transaction_return_details`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_taxes`
--
ALTER TABLE `transaction_taxes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `units`
--
ALTER TABLE `units`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `variant_options`
--
ALTER TABLE `variant_options`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `variant_values`
--
ALTER TABLE `variant_values`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `cashier_shifts`
--
ALTER TABLE `cashier_shifts`
  ADD CONSTRAINT `cashier_shifts_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cashier_shifts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `checking_stocks`
--
ALTER TABLE `checking_stocks`
  ADD CONSTRAINT `checking_stocks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `checking_stock_details`
--
ALTER TABLE `checking_stock_details`
  ADD CONSTRAINT `checking_stock_details_checking_stock_id_foreign` FOREIGN KEY (`checking_stock_id`) REFERENCES `checking_stocks` (`id`);

--
-- Constraints for table `customer_points`
--
ALTER TABLE `customer_points`
  ADD CONSTRAINT `customer_points_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_points_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `discount_package_items`
--
ALTER TABLE `discount_package_items`
  ADD CONSTRAINT `discount_package_items_discount_package_id_foreign` FOREIGN KEY (`discount_package_id`) REFERENCES `discount_packages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `discount_product_customers`
--
ALTER TABLE `discount_product_customers`
  ADD CONSTRAINT `discount_product_customers_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `discount_product_customers_discount_product_id_foreign` FOREIGN KEY (`discount_product_id`) REFERENCES `discount_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `discount_product_items`
--
ALTER TABLE `discount_product_items`
  ADD CONSTRAINT `discount_product_items_discount_product_id_foreign` FOREIGN KEY (`discount_product_id`) REFERENCES `discount_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `expenses`
--
ALTER TABLE `expenses`
  ADD CONSTRAINT `expenses_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `expenses_expense_category_id_foreign` FOREIGN KEY (`expense_category_id`) REFERENCES `expense_categories` (`id`),
  ADD CONSTRAINT `expenses_expense_subcategory_id_foreign` FOREIGN KEY (`expense_subcategory_id`) REFERENCES `expense_subcategories` (`id`);

--
-- Constraints for table `expense_payments`
--
ALTER TABLE `expense_payments`
  ADD CONSTRAINT `expense_payments_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `expense_payments_expense_id_foreign` FOREIGN KEY (`expense_id`) REFERENCES `expenses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `expense_subcategories`
--
ALTER TABLE `expense_subcategories`
  ADD CONSTRAINT `expense_subcategories_expense_category_id_foreign` FOREIGN KEY (`expense_category_id`) REFERENCES `expense_categories` (`id`);

--
-- Constraints for table `materials`
--
ALTER TABLE `materials`
  ADD CONSTRAINT `materials_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `menus`
--
ALTER TABLE `menus`
  ADD CONSTRAINT `menus_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
  ADD CONSTRAINT `orders_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `orders_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `order_details`
--
ALTER TABLE `order_details`
  ADD CONSTRAINT `order_details_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `order_payments`
--
ALTER TABLE `order_payments`
  ADD CONSTRAINT `order_payments_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `order_payments_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_variants`
--
ALTER TABLE `product_variants`
  ADD CONSTRAINT `product_variants_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_variants_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `product_variant_values`
--
ALTER TABLE `product_variant_values`
  ADD CONSTRAINT `product_variant_values_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `product_variant_values_variant_value_id_foreign` FOREIGN KEY (`variant_value_id`) REFERENCES `variant_values` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `purchase_returns`
--
ALTER TABLE `purchase_returns`
  ADD CONSTRAINT `purchase_returns_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `purchase_returns_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`);

--
-- Constraints for table `purchase_return_details`
--
ALTER TABLE `purchase_return_details`
  ADD CONSTRAINT `purchase_return_details_order_detail_id_foreign` FOREIGN KEY (`order_detail_id`) REFERENCES `order_details` (`id`),
  ADD CONSTRAINT `purchase_return_details_purchase_return_id_foreign` FOREIGN KEY (`purchase_return_id`) REFERENCES `purchase_returns` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `receipes`
--
ALTER TABLE `receipes`
  ADD CONSTRAINT `receipes_material_id_foreign` FOREIGN KEY (`material_id`) REFERENCES `materials` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `receipes_menu_id_foreign` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `stock_movements`
--
ALTER TABLE `stock_movements`
  ADD CONSTRAINT `stock_movements_stock_id_foreign` FOREIGN KEY (`stock_id`) REFERENCES `stocks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transactions`
--
ALTER TABLE `transactions`
  ADD CONSTRAINT `transactions_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transactions_cashier_shift_id_foreign` FOREIGN KEY (`cashier_shift_id`) REFERENCES `cashier_shifts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transactions_coupon_id_foreign` FOREIGN KEY (`coupon_id`) REFERENCES `coupons` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `transactions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `transactions_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transactions_waiter_id_foreign` FOREIGN KEY (`waiter_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `transaction_kitchens`
--
ALTER TABLE `transaction_kitchens`
  ADD CONSTRAINT `transaction_kitchens_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transaction_kitchen_items`
--
ALTER TABLE `transaction_kitchen_items`
  ADD CONSTRAINT `transaction_kitchen_items_transaction_detail_id_foreign` FOREIGN KEY (`transaction_detail_id`) REFERENCES `transaction_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `transaction_kitchen_items_transaction_kitchen_id_foreign` FOREIGN KEY (`transaction_kitchen_id`) REFERENCES `transaction_kitchens` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transaction_payments`
--
ALTER TABLE `transaction_payments`
  ADD CONSTRAINT `transaction_payments_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_payments_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transaction_returns`
--
ALTER TABLE `transaction_returns`
  ADD CONSTRAINT `transaction_returns_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `transaction_returns_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`);

--
-- Constraints for table `transaction_return_details`
--
ALTER TABLE `transaction_return_details`
  ADD CONSTRAINT `transaction_return_details_transaction_detail_id_foreign` FOREIGN KEY (`transaction_detail_id`) REFERENCES `transaction_details` (`id`),
  ADD CONSTRAINT `transaction_return_details_transaction_return_id_foreign` FOREIGN KEY (`transaction_return_id`) REFERENCES `transaction_returns` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `variant_values`
--
ALTER TABLE `variant_values`
  ADD CONSTRAINT `variant_values_variant_option_id_foreign` FOREIGN KEY (`variant_option_id`) REFERENCES `variant_options` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

/*!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 */;
