-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `aihika_waffle`
--

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

--
-- Table structure for table `attendances`
--

CREATE TABLE `attendances` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `date_time` varchar(255) DEFAULT NULL,
  `remark` varchar(255) 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 `attendances`
--

INSERT INTO `attendances` (`id`, `user_id`, `franchise_id`, `date_time`, `remark`, `created_at`, `updated_at`) VALUES
(1, 15, 7, '2024-09-30', 'Testing remark', '2024-09-30 11:36:59', '2024-09-30 11:37:36');

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

--
-- Table structure for table `bills`
--

CREATE TABLE `bills` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `payment_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `order_source_id` bigint(20) UNSIGNED DEFAULT NULL,
  `table_id` bigint(20) UNSIGNED DEFAULT NULL,
  `amount` varchar(255) DEFAULT NULL,
  `discount` varchar(255) DEFAULT NULL,
  `gst` varchar(255) DEFAULT NULL,
  `is_parcel` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_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;

--
-- Dumping data for table `bills`
--

INSERT INTO `bills` (`id`, `user_id`, `franchise_id`, `payment_type_id`, `order_source_id`, `table_id`, `amount`, `discount`, `gst`, `is_parcel`, `is_active`, `deleted_at`, `created_at`, `updated_at`) VALUES
(3, 18, 7, 2, 1, NULL, '255', '0', 'GST12345678', 0, 0, NULL, '2024-09-30 12:00:16', '2024-09-30 12:00:16'),
(4, 18, 7, 2, 1, NULL, '28', '0', 'GST12345678', 0, 0, NULL, '2024-10-03 11:47:27', '2024-10-03 11:47:27'),
(13, 18, 7, 2, 1, NULL, '28', '0', 'GST12345678', 0, 0, NULL, '2024-10-03 14:05:40', '2024-10-03 14:05:40'),
(17, 30, 5, 1, 2, NULL, '250', '1', 'GST12345678', 0, 0, NULL, '2024-10-03 14:13:11', '2024-10-03 14:13:11'),
(18, 30, 5, 1, 2, NULL, '250', '1', 'GST12345678', 0, 0, NULL, '2024-10-03 14:13:28', '2024-10-03 14:13:28'),
(19, 30, 5, 1, 2, NULL, '250', '1', 'GST12345678', 0, 0, NULL, '2024-10-03 14:13:35', '2024-10-03 14:13:35'),
(20, 30, 4, 1, 1, NULL, '351', '1', 'GST12345678', 0, 0, NULL, '2024-10-03 14:15:05', '2024-10-03 14:15:05'),
(21, 30, 4, 1, 1, NULL, '351', '1', 'GST12345678', 0, 0, NULL, '2024-10-03 14:15:13', '2024-10-03 14:15:13');

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

--
-- Table structure for table `bill_details`
--

CREATE TABLE `bill_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `bill_id` bigint(20) UNSIGNED DEFAULT NULL,
  `recipe_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(255) DEFAULT NULL,
  `price` int(11) DEFAULT NULL,
  `total_amount` int(11) 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 `bill_details`
--

INSERT INTO `bill_details` (`id`, `user_id`, `bill_id`, `recipe_id`, `qty`, `price`, `total_amount`, `created_at`, `updated_at`) VALUES
(2, NULL, 3, 2, '1', 250, 250, '2024-09-30 12:00:16', '2024-09-30 12:00:16'),
(3, NULL, 4, 2, '1', 250, 250, '2024-10-03 11:47:27', '2024-10-03 11:47:27'),
(12, NULL, 13, 2, '1', 250, 250, '2024-10-03 14:05:40', '2024-10-03 14:05:40'),
(16, NULL, 17, 2, '1', 250, 250, '2024-10-03 14:13:11', '2024-10-03 14:13:11'),
(17, NULL, 18, 2, '1', 250, 250, '2024-10-03 14:13:28', '2024-10-03 14:13:28'),
(18, NULL, 19, 2, '1', 250, 250, '2024-10-03 14:13:35', '2024-10-03 14:13:35'),
(19, NULL, 20, 2, '1', 250, 250, '2024-10-03 14:15:05', '2024-10-03 14:15:05'),
(20, NULL, 20, 1, '1', 101, 101, '2024-10-03 14:15:05', '2024-10-03 14:15:05'),
(21, NULL, 21, 2, '1', 250, 250, '2024-10-03 14:15:13', '2024-10-03 14:15:13'),
(22, NULL, 21, 1, '1', 101, 101, '2024-10-03 14:15:13', '2024-10-03 14:15:13');

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

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

CREATE TABLE `expenses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `expense_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `amount` varchar(255) 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 `expenses`
--

INSERT INTO `expenses` (`id`, `expense_type_id`, `franchise_id`, `name`, `amount`, `created_at`, `updated_at`) VALUES
(1, 1, 7, 'Test Item', '200', '2024-09-26 13:09:15', '2024-09-26 13:09:15'),
(2, 1, 7, 'Test Item', '200', '2024-09-26 13:09:17', '2024-09-26 13:09:17'),
(4, 1, 5, 'today', '10', '2024-10-03 10:28:57', '2024-10-03 10:28:57');

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

--
-- Table structure for table `expense_types`
--

CREATE TABLE `expense_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) 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 `expense_types`
--

