-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               5.7.33 - MySQL Community Server (GPL)
-- Server OS:                    Win64
-- HeidiSQL Version:             11.2.0.6213
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

-- Dumping structure for table hgagent.permissions
CREATE TABLE IF NOT EXISTS `permissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=164 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- Dumping data for table hgagent.permissions: ~163 rows (approximately)
DELETE FROM `permissions`;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
INSERT INTO `permissions` (`id`, `title`, `created_at`, `updated_at`, `deleted_at`) VALUES
	(1, 'user_management_access', NULL, NULL, NULL),
	(2, 'permission_create', NULL, NULL, NULL),
	(3, 'permission_edit', NULL, NULL, NULL),
	(4, 'permission_show', NULL, NULL, NULL),
	(5, 'permission_delete', NULL, NULL, NULL),
	(6, 'permission_access', NULL, NULL, NULL),
	(7, 'role_create', NULL, NULL, NULL),
	(8, 'role_edit', NULL, NULL, NULL),
	(9, 'role_show', NULL, NULL, NULL),
	(10, 'role_delete', NULL, NULL, NULL),
	(11, 'role_access', NULL, NULL, NULL),
	(12, 'user_create', NULL, NULL, NULL),
	(13, 'user_edit', NULL, NULL, NULL),
	(14, 'user_show', NULL, NULL, NULL),
	(15, 'user_delete', NULL, NULL, NULL),
	(16, 'user_access', NULL, NULL, NULL),
	(17, 'employee_create', NULL, NULL, NULL),
	(18, 'employee_edit', NULL, NULL, NULL),
	(19, 'employee_show', NULL, NULL, NULL),
	(20, 'employee_delete', NULL, NULL, NULL),
	(21, 'employee_access', NULL, NULL, NULL),
	(22, 'agent_create', NULL, NULL, NULL),
	(23, 'agent_edit', NULL, NULL, NULL),
	(24, 'agent_show', NULL, NULL, NULL),
	(25, 'agent_delete', NULL, NULL, NULL),
	(26, 'agent_access', NULL, NULL, NULL),
	(27, 'audit_log_show', NULL, NULL, NULL),
	(28, 'audit_log_access', NULL, NULL, NULL),
	(29, 'customer_create', NULL, NULL, NULL),
	(30, 'customer_edit', NULL, NULL, NULL),
	(31, 'customer_show', NULL, NULL, NULL),
	(32, 'customer_delete', NULL, NULL, NULL),
	(33, 'customer_access', NULL, NULL, NULL),
	(34, 'master_access', NULL, NULL, NULL),
	(35, 'store_create', NULL, NULL, NULL),
	(36, 'store_edit', NULL, NULL, NULL),
	(37, 'store_show', NULL, NULL, NULL),
	(38, 'store_delete', NULL, NULL, NULL),
	(39, 'store_access', NULL, NULL, NULL),
	(40, 'product_create', NULL, NULL, NULL),
	(41, 'product_edit', NULL, NULL, NULL),
	(42, 'product_show', NULL, NULL, NULL),
	(43, 'product_delete', NULL, NULL, NULL),
	(44, 'product_access', NULL, NULL, NULL),
	(45, 'product_store_create', NULL, NULL, NULL),
	(46, 'product_store_edit', NULL, NULL, NULL),
	(47, 'product_store_show', NULL, NULL, NULL),
	(48, 'product_store_delete', NULL, NULL, NULL),
	(49, 'product_store_access', NULL, NULL, NULL),
	(50, 'category_create', NULL, NULL, NULL),
	(51, 'category_edit', NULL, NULL, NULL),
	(52, 'category_show', NULL, NULL, NULL),
	(53, 'category_delete', NULL, NULL, NULL),
	(54, 'category_access', NULL, NULL, NULL),
	(55, 'payment_term_create', NULL, NULL, NULL),
	(56, 'payment_term_edit', NULL, NULL, NULL),
	(57, 'payment_term_show', NULL, NULL, NULL),
	(58, 'payment_term_delete', NULL, NULL, NULL),
	(59, 'payment_term_access', NULL, NULL, NULL),
	(60, 'sales_order_create', NULL, NULL, NULL),
	(61, 'sales_order_edit', NULL, NULL, NULL),
	(62, 'sales_order_show', NULL, NULL, NULL),
	(63, 'sales_order_delete', NULL, NULL, NULL),
	(64, 'sales_order_access', NULL, NULL, NULL),
	(65, 'sales_order_item_create', NULL, NULL, NULL),
	(66, 'sales_order_item_edit', NULL, NULL, NULL),
	(67, 'sales_order_item_show', NULL, NULL, NULL),
	(68, 'sales_order_item_delete', NULL, NULL, NULL),
	(69, 'sales_order_item_access', NULL, NULL, NULL),
	(70, 'billing_address_create', NULL, NULL, NULL),
	(71, 'billing_address_edit', NULL, NULL, NULL),
	(72, 'billing_address_show', NULL, NULL, NULL),
	(73, 'billing_address_delete', NULL, NULL, NULL),
	(74, 'billing_address_access', NULL, NULL, NULL),
	(75, 'shipping_address_create', NULL, NULL, NULL),
	(76, 'shipping_address_edit', NULL, NULL, NULL),
	(77, 'shipping_address_show', NULL, NULL, NULL),
	(78, 'shipping_address_delete', NULL, NULL, NULL),
	(79, 'purchase_order_access', NULL, NULL, NULL),
	(80, 'purchase_order_create', NULL, NULL, NULL),
	(81, 'purchase_order_edit', NULL, NULL, NULL),
	(82, 'purchase_order_show', NULL, NULL, NULL),
	(83, 'purchase_order_delete', NULL, NULL, NULL),
	(84, 'profile_password_edit', NULL, NULL, NULL),
	(85, 'agent_approve', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(86, 'agent_reject', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(87, 'agent_abandon', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(88, 'agent_recover', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(89, 'agent_code_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(90, 'agent_code_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(91, 'agent_code_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(92, 'agent_code_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(93, 'agent_code_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(94, 'grade_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(95, 'grade_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(96, 'grade_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(97, 'grade_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(98, 'grade_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(99, 'referral_fee_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(100, 'referral_fee_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(101, 'referral_fee_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(102, 'referral_fee_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(103, 'referral_fee_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(104, 'bank_code_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(105, 'bank_code_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(106, 'bank_code_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(107, 'bank_code_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(108, 'bank_code_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(109, 'hq_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(110, 'purchase_order_print', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(111, 'sales_order_approve', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(112, 'sales_order_print', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(113, 'series_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(114, 'series_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(115, 'series_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(116, 'series_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(117, 'series_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(118, 'warehouse_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(119, 'warehouse_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(120, 'warehouse_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(121, 'warehouse_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(122, 'warehouse_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(123, 'picking_list_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(124, 'picking_list_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(125, 'picking_list_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(126, 'picking_list_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(127, 'picking_list_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(128, 'picking_list_validate', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(129, 'picking_list_print', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(130, 'warehouse_picking_list_data_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(131, 'warehouse_picking_list_data_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(132, 'warehouse_picking_list_data_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(133, 'warehouse_picking_list_data_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(134, 'warehouse_picking_list_data_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(135, 'warehouse_picking_list_data_complete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(136, 'agent_reject_list_data_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(137, 'agent_reject_list_data_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(138, 'agent_reject_list_data_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(139, 'agent_reject_list_data_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(140, 'agent_reject_list_data_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(141, 'agent_reject_list_data_complete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(142, 'available_store_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(143, 'available_store_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(144, 'available_store_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(145, 'available_store_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(146, 'available_store_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(147, 'store_audit_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(148, 'store_audit_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(149, 'store_audit_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(150, 'store_audit_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(151, 'store_audit_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(152, 'promoter_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(153, 'promoter_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(154, 'promoter_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(155, 'promoter_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(156, 'promoter_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(157, 'promoter_task_management_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(158, 'promoter_task_list_access', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(159, 'promoter_task_list_create', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(160, 'promoter_task_list_edit', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(161, 'promoter_task_list_show', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(162, 'promoter_task_list_delete', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL),
	(163, 'promoter_task_list_print', '2022-03-22 06:26:00', '2022-03-22 06:26:00', NULL);
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;

-- Dumping structure for table hgagent.permission_role
CREATE TABLE IF NOT EXISTS `permission_role` (
  `role_id` bigint(20) unsigned NOT NULL,
  `permission_id` bigint(20) unsigned NOT NULL,
  KEY `role_id_fk_5415298` (`role_id`),
  KEY `permission_id_fk_5415298` (`permission_id`),
  CONSTRAINT `permission_id_fk_5415298` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_id_fk_5415298` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- Dumping data for table hgagent.permission_role: ~333 rows (approximately)
