-- 21-03-2023
INSERT INTO `permissions` (`name`, `display_name`, `created_by`, `created_at`, `updated_at`) VALUES
('order-list', 'Order List', NULL, NOW(), NOW()),
('date-wise-product-sale-list', 'Date Wise Product Sale List', NULL, NOW(), NOW());

INSERT INTO `role_has_permissions` (`role_id`, `permission_id`, `created_by`, `created_at`, `updated_at`) VALUES
((SELECT id FROM `roles` WHERE `name`='Super Admin'), (SELECT id FROM `permissions` WHERE `name`='order-list'), NULL, NOW(), NOW()),
((SELECT id FROM `roles` WHERE `name`='Super Admin'), (SELECT id FROM `permissions` WHERE `name`='date-wise-product-sale-list'), NULL, NOW(), NOW());

-- 11-05-2023
UPDATE `permissions` SET `name` = 'vr-transaction-list' WHERE `permissions`.`name` = 'vrtransaction-list';
INSERT INTO `permissions` (`name`, `display_name`) VALUES
('subscription-transaction-list', 'Subscription Transaction List'),
('service-transaction-list', 'Service Transaction List');

 INSERT INTO `role_has_permissions` (`role_id`, `permission_id`, `created_by`, `created_at`, `updated_at`) VALUES
(1, (SELECT `id` FROM `permissions` WHERE `name`='subscription-transaction-list'), NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(1, (SELECT `id` FROM `permissions` WHERE `name`='service-transaction-list'), NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);

-- 24-05-2023
UPDATE `permissions` SET `name` = 'haalkhata-transactions', `display_name` = 'Haalkhata Transactions', `created_at` = NULL WHERE `permissions`.`name` = 'halkhata-transactions';

-- 12-01-2024
INSERT INTO permissions (id, name, display_name, created_by, created_at, updated_at) VALUES (NULL, 'loan-list', 'Loan List', NULL, '2024-01-12 13:09:49', '2021-01-07 13:12:25');

INSERT INTO role_has_permissions (role_id, permission_id, created_by, created_at, updated_at)
SELECT 1 as role_id, id as permission_id, NULL as created_by, CURRENT_TIMESTAMP as created_at, CURRENT_TIMESTAMP as updated_at
FROM permissions
WHERE name = 'loan-list';

INSERT INTO `permissions` (`id`, `name`, `display_name`, `created_by`, `created_at`, `updated_at`) VALUES (NULL, 'loan-details', 'Loan Details', '1', '2024-01-12 13:09:49', '2021-01-07 13:12:25');

INSERT INTO role_has_permissions (role_id, permission_id, created_by, created_at, updated_at) SELECT 1 as role_id, id as permission_id, NULL as created_by, CURRENT_TIMESTAMP as created_at, CURRENT_TIMESTAMP as updated_at FROM permissions WHERE name = 'loan-details';

INSERT INTO `permissions` (`id`, `name`, `display_name`, `created_by`, `created_at`, `updated_at`) VALUES (NULL, 'loan-status-change', 'Loan Status Change', '1', '2024-01-12 13:09:49', '2021-01-07 13:12:25');

INSERT INTO role_has_permissions (role_id, permission_id, created_by, created_at, updated_at) SELECT 1 as role_id, id as permission_id, NULL as created_by, CURRENT_TIMESTAMP as created_at, CURRENT_TIMESTAMP as updated_at FROM permissions WHERE name = 'loan-status-change';