INSERT INTO `expense_types` (`id`, `franchise_id`, `name`, `created_at`, `updated_at`) VALUES
(1, 7, 'Test Item', '2024-09-26 13:07:39', '2024-09-26 13:07:39');

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

--
-- Table structure for table `franchises`
--

CREATE TABLE `franchises` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `master_franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `shop_name` varchar(255) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `landmark` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `pincode` varchar(255) DEFAULT NULL,
  `gst` varchar(255) DEFAULT NULL,
  `cgst` varchar(255) DEFAULT NULL,
  `photo` varchar(255) DEFAULT NULL,
  `user_contact` varchar(255) DEFAULT NULL,
  `user_dob` varchar(255) DEFAULT NULL,
  `shop_opening_date` varchar(255) DEFAULT NULL,
  `franchise_amount` varchar(255) DEFAULT NULL,
  `master_commission_percent` varchar(255) DEFAULT NULL,
  `renewal_date` varchar(255) DEFAULT NULL,
  `is_master` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 0,
  `is_approved` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_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;

--
-- Dumping data for table `franchises`
--

INSERT INTO `franchises` (`id`, `master_franchise_id`, `shop_name`, `user_name`, `email`, `mobile`, `address`, `landmark`, `city`, `country`, `state`, `pincode`, `gst`, `cgst`, `photo`, `user_contact`, `user_dob`, `shop_opening_date`, `franchise_amount`, `master_commission_percent`, `renewal_date`, `is_master`, `is_active`, `is_approved`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 'Test franchise 1', 'eichmann.roel', 'bednar.marietta@example.org', '+1-678-968-9999', '2516 Henderson Village Apt. 925\nLake Lenoreland, NH 18531-3675', 'quidem', 'Virgiltown', 'Gambia', 'corrupti', 'incidunt', '68748914', '55602576', NULL, '+1-219-204-4468', '30-08-2024', '30-08-2024', '588033', '18', 'et', 1, 1, 1, NULL, '2024-08-30 04:25:21', '2024-08-30 04:25:21'),
(2, 1, 'Test franchise 2', 'anjali.boyer', 'anibal13@example.net', '864-449-7443', '9369 Caden Tunnel Suite 369\nEarlenefort, WV 43569-3982', 'velit', 'East Esperanza', 'Isle of Man', 'tempore', 'non', '71320760', '54030362', NULL, '+15317695309', '30-08-2024', '30-08-2024', '294527', '13', 'qui', 0, 1, 1, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
(3, 1, 'Test franchise 3', 'mills.marc', 'schulist.marlene@example.net', '(520) 994-1508', '112 Sydnie Junction Apt. 498\nPort Aracelyton, IA 40652-5768', 'aut', 'East Javonte', 'Seychelles', 'repellendus', 'quo', '87504459', '36758519', NULL, '+1 (385) 403-9320', '30-08-2024', '30-08-2024', '980983', '20', 'cumque', 0, 1, 1, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
(4, 1, 'Test franchise 4', 'george.willms', 'stracke.ted@example.net', '(743) 417-9429', '478 Littel Ford\nAbemouth, NV 55709', 'iste', 'Nelleborough', 'Equatorial Guinea', 'tempore', 'voluptatibus', '46191868', '70895434', NULL, '949-527-8210', '30-08-2024', '30-08-2024', '944421', '14', 'ratione', 0, 1, 1, NULL, '2024-08-30 04:25:23', '2024-08-30 04:25:23'),
(5, 4, 'Test franchise shop', 'Test Franchise User', 'test2@uditsolutions.com', '9136248458', 'test address', NULL, 'mumbai', 'india', NULL, '400071', NULL, NULL, '1725089171XplD64vN9OhKFK9klICh9tpvF2rLMSVkXcMZ8J49.png', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2024-08-31 01:56:11', '2024-08-31 01:56:11'),
(7, 4, 'Test franchise shop', 'Test Franchise User', 'test3@uditsolutions.com', '9136248458', 'test address', 'Thakkar Bappa', 'mumbai', 'india', 'Maharashtra', '400071', NULL, NULL, '1725089508e6ZW27JnJKzDe28h0cbY4irQl5cb7xJi4lAUMX0B.png', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2024-08-31 02:01:48', '2024-08-31 02:05:19');

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

--
-- Table structure for table `items`
--

CREATE TABLE `items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `qty` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `image` varchar(255) 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 `items`
--

