-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.1.0.6537
-- --------------------------------------------------------


-- Dumping structure for table uditsolutions_e_bakewills.attendances
CREATE TABLE IF NOT EXISTS `attendances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `date_time` datetime DEFAULT NULL,
  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendances_user_id_foreign` (`user_id`),
  KEY `attendances_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `attendances_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `attendances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.attendances: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.bills
CREATE TABLE IF NOT EXISTS `bills` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `payment_type_id` bigint unsigned DEFAULT NULL,
  `order_source_id` bigint unsigned DEFAULT NULL,
  `table_id` bigint unsigned DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `discount` decimal(10,2) DEFAULT NULL,
  `gst` varchar(20) COLLATE utf8mb4_unicode_ci 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,
  PRIMARY KEY (`id`),
  KEY `bills_user_id_foreign` (`user_id`),
  KEY `bills_franchise_id_foreign` (`franchise_id`),
  KEY `bills_payment_type_id_foreign` (`payment_type_id`),
  KEY `bills_order_source_id_foreign` (`order_source_id`),
  KEY `bills_table_id_foreign` (`table_id`),
  CONSTRAINT `bills_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_order_source_id_foreign` FOREIGN KEY (`order_source_id`) REFERENCES `order_sources` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_payment_type_id_foreign` FOREIGN KEY (`payment_type_id`) REFERENCES `payment_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.bills: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.bill_details
CREATE TABLE IF NOT EXISTS `bill_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `bill_id` bigint unsigned DEFAULT NULL,
  `recipe_id` bigint unsigned DEFAULT NULL,
  `qty` smallint unsigned DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `total_amount` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `bill_details_user_id_foreign` (`user_id`),
  KEY `bill_details_bill_id_foreign` (`bill_id`),
  KEY `bill_details_recipe_id_foreign` (`recipe_id`),
  CONSTRAINT `bill_details_bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bill_details_recipe_id_foreign` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bill_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.cache_locks: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.expenses
CREATE TABLE IF NOT EXISTS `expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `expense_type_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_expense_type_id_foreign` (`expense_type_id`),
  KEY `expenses_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `expenses_expense_type_id_foreign` FOREIGN KEY (`expense_type_id`) REFERENCES `expense_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `expenses_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.expenses: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.expense_types
CREATE TABLE IF NOT EXISTS `expense_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expense_types_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `expense_types_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.expense_types: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.franchises
CREATE TABLE IF NOT EXISTS `franchises` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `master_franchise_id` bigint unsigned DEFAULT NULL,
  `shop_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `landmark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pincode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gst` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cgst` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_contact` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_dob` date DEFAULT NULL,
  `shop_opening_date` date DEFAULT NULL,
  `franchise_amount` decimal(12,2) DEFAULT NULL,
  `master_commission_percent` smallint unsigned DEFAULT NULL,
  `renewal_date` date 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,
  PRIMARY KEY (`id`),
  KEY `franchises_master_franchise_id_foreign` (`master_franchise_id`),
  CONSTRAINT `franchises_master_franchise_id_foreign` FOREIGN KEY (`master_franchise_id`) REFERENCES `master_franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.franchises: ~3 rows (approximately)
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', 'jhickle', 'ojacobs@example.com', '1-351-480-9230', '144 Baumbach Springs Apt. 599\nEast Antonietta, WV 08328-0699', 'beatae', 'Zulauftown', 'Czech Republic', 'accusantium', 'recusandae', '39160485', '54089069', NULL, '(202) 805-9668', '2024-10-19', '2024-10-19', 459376.00, 12, '2024-01-28', 1, 1, 1, NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49'),
	(2, 1, 'Test franchise 2', 'egreenholt', 'asha92@example.com', '1-281-616-3910', '74154 Michel Hollow\nCindyville, RI 08696-7640', 'ut', 'Eloiseberg', 'Ethiopia', 'est', 'ad', '76702588', '37390280', NULL, '959.629.7631', '2024-10-19', '2024-10-19', 243163.00, 13, '2024-07-05', 0, 1, 1, NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49'),
	(3, 1, 'Test franchise 3', 'kirk.lueilwitz', 'dock.larson@example.org', '+1-640-220-0901', '753 Giovanna Viaduct Apt. 531\nEast Tatumchester, MO 50272', 'est', 'Erlingfort', 'Saint Vincent and the Grenadines', 'fugiat', 'ut', '97097363', '18921153', NULL, '(517) 381-9523', '2024-10-19', '2024-10-19', 433923.00, 11, '2024-09-22', 0, 1, 1, NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49'),
	(4, 1, 'Test franchise 4', 'nader.nigel', 'tommie14@example.net', '817-548-9065', '671 Jack Alley Suite 664\nEast Loraine, KY 41153-1746', 'aut', 'North Bridgetteport', 'Nepal', 'et', 'sed', '49342741', '86954899', NULL, '(463) 895-5207', '2024-10-19', '2024-10-19', 908113.00, 18, '2024-01-23', 0, 1, 1, NULL, '2024-10-19 06:47:50', '2024-10-19 06:47:50');

-- Dumping structure for table uditsolutions_e_bakewills.inventory_orders
CREATE TABLE IF NOT EXISTS `inventory_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned NOT NULL,
  `for` enum('cakes','breads') COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_date` datetime NOT NULL,
  `delivery_date` datetime DEFAULT NULL,
  `is_paid` tinyint(1) NOT NULL DEFAULT '0',
  `total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `status` enum('pending','completed') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `inventory_orders_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `inventory_orders_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.inventory_orders: ~2 rows (approximately)
