-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 29, 2026 at 03:03 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_23`
--

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

--
-- 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$bNB4KjrzyOUBNaeKyO.Syu57q.yHCYIMSwxpOki3DjVG4.0FwBc92\", \"username\": \"Superadmin\"}}', NULL, '2026-07-29 14:59:59', '2026-07-29 14:59:59'),
(2, 'user', 'created', 'App\\Models\\User', 'created', 2, NULL, NULL, '{\"attributes\": {\"name\": \"Cashier-dev\", \"email\": \"cashier@dev.com\", \"password\": \"$2y$12$UkcEQIayCCMLeMENBnnpJOkvx60StmndNjxTHmC7YR0n.sO0Syjqa\", \"username\": \"cashier-dev\"}}', NULL, '2026-07-29 15:00:05', '2026-07-29 15:00:05');

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

--
-- 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', 'Self Order', 'Mengaktifkan fitur pemesanan mandiri oleh pelanggan', 1, '2026-07-29 15:00:44', '2026-07-29 15:00:44'),
(2, 'self_order_payment', 'Pembayaran Self Order', 'Mengaktifkan popup pembayaran pada self order', 1, '2026-07-29 15:00:44', '2026-07-29 15:00:44'),
(3, 'restaurant', 'Mode Restoran', 'Mengaktifkan fitur bisnis restoran (meja, jenis pesanan, dll)', 1, '2026-07-29 15:00:44', '2026-07-29 15:00:44'),
(4, 'waiter_service', 'Staf layanan', 'Orang yang memberikan layanan langsung kepada pelanggan Contoh: Pelayan restoran, staf salon, dan petugas layanan lainnya', 1, '2026-07-29 15:00:44', '2026-07-29 15:00:44'),
(5, 'partial_payments', 'Pembayaran Bertahap', 'Mengaktifkan fitur pembayaran sebagian atau hutang pelanggan', 1, '2026-07-29 15:00:45', '2026-07-29 15:00:45'),
(6, 'queue', 'Fitur Antrian', 'Aktifkan atau nonaktifkan nomor antrian di POS dan pada nota transaksi', 1, '2026-07-29 15:00:45', '2026-07-29 15:00:45');

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

--
-- 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,
  `store_id` bigint UNSIGNED DEFAULT 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,
  `price_quantity` double 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 `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),