INSERT INTO `items` (`id`, `franchise_id`, `name`, `qty`, `type`, `image`, `created_at`, `updated_at`) VALUES
(1, 1, 'Casper Schaden', '29', 'hic', NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
(2, 7, 'Test Item', '1', 'Package', '1725090838PVJTFYhO4hprcJuUR5JJmgM4a5gPBbJsUnmXvkdg.png', '2024-08-31 02:17:43', '2024-08-31 02:23:58'),
(4, 7, 'Test Item', '5', 'Test type', NULL, '2024-09-26 12:27:41', '2024-09-26 12:27:41'),
(5, 7, 'Test Item', '2', 'Test type', NULL, '2024-09-26 12:27:53', '2024-10-03 14:13:11'),
(6, 7, 'Test Item', '12', 'Test type', NULL, '2024-09-26 13:07:18', '2024-10-03 14:05:40');

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

--
-- Table structure for table `master_franchises`
--

CREATE TABLE `master_franchises` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `photo` varchar(255) 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 `master_franchises`
--

INSERT INTO `master_franchises` (`id`, `name`, `email`, `phone`, `photo`, `created_at`, `updated_at`) VALUES
(1, 'Heber Bins', 'esperanza31@example.org', '1234567891', '1725019413SYBjSPHuRKkEoafIAHwC9BC600pwnHY9XKVMMe31.png', '2024-08-30 04:25:21', '2024-08-30 06:35:45'),
(4, 'Test Franchise', 'test@uditsolutions.com', '1234567891', '1725088063Ez2FWbeCmI9hEyx55c4M2EE9TbRfPczkmHyfss9p.png', '2024-08-31 01:35:29', '2024-08-31 01:37:43');

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

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

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) 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_000001_create_cache_table', 1),
(2, '2024_08_28_121650_create_personal_access_tokens_table', 1),
(3, '2024_08_29_053828_create_master_franchises_table', 1),
(4, '2024_08_30_033733_create_franchises_table', 1),
(5, '2024_08_30_033740_create_users_table', 1),
(6, '2024_08_30_055736_create_attendances_table', 1),
(7, '2024_08_30_060046_create_expense_types_table', 1),
(8, '2024_08_30_060248_create_expenses_table', 1),
(9, '2024_08_30_060605_create_items_table', 1),
(10, '2024_08_30_060741_create_order_sources_table', 1),
(11, '2024_08_30_060917_create_payment_types_table', 1),
(12, '2024_08_30_061303_create_purchase_orders_table', 1),
(13, '2024_08_30_061421_create_purchase_order_details_table', 1),
(14, '2024_08_30_061703_create_recipes_table', 1),
(15, '2024_08_30_061741_create_recipe_details_table', 1),
(16, '2024_08_30_062030_create_supports_table', 1),
(17, '2024_08_30_062231_create_tables_table', 1),
(18, '2024_08_30_062433_create_tickets_table', 1),
(19, '2024_08_30_062708_create_ticket_replies_table', 1),
(20, '2024_08_30_062945_create_bills_table', 1),
(21, '2024_08_30_063248_create_bill_details_table', 1),
(22, '2024_08_30_063454_create_parcel_details_table', 1);

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