INSERT INTO `inventory_orders` (`id`, `franchise_id`, `for`, `order_date`, `delivery_date`, `is_paid`, `total`, `status`, `created_at`, `updated_at`) VALUES
	(1, 1, 'cakes', '2024-10-19 12:18:06', '2024-10-20 12:18:06', 1, 498.00, 'pending', '2024-10-19 06:48:06', '2024-10-19 06:48:06'),
	(2, 1, 'cakes', '2024-10-19 12:20:12', '2024-10-20 12:20:12', 1, 498.00, 'pending', '2024-10-19 06:50:12', '2024-10-19 06:50:12'),
	(3, 1, 'cakes', '2024-10-19 12:21:38', '2024-10-20 12:21:38', 1, 498.00, 'pending', '2024-10-19 06:51:38', '2024-10-19 06:51:38');

-- Dumping structure for table uditsolutions_e_bakewills.inventory_order_items
CREATE TABLE IF NOT EXISTS `inventory_order_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `inventory_order_id` bigint unsigned NOT NULL,
  `item_id` bigint unsigned NOT NULL,
  `ordered_quantity` smallint unsigned NOT NULL DEFAULT '1',
  `received_quantity` smallint unsigned NOT NULL DEFAULT '0',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `inventory_order_items_inventory_order_id_foreign` (`inventory_order_id`),
  KEY `inventory_order_items_item_id_foreign` (`item_id`),
  CONSTRAINT `inventory_order_items_inventory_order_id_foreign` FOREIGN KEY (`inventory_order_id`) REFERENCES `inventory_orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `inventory_order_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.inventory_order_items: ~2 rows (approximately)
INSERT INTO `inventory_order_items` (`id`, `inventory_order_id`, `item_id`, `ordered_quantity`, `received_quantity`, `price`, `created_at`, `updated_at`) VALUES
	(1, 1, 1, 2, 0, 249.00, '2024-10-19 06:48:06', '2024-10-19 06:48:06'),
	(2, 2, 1, 2, 0, 249.00, '2024-10-19 06:50:12', '2024-10-19 06:50:12'),
	(3, 3, 1, 2, 0, 249.00, '2024-10-19 06:51:38', '2024-10-19 06:51:38');

-- Dumping structure for table uditsolutions_e_bakewills.inventory_returns
CREATE TABLE IF NOT EXISTS `inventory_returns` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned NOT NULL,
  `return_of` enum('cakes','breads') COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `inventory_returns_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `inventory_returns_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.inventory_returns: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.inventory_return_items
CREATE TABLE IF NOT EXISTS `inventory_return_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `inventory_return_id` bigint unsigned NOT NULL,
  `item_id` bigint unsigned NOT NULL,
  `quantity` smallint unsigned NOT NULL DEFAULT '1',
  `is_accepted` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `inventory_return_items_inventory_return_id_foreign` (`inventory_return_id`),
  KEY `inventory_return_items_item_id_foreign` (`item_id`),
  CONSTRAINT `inventory_return_items_inventory_return_id_foreign` FOREIGN KEY (`inventory_return_id`) REFERENCES `inventory_returns` (`id`) ON DELETE CASCADE,
  CONSTRAINT `inventory_return_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.inventory_return_items: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.items
CREATE TABLE IF NOT EXISTS `items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `qty` smallint unsigned DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `items_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `items_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.items: ~0 rows (approximately)
INSERT INTO `items` (`id`, `franchise_id`, `name`, `qty`, `type`, `image`, `created_at`, `updated_at`) VALUES
	(1, 1, 'Fabiola Ondricka', 16, 'non', NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49');

-- Dumping structure for table uditsolutions_e_bakewills.master_franchises
CREATE TABLE IF NOT EXISTS `master_franchises` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `photo` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `master_franchises_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.master_franchises: ~0 rows (approximately)
INSERT INTO `master_franchises` (`id`, `name`, `email`, `phone`, `photo`, `created_at`, `updated_at`) VALUES
	(1, 'Reyna Klein', 'chadd53@example.org', '(386) 692-3489', NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49');

-- Dumping structure for table uditsolutions_e_bakewills.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.migrations: ~0 rows (approximately)
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),
	(23, '2024_10_11_101048_create_inventory_orders_table', 1),
	(24, '2024_10_11_101156_create_inventory_order_items_table', 1),
	(25, '2024_10_11_101248_create_inventory_returns_table', 1),
	(26, '2024_10_11_101313_create_inventory_return_items_table', 1);

-- Dumping structure for table uditsolutions_e_bakewills.order_sources
CREATE TABLE IF NOT EXISTS `order_sources` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_sources_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `order_sources_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.order_sources: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.parcel_details
CREATE TABLE IF NOT EXISTS `parcel_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bill_id` bigint unsigned DEFAULT NULL,
  `item_id` bigint unsigned DEFAULT NULL,
  `qty` smallint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parcel_details_bill_id_foreign` (`bill_id`),
  KEY `parcel_details_item_id_foreign` (`item_id`),
  CONSTRAINT `parcel_details_bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `parcel_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.password_reset_tokens: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.payment_types
CREATE TABLE IF NOT EXISTS `payment_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `payment_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_types_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `payment_types_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping structure for table uditsolutions_e_bakewills.purchase_orders
CREATE TABLE IF NOT EXISTS `purchase_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `vendor_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total` decimal(12,2) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `paid_date` date DEFAULT NULL,
  `is_paid` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_orders_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `purchase_orders_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.purchase_orders: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.purchase_order_details
CREATE TABLE IF NOT EXISTS `purchase_order_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` bigint unsigned DEFAULT NULL,
  `item_id` bigint unsigned DEFAULT NULL,
  `qty` smallint unsigned NOT NULL DEFAULT '1',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_order_details_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_order_details_item_id_foreign` (`item_id`),
  CONSTRAINT `purchase_order_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_order_details_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.purchase_order_details: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.recipes
CREATE TABLE IF NOT EXISTS `recipes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `gst` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recipes_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `recipes_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.recipes: ~0 rows (approximately)
INSERT INTO `recipes` (`id`, `franchise_id`, `name`, `price`, `gst`, `image`, `created_at`, `updated_at`) VALUES
	(1, 1, 'Aletha Luettgen', 76.00, NULL, NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49');

-- Dumping structure for table uditsolutions_e_bakewills.recipe_details
CREATE TABLE IF NOT EXISTS `recipe_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `recipe_id` bigint unsigned DEFAULT NULL,
  `item_id` bigint unsigned DEFAULT NULL,
  `qty` smallint unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recipe_details_recipe_id_foreign` (`recipe_id`),
  KEY `recipe_details_item_id_foreign` (`item_id`),
  CONSTRAINT `recipe_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recipe_details_recipe_id_foreign` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.recipe_details: ~0 rows (approximately)
INSERT INTO `recipe_details` (`id`, `recipe_id`, `item_id`, `qty`, `created_at`, `updated_at`) VALUES
	(1, 1, 1, 10, '2024-10-19 06:47:49', '2024-10-19 06:47:49');

-- Dumping structure for table uditsolutions_e_bakewills.sessions
CREATE TABLE IF NOT EXISTS `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,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.sessions: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.supports
CREATE TABLE IF NOT EXISTS `supports` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supports_user_id_foreign` (`user_id`),
  CONSTRAINT `supports_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.supports: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.tables
CREATE TABLE IF NOT EXISTS `tables` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci 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,
  PRIMARY KEY (`id`),
  KEY `tables_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `tables_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.tables: ~2 rows (approximately)
INSERT INTO `tables` (`id`, `franchise_id`, `name`, `status`, `deleted_at`, `created_at`, `updated_at`) VALUES
	(1, 1, 'Johnnie Satterfield', 0, NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49'),
	(2, 1, 'Lavern Jaskolski', 0, NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49'),
	(3, 1, 'Turner Schaden Sr.', 0, NULL, '2024-10-19 06:47:49', '2024-10-19 06:47:49');

-- Dumping structure for table uditsolutions_e_bakewills.tickets
CREATE TABLE IF NOT EXISTS `tickets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `file` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resolved_date` date DEFAULT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tickets_user_id_foreign` (`user_id`),
  KEY `tickets_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `tickets_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table uditsolutions_e_bakewills.tickets: ~0 rows (approximately)

-- Dumping structure for table uditsolutions_e_bakewills.ticket_replies
CREATE TABLE IF NOT EXISTS `ticket_replies` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `ticket_id` bigint unsigned NOT NULL,
  `reply` text COLLATE utf8mb4_unicode_ci,
  `file` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_replies_user_id_foreign` (`user_id`),
  KEY `ticket_replies_ticket_id_foreign` (`ticket_id`),
  CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