DELETE FROM `permission_role`;
/*!40000 ALTER TABLE `permission_role` DISABLE KEYS */;
INSERT INTO `permission_role` (`role_id`, `permission_id`) VALUES
	(1, 1),
	(1, 2),
	(1, 3),
	(1, 4),
	(1, 5),
	(1, 6),
	(1, 7),
	(1, 8),
	(1, 9),
	(1, 10),
	(1, 11),
	(1, 12),
	(1, 13),
	(1, 14),
	(1, 15),
	(1, 16),
	(1, 17),
	(1, 18),
	(1, 19),
	(1, 20),
	(1, 21),
	(1, 22),
	(1, 23),
	(1, 24),
	(1, 25),
	(1, 26),
	(1, 27),
	(1, 28),
	(1, 29),
	(1, 30),
	(1, 31),
	(1, 32),
	(1, 33),
	(1, 34),
	(1, 35),
	(1, 36),
	(1, 37),
	(1, 38),
	(1, 39),
	(1, 40),
	(1, 41),
	(1, 42),
	(1, 43),
	(1, 44),
	(1, 45),
	(1, 46),
	(1, 47),
	(1, 48),
	(1, 49),
	(1, 50),
	(1, 51),
	(1, 52),
	(1, 53),
	(1, 54),
	(1, 55),
	(1, 56),
	(1, 57),
	(1, 58),
	(1, 59),
	(1, 60),
	(1, 61),
	(1, 62),
	(1, 63),
	(1, 64),
	(1, 65),
	(1, 66),
	(1, 67),
	(1, 68),
	(1, 69),
	(1, 70),
	(1, 71),
	(1, 72),
	(1, 73),
	(1, 74),
	(1, 75),
	(1, 76),
	(1, 77),
	(1, 78),
	(1, 79),
	(1, 80),
	(1, 81),
	(1, 82),
	(1, 83),
	(1, 84),
	(1, 85),
	(1, 86),
	(1, 87),
	(1, 88),
	(1, 89),
	(1, 90),
	(1, 91),
	(1, 92),
	(1, 93),
	(1, 94),
	(1, 95),
	(1, 96),
	(1, 97),
	(1, 98),
	(1, 99),
	(1, 100),
	(1, 101),
	(1, 102),
	(1, 103),
	(1, 104),
	(1, 105),
	(1, 106),
	(1, 107),
	(1, 108),
	(1, 109),
	(1, 110),
	(1, 111),
	(1, 112),
	(1, 113),
	(1, 114),
	(1, 115),
	(1, 116),
	(1, 117),
	(1, 118),
	(1, 119),
	(1, 120),
	(1, 121),
	(1, 122),
	(1, 123),
	(1, 124),
	(1, 125),
	(1, 126),
	(1, 127),
	(1, 128),
	(1, 129),
	(1, 136),
	(1, 137),
	(1, 138),
	(1, 139),
	(1, 140),
	(1, 141),
	(1, 142),
	(1, 143),
	(1, 144),
	(1, 145),
	(1, 146),
	(1, 147),
	(1, 148),
	(1, 149),
	(1, 150),
	(1, 151),
	(1, 152),
	(1, 153),
	(1, 154),
	(1, 155),
	(1, 156),
	(1, 157),
	(1, 158),
	(1, 159),
	(1, 160),
	(1, 161),
	(1, 162),
	(1, 163),
	(2, 1),
	(2, 2),
	(2, 3),
	(2, 4),
	(2, 5),
	(2, 6),
	(2, 7),
	(2, 8),
	(2, 9),
	(2, 10),
	(2, 11),
	(2, 12),
	(2, 13),
	(2, 14),
	(2, 15),
	(2, 16),
	(2, 17),
	(2, 18),
	(2, 19),
	(2, 20),
	(2, 21),
	(2, 22),
	(2, 23),
	(2, 24),
	(2, 25),
	(2, 26),
	(2, 27),
	(2, 28),
	(2, 29),
	(2, 30),
	(2, 31),
	(2, 32),
	(2, 33),
	(2, 34),
	(2, 35),
	(2, 36),
	(2, 37),
	(2, 38),
	(2, 39),
	(2, 40),
	(2, 41),
	(2, 42),
	(2, 43),
	(2, 44),
	(2, 45),
	(2, 46),
	(2, 47),
	(2, 48),
	(2, 49),
	(2, 50),
	(2, 51),
	(2, 52),
	(2, 53),
	(2, 54),
	(2, 55),
	(2, 56),
	(2, 57),
	(2, 58),
	(2, 59),
	(2, 60),
	(2, 61),
	(2, 62),
	(2, 63),
	(2, 64),
	(2, 65),
	(2, 66),
	(2, 67),
	(2, 68),
	(2, 69),
	(2, 70),
	(2, 71),
	(2, 72),
	(2, 73),
	(2, 74),
	(2, 75),
	(2, 76),
	(2, 77),
	(2, 78),
	(2, 79),
	(2, 80),
	(2, 81),
	(2, 82),
	(2, 83),
	(2, 84),
	(2, 85),
	(2, 86),
	(2, 87),
	(2, 88),
	(2, 89),
	(2, 90),
	(2, 91),
	(2, 92),
	(2, 93),
	(2, 94),
	(2, 95),
	(2, 96),
	(2, 97),
	(2, 98),
	(2, 99),
	(2, 100),
	(2, 101),
	(2, 102),
	(2, 103),
	(2, 104),
	(2, 105),
	(2, 106),
	(2, 107),
	(2, 108),
	(2, 109),
	(2, 110),
	(2, 111),
	(2, 112),
	(2, 113),
	(2, 114),
	(2, 115),
	(2, 116),
	(2, 117),
	(2, 118),
	(2, 119),
	(2, 120),
	(2, 121),
	(2, 122),
	(2, 123),
	(2, 124),
	(2, 125),
	(2, 126),
	(2, 127),
	(2, 128),
	(2, 129),
	(2, 136),
	(2, 137),
	(2, 138),
	(2, 139),
	(2, 140),
	(2, 141),
	(2, 142),
	(2, 143),
	(2, 144),
	(2, 145),
	(2, 146),
	(2, 147),
	(2, 148),
	(2, 149),
	(2, 150),
	(2, 151),
	(2, 152),
	(2, 153),
	(2, 154),
	(2, 155),
	(2, 156),
	(2, 157),
	(2, 158),
	(2, 159),
	(2, 160),
	(2, 161),
	(2, 162),
	(2, 163),
	(6, 103),
	(7, 123),
	(7, 126),
	(7, 130),
	(7, 131),
	(7, 132),
	(7, 133),
	(7, 134),
	(7, 135),
	(8, 147),
	(8, 148),
	(8, 149),
	(8, 150),
	(8, 151),
	(9, 147),
	(9, 148),
	(9, 149),
	(9, 150),
	(9, 151);
/*!40000 ALTER TABLE `permission_role` ENABLE KEYS */;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