--
-- Table structure for table `order_sources`
--

CREATE TABLE `order_sources` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) 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 `order_sources`
--

INSERT INTO `order_sources` (`id`, `franchise_id`, `name`, `created_at`, `updated_at`) VALUES
(1, 7, 'Test Order source', '2024-09-30 10:38:35', '2024-09-30 10:38:35'),
(2, 5, 'Test Order Source', '2024-09-30 10:39:31', '2024-09-30 10:42:16');

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

--
-- Table structure for table `parcel_details`
--

CREATE TABLE `parcel_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `bill_id` bigint(20) UNSIGNED DEFAULT NULL,
  `item_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(255) 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 `payment_types`
--

CREATE TABLE `payment_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `payment_type` varchar(255) 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 `payment_types`
--

INSERT INTO `payment_types` (`id`, `franchise_id`, `payment_type`, `created_at`, `updated_at`) VALUES
(1, 7, 'online', '2024-09-30 10:43:28', '2024-09-30 10:44:10'),
(2, 7, 'cash', '2024-09-30 11:41:58', '2024-09-30 11:41:58');

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

--
-- Table structure for table `purchase_orders`
--

CREATE TABLE `purchase_orders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vendor_name` varchar(255) DEFAULT NULL,
  `total` varchar(255) DEFAULT NULL,
  `date` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `paid_date` varchar(255) DEFAULT NULL,
  `is_paid` 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;

--
-- Dumping data for table `purchase_orders`
--

INSERT INTO `purchase_orders` (`id`, `franchise_id`, `vendor_name`, `total`, `date`, `type`, `paid_date`, `is_paid`, `created_at`, `updated_at`) VALUES
(1, 7, 'Test Vendor', '50', '2024-09-30', 'Test Type', '2024-09-30', 1, '2024-09-30 10:53:12', '2024-09-30 11:08:57'),
(2, 7, 'Test Vendor', '50', '2024-09-30', 'Test Type', NULL, 0, '2024-09-30 10:57:06', '2024-09-30 10:57:06'),
(3, 7, 'Test Vendor', '50', '2024-09-30', 'Test Type', '2024-09-30', 1, '2024-09-30 10:57:34', '2024-09-30 10:57:34');

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

--
-- Table structure for table `purchase_order_details`
--

CREATE TABLE `purchase_order_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `purchase_order_id` bigint(20) UNSIGNED DEFAULT NULL,
  `item_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(255) DEFAULT NULL,
  `price` varchar(255) 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 `purchase_order_details`
--

INSERT INTO `purchase_order_details` (`id`, `purchase_order_id`, `item_id`, `qty`, `price`, `created_at`, `updated_at`) VALUES
(1, 1, 6, '5', '10', '2024-09-30 10:53:12', '2024-09-30 10:53:12'),
(2, 2, 6, '5', '10', '2024-09-30 10:57:06', '2024-09-30 10:57:06'),
(3, 3, 6, '5', '10', '2024-09-30 10:57:34', '2024-09-30 10:57:34');

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

--
-- Table structure for table `recipes`
--

CREATE TABLE `recipes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `price` varchar(255) DEFAULT NULL,
  `gst` varchar(255) DEFAULT NULL,
  `image` varchar(255) 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 `recipes`
--