(73, '2026_06_19_000000_create_stores_and_add_store_id_columns', 1),
(74, '2026_06_19_000001_add_store_id_to_cashier_shifts_table', 1),
(75, '2026_06_19_000100_create_stock_transfers_table', 1),
(76, '2026_07_03_000000_add_queue_number_to_transactions_table', 1),
(77, '2026_07_05_000000_add_conversion_columns_to_units_table', 1),
(78, '2026_07_05_000000_add_unit_prices_to_product_variants_table', 1),
(79, '2026_07_06_115000_add_unit_columns_to_transaction_return_details_table', 1),
(80, '2026_07_06_120000_add_price_quantity_to_materials_table', 1),
(81, '2026_07_06_150000_add_unit_columns_to_order_details_table', 1),
(82, '2026_07_06_151000_add_unit_columns_to_purchase_return_details_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
(5, 'App\\Models\\User', 1),
(4, '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,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `unit_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` double 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-07-29 14:59:55', '2026-07-29 14:59:55'),
(2, 'users-create', 'web', '2026-07-29 14:59:55', '2026-07-29 14:59:55'),
(3, 'users-update', 'web', '2026-07-29 14:59:55', '2026-07-29 14:59:55'),
(4, 'users-delete', 'web', '2026-07-29 14:59:55', '2026-07-29 14:59:55'),
(5, 'users-show', 'web', '2026-07-29 14:59:56', '2026-07-29 14:59:56'),
(6, 'roles-data', 'web', '2026-07-29 14:59:56', '2026-07-29 14:59:56'),
(7, 'roles-create', 'web', '2026-07-29 14:59:56', '2026-07-29 14:59:56'),
(8, 'roles-update', 'web', '2026-07-29 14:59:56', '2026-07-29 14:59:56'),
(9, 'roles-delete', 'web', '2026-07-29 14:59:56', '2026-07-29 14:59:56'),
(10, 'permissions-data', 'web', '2026-07-29 14:59:56', '2026-07-29 14:59:56'),
(11, 'permissions-create', 'web', '2026-07-29 14:59:56', '2026-07-29 14:59:56'),
(12, 'permissions-update', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(13, 'permissions-delete', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(14, 'pos-data', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(15, 'stock-transfers-data', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(16, 'stock-transfers-show', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(17, 'stock-transfers-create', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(18, 'stock-transfers-update', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(19, 'stock-transfers-delete', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(20, 'store-DEFAULT-access', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(21, 'setting-data', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(22, 'settings-bank', 'web', '2026-07-29 14:59:57', '2026-07-29 14:59:57'),
(23, 'settings-shifts', 'web', '2026-07-29 14:59:58', '2026-07-29 14:59:58'),
(24, 'settings-setting', 'web', '2026-07-29 14:59:58', '2026-07-29 14:59:58'),
(25, 'settings-appearance', 'web', '2026-07-29 14:59:58', '2026-07-29 14:59:58'),
(26, 'settings-loyalty', 'web', '2026-07-29 14:59:58', '2026-07-29 14:59:58'),
(27, 'settings-stores', 'web', '2026-07-29 14:59:58', '2026-07-29 14:59:58'),
(28, 'materials-data', 'web', '2026-07-29 15:00:00', '2026-07-29 15:00:00'),
(29, 'materials-create', 'web', '2026-07-29 15:00:00', '2026-07-29 15:00:00'),
(30, 'materials-update', 'web', '2026-07-29 15:00:00', '2026-07-29 15:00:00'),
(31, 'materials-delete', 'web', '2026-07-29 15:00:01', '2026-07-29 15:00:01'),
(32, 'materials-show', 'web', '2026-07-29 15:00:01', '2026-07-29 15:00:01'),
(33, 'units-data', 'web', '2026-07-29 15:00:03', '2026-07-29 15:00:03'),
(34, 'units-create', 'web', '2026-07-29 15:00:03', '2026-07-29 15:00:03'),
(35, 'units-update', 'web', '2026-07-29 15:00:04', '2026-07-29 15:00:04'),
(36, 'units-delete', 'web', '2026-07-29 15:00:04', '2026-07-29 15:00:04'),
(37, 'checking-stocks-data', 'web', '2026-07-29 15:00:05', '2026-07-29 15:00:05'),
(38, 'checking-stocks-create', 'web', '2026-07-29 15:00:06', '2026-07-29 15:00:06'),
(39, 'checking-stocks-update', 'web', '2026-07-29 15:00:06', '2026-07-29 15:00:06'),
(40, 'checking-stocks-delete', 'web', '2026-07-29 15:00:07', '2026-07-29 15:00:07'),
(41, 'checking-stocks-show', 'web', '2026-07-29 15:00:07', '2026-07-29 15:00:07'),
(42, 'coupons-data', 'web', '2026-07-29 15:00:08', '2026-07-29 15:00:08'),
(43, 'coupons-create', 'web', '2026-07-29 15:00:08', '2026-07-29 15:00:08'),
(44, 'coupons-update', 'web', '2026-07-29 15:00:09', '2026-07-29 15:00:09'),
(45, 'coupons-delete', 'web', '2026-07-29 15:00:09', '2026-07-29 15:00:09'),
(46, 'coupons-show', 'web', '2026-07-29 15:00:09', '2026-07-29 15:00:09'),
(47, 'customers-data', 'web', '2026-07-29 15:00:10', '2026-07-29 15:00:10'),
(48, 'customers-create', 'web', '2026-07-29 15:00:10', '2026-07-29 15:00:10'),
(49, 'customers-update', 'web', '2026-07-29 15:00:10', '2026-07-29 15:00:10'),
(50, 'customers-delete', 'web', '2026-07-29 15:00:11', '2026-07-29 15:00:11'),
(51, 'customers-show', 'web', '2026-07-29 15:00:11', '2026-07-29 15:00:11'),
(52, 'discount-packages-data', 'web', '2026-07-29 15:00:12', '2026-07-29 15:00:12'),
(53, 'discount-packages-create', 'web', '2026-07-29 15:00:12', '2026-07-29 15:00:12'),
(54, 'discount-packages-update', 'web', '2026-07-29 15:00:12', '2026-07-29 15:00:12'),
(55, 'discount-packages-delete', 'web', '2026-07-29 15:00:13', '2026-07-29 15:00:13'),
(56, 'discount-packages-show', 'web', '2026-07-29 15:00:13', '2026-07-29 15:00:13'),
(57, 'discount-products-data', 'web', '2026-07-29 15:00:14', '2026-07-29 15:00:14'),
(58, 'discount-products-create', 'web', '2026-07-29 15:00:14', '2026-07-29 15:00:14'),
(59, 'discount-products-update', 'web', '2026-07-29 15:00:14', '2026-07-29 15:00:14'),
(60, 'discount-products-delete', 'web', '2026-07-29 15:00:14', '2026-07-29 15:00:14'),
(61, 'discount-products-show', 'web', '2026-07-29 15:00:15', '2026-07-29 15:00:15'),
(62, 'expense-categories-data', 'web', '2026-07-29 15:00:15', '2026-07-29 15:00:15'),
(63, 'expense-categories-create', 'web', '2026-07-29 15:00:16', '2026-07-29 15:00:16'),
(64, 'expense-categories-update', 'web', '2026-07-29 15:00:16', '2026-07-29 15:00:16'),
(65, 'expense-categories-delete', 'web', '2026-07-29 15:00:16', '2026-07-29 15:00:16'),
(66, 'expenses-data', 'web', '2026-07-29 15:00:17', '2026-07-29 15:00:17'),
(67, 'expenses-create', 'web', '2026-07-29 15:00:17', '2026-07-29 15:00:17'),
(68, 'expenses-update', 'web', '2026-07-29 15:00:17', '2026-07-29 15:00:17'),
(69, 'expenses-delete', 'web', '2026-07-29 15:00:18', '2026-07-29 15:00:18'),
(70, 'expenses-show', 'web', '2026-07-29 15:00:18', '2026-07-29 15:00:18'),
(71, 'expense-subcategories-data', 'web', '2026-07-29 15:00:19', '2026-07-29 15:00:19'),
(72, 'expense-subcategories-create', 'web', '2026-07-29 15:00:19', '2026-07-29 15:00:19'),
(73, 'expense-subcategories-update', 'web', '2026-07-29 15:00:20', '2026-07-29 15:00:20'),
(74, 'expense-subcategories-delete', 'web', '2026-07-29 15:00:20', '2026-07-29 15:00:20'),
(75, 'menus-data', 'web', '2026-07-29 15:00:21', '2026-07-29 15:00:21'),
(76, 'menus-create', 'web', '2026-07-29 15:00:21', '2026-07-29 15:00:21'),
(77, 'menus-update', 'web', '2026-07-29 15:00:22', '2026-07-29 15:00:22'),
(78, 'menus-delete', 'web', '2026-07-29 15:00:22', '2026-07-29 15:00:22'),
(79, 'orders-data', 'web', '2026-07-29 15:00:22', '2026-07-29 15:00:22'),
(80, 'orders-create', 'web', '2026-07-29 15:00:23', '2026-07-29 15:00:23'),
(81, 'orders-update', 'web', '2026-07-29 15:00:23', '2026-07-29 15:00:23'),
(82, 'orders-delete', 'web', '2026-07-29 15:00:23', '2026-07-29 15:00:23'),
(83, 'products-data', 'web', '2026-07-29 15:00:24', '2026-07-29 15:00:24'),
(84, 'products-create', 'web', '2026-07-29 15:00:24', '2026-07-29 15:00:24'),
(85, 'products-update', 'web', '2026-07-29 15:00:25', '2026-07-29 15:00:25'),
(86, 'products-delete', 'web', '2026-07-29 15:00:25', '2026-07-29 15:00:25'),
(87, 'products-show', 'web', '2026-07-29 15:00:25', '2026-07-29 15:00:25'),
(88, 'purchase-returns-data', 'web', '2026-07-29 15:00:26', '2026-07-29 15:00:26'),
(89, 'purchase-returns-create', 'web', '2026-07-29 15:00:27', '2026-07-29 15:00:27'),
(90, 'purchase-returns-update', 'web', '2026-07-29 15:00:27', '2026-07-29 15:00:27'),
(91, 'purchase-returns-delete', 'web', '2026-07-29 15:00:27', '2026-07-29 15:00:27'),
(92, 'purchase-returns-show', 'web', '2026-07-29 15:00:28', '2026-07-29 15:00:28'),
(93, 'report-cash-flow', 'web', '2026-07-29 15:00:28', '2026-07-29 15:00:28'),
(94, 'report-purchase', 'web', '2026-07-29 15:00:29', '2026-07-29 15:00:29'),
(95, 'report-sale', 'web', '2026-07-29 15:00:29', '2026-07-29 15:00:29'),
(96, 'report-stock', 'web', '2026-07-29 15:00:29', '2026-07-29 15:00:29'),
(97, 'report-card-stock', 'web', '2026-07-29 15:00:30', '2026-07-29 15:00:30'),
(98, 'report-profit-loss', 'web', '2026-07-29 15:00:30', '2026-07-29 15:00:30'),
(99, 'suppliers-data', 'web', '2026-07-29 15:00:31', '2026-07-29 15:00:31'),
(100, 'suppliers-create', 'web', '2026-07-29 15:00:31', '2026-07-29 15:00:31'),
(101, 'suppliers-update', 'web', '2026-07-29 15:00:31', '2026-07-29 15:00:31'),
(102, 'suppliers-delete', 'web', '2026-07-29 15:00:32', '2026-07-29 15:00:32'),
(103, 'suppliers-show', 'web', '2026-07-29 15:00:32', '2026-07-29 15:00:32'),
(104, 'transaction-kitchens-data', 'web', '2026-07-29 15:00:33', '2026-07-29 15:00:33'),
(105, 'transaction-kitchens-update', 'web', '2026-07-29 15:00:33', '2026-07-29 15:00:33'),
(106, 'transaction-returns-data', 'web', '2026-07-29 15:00:34', '2026-07-29 15:00:34'),
(107, 'transaction-returns-create', 'web', '2026-07-29 15:00:34', '2026-07-29 15:00:34'),
(108, 'transaction-returns-update', 'web', '2026-07-29 15:00:35', '2026-07-29 15:00:35'),
(109, 'transaction-returns-delete', 'web', '2026-07-29 15:00:35', '2026-07-29 15:00:35'),
(110, 'transaction-returns-show', 'web', '2026-07-29 15:00:35', '2026-07-29 15:00:35'),
(111, 'transactions-data', 'web', '2026-07-29 15:00:36', '2026-07-29 15:00:36'),
(112, 'transactions-show', 'web', '2026-07-29 15:00:36', '2026-07-29 15:00:36'),
(113, 'transactions-update', 'web', '2026-07-29 15:00:37', '2026-07-29 15:00:37'),
(114, 'transactions-payment', 'web', '2026-07-29 15:00:37', '2026-07-29 15:00:37'),
(115, 'transactions-receipt', 'web', '2026-07-29 15:00:37', '2026-07-29 15:00:37'),
(116, 'transactions-invoice', 'web', '2026-07-29 15:00:38', '2026-07-29 15:00:38'),
(117, 'transactions-delete', 'web', '2026-07-29 15:00:38', '2026-07-29 15:00:38'),
(118, 'settings-data', 'web', '2026-07-29 15:00:39', '2026-07-29 15:00:39'),
(119, 'settings-backup', 'web', '2026-07-29 15:00:39', '2026-07-29 15:00:39'),
(120, 'dashboard-data', 'web', '2026-07-29 15:00:40', '2026-07-29 15:00:40'),
(121, 'tables-data', 'web', '2026-07-29 15:00:41', '2026-07-29 15:00:41'),
(122, 'tables-create', 'web', '2026-07-29 15:00:41', '2026-07-29 15:00:41'),
(123, 'tables-update', 'web', '2026-07-29 15:00:41', '2026-07-29 15:00:41'),
(124, 'tables-delete', 'web', '2026-07-29 15:00:42', '2026-07-29 15:00:42'),
(125, 'categories-data', 'web', '2026-07-29 15:00:42', '2026-07-29 15:00:42'),
(126, 'categories-create', 'web', '2026-07-29 15:00:42', '2026-07-29 15:00:42'),
(127, 'categories-update', 'web', '2026-07-29 15:00:43', '2026-07-29 15:00:43'),
(128, 'categories-delete', 'web', '2026-07-29 15:00:43', '2026-07-29 15:00:43'),
(129, 'categories-show', 'web', '2026-07-29 15:00:43', '2026-07-29 15:00:43'),
(130, 'report-audit-logs', 'web', '2026-07-29 15:00:43', '2026-07-29 15:00:43'),
(131, 'settings-module', 'web', '2026-07-29 15:00:44', '2026-07-29 15:00:44'),
(132, 'barcode-data', 'web', '2026-07-29 15:00:45', '2026-07-29 15:00:45'),
(133, 'barcode-create', 'web', '2026-07-29 15:00:45', '2026-07-29 15:00:45'),
(134, 'barcode-update', 'web', '2026-07-29 15:00:46', '2026-07-29 15:00:46'),
(135, 'barcode-delete', 'web', '2026-07-29 15:00:46', '2026-07-29 15:00:46');

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

--
-- 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,
  `unit_prices` json 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 `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,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `unit_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` double 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-07-29 14:59:58', '2026-07-29 14:59:58'),
(2, 'roles-access', 'web', '2026-07-29 14:59:58', '2026-07-29 14:59:58'),
(3, 'permission-access', 'web', '2026-07-29 14:59:58', '2026-07-29 14:59:58'),
(4, 'cashier', 'web', '2026-07-29 14:59:59', '2026-07-29 14:59:59'),
(5, 'super-admin', 'web', '2026-07-29 14:59:59', '2026-07-29 14:59:59'),
(6, 'materials-full-access', 'web', '2026-07-29 15:00:01', '2026-07-29 15:00:01'),
(7, 'units-full-access', 'web', '2026-07-29 15:00:04', '2026-07-29 15:00:04'),
(8, 'waiter', 'web', '2026-07-29 15:00:05', '2026-07-29 15:00:05'),
(9, 'checking-stocks-full-access', 'web', '2026-07-29 15:00:07', '2026-07-29 15:00:07'),
(10, 'stock-transfers-full-access', 'web', '2026-07-29 15:00:08', '2026-07-29 15:00:08'),
(11, 'coupons-full-access', 'web', '2026-07-29 15:00:09', '2026-07-29 15:00:09'),
(12, 'customers-full-access', 'web', '2026-07-29 15:00:11', '2026-07-29 15:00:11'),
(13, 'discount-packages-full-access', 'web', '2026-07-29 15:00:13', '2026-07-29 15:00:13'),
(14, 'discount-products-full-access', 'web', '2026-07-29 15:00:15', '2026-07-29 15:00:15'),
(15, 'expense-categories-full-access', 'web', '2026-07-29 15:00:16', '2026-07-29 15:00:16'),
(16, 'expenses-full-access', 'web', '2026-07-29 15:00:18', '2026-07-29 15:00:18'),
(17, 'expense-subcategories-full-access', 'web', '2026-07-29 15:00:20', '2026-07-29 15:00:20'),
(18, 'menus-full-access', 'web', '2026-07-29 15:00:22', '2026-07-29 15:00:22'),
(19, 'orders-full-access', 'web', '2026-07-29 15:00:23', '2026-07-29 15:00:23'),
(20, 'products-full-access', 'web', '2026-07-29 15:00:26', '2026-07-29 15:00:26'),
(21, 'purchase-returns-full-access', 'web', '2026-07-29 15:00:28', '2026-07-29 15:00:28'),
(22, 'reports-full-access', 'web', '2026-07-29 15:00:30', '2026-07-29 15:00:30'),
(23, 'suppliers-full-access', 'web', '2026-07-29 15:00:32', '2026-07-29 15:00:32'),
(24, 'transaction-kitchens-full-access', 'web', '2026-07-29 15:00:33', '2026-07-29 15:00:33'),
(25, 'transaction-returns-full-access', 'web', '2026-07-29 15:00:35', '2026-07-29 15:00:35'),
(26, 'transactions-full-access', 'web', '2026-07-29 15:00:38', '2026-07-29 15:00:38'),
(27, 'settings-full-access', 'web', '2026-07-29 15:00:39', '2026-07-29 15:00:39'),
(28, 'dashboard-full-access', 'web', '2026-07-29 15:00:40', '2026-07-29 15:00:40'),
(29, 'tables-full-access', 'web', '2026-07-29 15:00:42', '2026-07-29 15:00:42'),
(30, 'categories-full-access', 'web', '2026-07-29 15:00:43', '2026-07-29 15:00:43'),
(31, 'barcode-full-access', 'web', '2026-07-29 15:00:46', '2026-07-29 15:00:46');

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

--
-- 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, 4),
(20, 4),
(28, 6),
(29, 6),
(30, 6),
(31, 6),
(32, 6),
(33, 7),
(34, 7),
(35, 7),
(36, 7),
(37, 9),
(38, 9),
(39, 9),
(40, 9),
(41, 9),
(15, 10),
(16, 10),
(17, 10),
(18, 10),
(19, 10),
(42, 11),
(43, 11),
(44, 11),
(45, 11),
(46, 11),
(47, 12),
(48, 12),
(49, 12),
(50, 12),
(51, 12),
(52, 13),
(53, 13),
(54, 13),
(55, 13),
(56, 13),
(57, 14),
(58, 14),
(59, 14),
(60, 14),
(61, 14),
(62, 15),
(63, 15),
(64, 15),
(65, 15),
(66, 16),
(67, 16),
(68, 16),
(69, 16),
(70, 16),
(71, 17),
(72, 17),
(73, 17),
(74, 17),
(75, 18),
(76, 18),
(77, 18),
(78, 18),
(79, 19),
(80, 19),
(81, 19),
(82, 19),
(83, 20),
(84, 20),
(85, 20),
(86, 20),
(87, 20),
(88, 21),
(89, 21),
(90, 21),
(91, 21),
(92, 21),
(93, 22),
(94, 22),
(95, 22),
(96, 22),
(97, 22),
(98, 22),
(130, 22),
(99, 23),
(100, 23),
(101, 23),
(102, 23),
(103, 23),
(104, 24),
(105, 24),
(106, 25),
(107, 25),
(108, 25),
(109, 25),
(110, 25),
(111, 26),
(112, 26),
(113, 26),
(114, 26),
(115, 26),
(116, 26),
(117, 26),
(22, 27),
(23, 27),
(24, 27),
(26, 27),
(118, 27),
(119, 27),
(131, 27),
(120, 28),
(121, 29),
(122, 29),
(123, 29),
(124, 29),
(125, 30),
(126, 30),
(127, 30),
(128, 30),
(129, 30),
(132, 31),
(133, 31),
(134, 31),
(135, 31);

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

--
-- 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-07-29 15:00:39', '2026-07-29 15:00:39'),
(2, 'Alamat Toko', 'ADDRESS', 'Jl. Kayu Utara No 5 Rt/Rw. 01/03 Matraman Jakarta Timur', 1, '2026-07-29 15:00:39', '2026-07-29 15:00:39'),
(3, 'Tlp Toko', 'PHONE', '085174334016', 1, '2026-07-29 15:00:39', '2026-07-29 15:00:39'),
(4, 'Logo Toko', 'LOGO', '/storage/logos/default.png', 1, '2026-07-29 15:00:39', '2026-07-29 15:00:39'),
(5, 'Server Bt 1', 'PRNT', '49535343-fe7d-4ae5-8fa9-9fafd205e455', 1, '2026-07-29 15:00:39', '2026-07-29 15:00:39'),
(6, 'Server Bt 2', 'PRNT', 'e7810a71-73ae-499d-8c15-faa9aef0c3f2', 1, '2026-07-29 15:00:39', '2026-07-29 15:00:39');

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

--
-- 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-07-29 15:00:39', '2026-07-29 15:00:39');

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

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

CREATE TABLE `stocks` (
  `id` bigint UNSIGNED NOT NULL,
  `store_id` bigint UNSIGNED DEFAULT 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 `stock_transfers`
--

CREATE TABLE `stock_transfers` (
  `id` bigint UNSIGNED NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `transfer_date` date NOT NULL,
  `from_store_id` bigint UNSIGNED NOT NULL,
  `to_store_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `notes` 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 `stock_transfer_details`
--

CREATE TABLE `stock_transfer_details` (
  `id` bigint UNSIGNED NOT NULL,
  `stock_transfer_id` bigint UNSIGNED NOT NULL,
  `stockable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stockable_id` bigint UNSIGNED NOT NULL,
  `quantity` 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 `stores`
--

CREATE TABLE `stores` (
  `id` bigint UNSIGNED NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 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 `stores`
--

INSERT INTO `stores` (`id`, `code`, `name`, `address`, `phone`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'DEFAULT', 'Default Store', NULL, NULL, 1, '2026-07-29 14:59:17', '2026-07-29 14:59:17');

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

--
-- 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,
  `store_id` bigint UNSIGNED DEFAULT 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,
  `queue_number` varchar(255) COLLATE utf8mb4_unicode_ci 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,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `unit_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` 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 `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,
  `parent_unit_id` bigint UNSIGNED DEFAULT NULL,
  `conversion_value` decimal(15,4) NOT NULL DEFAULT '1.0000'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

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

--
-- 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$bNB4KjrzyOUBNaeKyO.Syu57q.yHCYIMSwxpOki3DjVG4.0FwBc92', NULL, '2026-07-29 14:59:59', '2026-07-29 14:59:59'),
(2, 'Cashier-dev', 'cashier-dev', 'cashier@dev.com', NULL, '$2y$12$UkcEQIayCCMLeMENBnnpJOkvx60StmndNjxTHmC7YR0n.sO0Syjqa', NULL, '2026-07-29 15:00:05', '2026-07-29 15:00:05');

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

--
-- 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`),
  ADD KEY `cashier_shifts_store_id_foreign` (`store_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`),
  ADD KEY `order_details_unit_id_foreign` (`unit_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`),
  ADD KEY `purchase_return_details_unit_id_foreign` (`unit_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`),
  ADD KEY `stocks_store_id_foreign` (`store_id`);

--
-- 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 `stock_transfers`
--
ALTER TABLE `stock_transfers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `stock_transfers_code_unique` (`code`),
  ADD KEY `stock_transfers_from_store_id_foreign` (`from_store_id`),
  ADD KEY `stock_transfers_to_store_id_foreign` (`to_store_id`),
  ADD KEY `stock_transfers_user_id_foreign` (`user_id`);

--
-- Indexes for table `stock_transfer_details`
--
ALTER TABLE `stock_transfer_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_transfer_details_stock_transfer_id_foreign` (`stock_transfer_id`);

--
-- Indexes for table `stores`
--
ALTER TABLE `stores`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `stores_code_unique` (`code`);

--
-- 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`),
  ADD KEY `transactions_store_id_foreign` (`store_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`),
  ADD KEY `units_parent_unit_id_foreign` (`parent_unit_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=7;

--
-- 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=83;

--
-- 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=136;

--
-- 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=32;

--
-- 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 `stock_transfers`
--
ALTER TABLE `stock_transfers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

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

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

--
-- 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_store_id_foreign` FOREIGN KEY (`store_id`) REFERENCES `stores` (`id`) ON DELETE SET NULL 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,
  ADD CONSTRAINT `order_details_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE SET NULL 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,
  ADD CONSTRAINT `purchase_return_details_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE SET NULL ON UPDATE 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 `stocks`
--
ALTER TABLE `stocks`
  ADD CONSTRAINT `stocks_store_id_foreign` FOREIGN KEY (`store_id`) REFERENCES `stores` (`id`) ON DELETE SET NULL ON UPDATE 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 `stock_transfers`
--
ALTER TABLE `stock_transfers`
  ADD CONSTRAINT `stock_transfers_from_store_id_foreign` FOREIGN KEY (`from_store_id`) REFERENCES `stores` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `stock_transfers_to_store_id_foreign` FOREIGN KEY (`to_store_id`) REFERENCES `stores` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `stock_transfers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `stock_transfer_details`
--
ALTER TABLE `stock_transfer_details`
  ADD CONSTRAINT `stock_transfer_details_stock_transfer_id_foreign` FOREIGN KEY (`stock_transfer_id`) REFERENCES `stock_transfers` (`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_store_id_foreign` FOREIGN KEY (`store_id`) REFERENCES `stores` (`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 `units`
--
ALTER TABLE `units`
  ADD CONSTRAINT `units_parent_unit_id_foreign` FOREIGN KEY (`parent_unit_id`) REFERENCES `units` (`id`) ON DELETE SET NULL ON UPDATE 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 */;
