CREATE TABLE IF NOT EXISTS `scroll_popup_terms_conditions` (
  `idscroll_popup_terms_condition` INT NOT NULL AUTO_INCREMENT,
  `category_name` VARCHAR(120) NOT NULL,
  `category_order` INT NOT NULL DEFAULT 1,
  `description_point` VARCHAR(500) NOT NULL,
  `point_order` INT NOT NULL DEFAULT 1,
  `is_active` TINYINT(1) NOT NULL DEFAULT 1,
  `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`idscroll_popup_terms_condition`),
  KEY `idx_scroll_popup_tc_active_order` (`is_active`, `category_order`, `point_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `scroll_popup_terms_conditions` (
  `category_name`,
  `category_order`,
  `description_point`,
  `point_order`,
  `is_active`
)
VALUES
  ('Eligibility', 1, 'Applicant must be at least 21 years old.', 1, 1),
  ('Eligibility', 1, 'Applicant must meet minimum income criteria defined by the issuing bank.', 2, 1),
  ('Offer Validity', 2, 'Welcome bonus is subject to bank approval and campaign timeline.', 1, 1),
  ('Offer Validity', 2, 'Bonus amount may vary by card type and customer profile.', 2, 1),
  ('General', 3, 'BanksFinders acts only as a facilitation platform and does not guarantee approval.', 1, 1),
  ('General', 3, 'Final terms and charges are governed by the issuing bank policy.', 2, 1);

-- Example admin change:
-- UPDATE `scroll_popup_terms_conditions`
-- SET `description_point` = 'Updated point by admin'
-- WHERE `idscroll_popup_terms_condition` = 1;