INSERT INTO `recipes` (`id`, `franchise_id`, `name`, `price`, `gst`, `image`, `created_at`, `updated_at`) VALUES
(1, 1, 'Miss Ressie Kunze Jr.', '101', NULL, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
(2, 7, 'Masala Veg Biryani', '250', 'null', '1727681577QOfwHiI9fcLLFq5GaLEdH9nU2yUtg47wvLjYPaab.png', '2024-09-30 11:20:53', '2024-09-30 11:32:57');

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

--
-- Table structure for table `recipe_details`
--

CREATE TABLE `recipe_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `recipe_id` bigint(20) UNSIGNED DEFAULT NULL,
  `item_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(255) 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 `recipe_details`
--

INSERT INTO `recipe_details` (`id`, `recipe_id`, `item_id`, `qty`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '1', '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
(2, 2, 6, '1', '2024-09-30 11:20:53', '2024-09-30 11:20:53'),
(3, 2, 6, '1', '2024-09-30 11:31:12', '2024-09-30 11:31:12');

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

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

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

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

--
-- Table structure for table `supports`
--

CREATE TABLE `supports` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `remarks` varchar(255) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `user_id` bigint(20) 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 `tables`
--

CREATE TABLE `tables` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `master_franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_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;

--
-- Dumping data for table `tables`
--

INSERT INTO `tables` (`id`, `franchise_id`, `master_franchise_id`, `name`, `status`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'Providenci Collins', 0, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
(2, 1, 1, 'Dr. Adelbert Heathcote', 0, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
(3, 1, 1, 'Sienna Rodriguez', 0, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22');

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

--
-- Table structure for table `tickets`
--

CREATE TABLE `tickets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `franchise_id` bigint(20) UNSIGNED DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `message` text DEFAULT NULL,
  `file` varchar(255) DEFAULT NULL,
  `resolved_date` varchar(255) DEFAULT NULL,
  `remarks` varchar(255) 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 `ticket_replies`
--

CREATE TABLE `ticket_replies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `ticket_id` bigint(20) UNSIGNED NOT NULL,
  `reply` text DEFAULT NULL,
  `file` varchar(255) DEFAULT 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 `attendances`
--
ALTER TABLE `attendances`
  ADD PRIMARY KEY (`id`),
  ADD KEY `attendances_user_id_foreign` (`user_id`),
  ADD KEY `attendances_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `bills`
--
ALTER TABLE `bills`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bills_user_id_foreign` (`user_id`),
  ADD KEY `bills_franchise_id_foreign` (`franchise_id`),
  ADD KEY `bills_payment_type_id_foreign` (`payment_type_id`),
  ADD KEY `bills_order_source_id_foreign` (`order_source_id`),
  ADD KEY `bills_table_id_foreign` (`table_id`);

--
-- Indexes for table `bill_details`
--
ALTER TABLE `bill_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bill_details_user_id_foreign` (`user_id`),
  ADD KEY `bill_details_bill_id_foreign` (`bill_id`),
  ADD KEY `bill_details_recipe_id_foreign` (`recipe_id`);

--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `expenses_expense_type_id_foreign` (`expense_type_id`),
  ADD KEY `expenses_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `expense_types`
--
ALTER TABLE `expense_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `expense_types_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `franchises`
--
ALTER TABLE `franchises`
  ADD PRIMARY KEY (`id`),
  ADD KEY `franchises_master_franchise_id_foreign` (`master_franchise_id`);

--
-- Indexes for table `items`
--
ALTER TABLE `items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `items_franchise_id_foreign` (`franchise_id`);

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

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

--
-- Indexes for table `order_sources`
--
ALTER TABLE `order_sources`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_sources_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `parcel_details`
--
ALTER TABLE `parcel_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `parcel_details_bill_id_foreign` (`bill_id`),
  ADD KEY `parcel_details_item_id_foreign` (`item_id`);

--
-- Indexes for table `payment_types`
--
ALTER TABLE `payment_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `payment_types_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_orders_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `purchase_order_details`
--
ALTER TABLE `purchase_order_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_order_details_purchase_order_id_foreign` (`purchase_order_id`),
  ADD KEY `purchase_order_details_item_id_foreign` (`item_id`);

--
-- Indexes for table `recipes`
--
ALTER TABLE `recipes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `recipes_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `recipe_details`
--
ALTER TABLE `recipe_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `recipe_details_recipe_id_foreign` (`recipe_id`),
  ADD KEY `recipe_details_item_id_foreign` (`item_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 `supports`
--
ALTER TABLE `supports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supports_user_id_foreign` (`user_id`);

--
-- Indexes for table `tables`
--
ALTER TABLE `tables`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tables_franchise_id_foreign` (`franchise_id`),
  ADD KEY `tables_master_franchise_id_foreign` (`master_franchise_id`);

--
-- Indexes for table `tickets`
--
ALTER TABLE `tickets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tickets_user_id_foreign` (`user_id`),
  ADD KEY `tickets_franchise_id_foreign` (`franchise_id`);

--
-- Indexes for table `ticket_replies`
--
ALTER TABLE `ticket_replies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ticket_replies_user_id_foreign` (`user_id`),
  ADD KEY `ticket_replies_ticket_id_foreign` (`ticket_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `attendances`
--
ALTER TABLE `attendances`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `bills`
--
ALTER TABLE `bills`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `bill_details`
--
ALTER TABLE `bill_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `expenses`
--
ALTER TABLE `expenses`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `expense_types`
--
ALTER TABLE `expense_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `franchises`
--
ALTER TABLE `franchises`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `items`
--
ALTER TABLE `items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `master_franchises`
--
ALTER TABLE `master_franchises`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `order_sources`
--
ALTER TABLE `order_sources`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `parcel_details`
--
ALTER TABLE `parcel_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_types`
--
ALTER TABLE `payment_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `purchase_order_details`
--
ALTER TABLE `purchase_order_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `recipes`
--
ALTER TABLE `recipes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `recipe_details`
--
ALTER TABLE `recipe_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `supports`
--
ALTER TABLE `supports`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tables`
--
ALTER TABLE `tables`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `tickets`
--
ALTER TABLE `tickets`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ticket_replies`
--
ALTER TABLE `ticket_replies`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `attendances`
--
ALTER TABLE `attendances`
  ADD CONSTRAINT `attendances_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `attendances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bills`
--
ALTER TABLE `bills`
  ADD CONSTRAINT `bills_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bills_order_source_id_foreign` FOREIGN KEY (`order_source_id`) REFERENCES `order_sources` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bills_payment_type_id_foreign` FOREIGN KEY (`payment_type_id`) REFERENCES `payment_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bills_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bills_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `bill_details`
--
ALTER TABLE `bill_details`
  ADD CONSTRAINT `bill_details_bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bill_details_recipe_id_foreign` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `bill_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `expenses`
--
ALTER TABLE `expenses`
  ADD CONSTRAINT `expenses_expense_type_id_foreign` FOREIGN KEY (`expense_type_id`) REFERENCES `expense_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `expenses_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `expense_types`
--
ALTER TABLE `expense_types`
  ADD CONSTRAINT `expense_types_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `franchises`
--
ALTER TABLE `franchises`
  ADD CONSTRAINT `franchises_master_franchise_id_foreign` FOREIGN KEY (`master_franchise_id`) REFERENCES `master_franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `items`
--
ALTER TABLE `items`
  ADD CONSTRAINT `items_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `order_sources`
--
ALTER TABLE `order_sources`
  ADD CONSTRAINT `order_sources_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `parcel_details`
--
ALTER TABLE `parcel_details`
  ADD CONSTRAINT `parcel_details_bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `parcel_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `payment_types`
--
ALTER TABLE `payment_types`
  ADD CONSTRAINT `payment_types_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  ADD CONSTRAINT `purchase_orders_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `purchase_order_details`
--
ALTER TABLE `purchase_order_details`
  ADD CONSTRAINT `purchase_order_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `purchase_order_details_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `recipes`
--
ALTER TABLE `recipes`
  ADD CONSTRAINT `recipes_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `recipe_details`
--
ALTER TABLE `recipe_details`
  ADD CONSTRAINT `recipe_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `recipe_details_recipe_id_foreign` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

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

--
-- Constraints for table `tables`
--
ALTER TABLE `tables`
  ADD CONSTRAINT `tables_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tables_master_franchise_id_foreign` FOREIGN KEY (`master_franchise_id`) REFERENCES `master_franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tickets`
--
ALTER TABLE `tickets`
  ADD CONSTRAINT `tickets_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ticket_replies`
--
ALTER TABLE `ticket_replies`
  ADD CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

