-- Add payment_methods table
CREATE TABLE IF NOT EXISTS `payment_methods` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `instructions` text COLLATE utf8mb4_unicode_ci,
  `min_amount` decimal(18,8) DEFAULT '10.00000000',
  `max_amount` decimal(18,8) DEFAULT '10000.00000000',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Add some default payment methods
INSERT INTO `payment_methods` 
(`name`, `description`, `details`, `instructions`, `min_amount`, `max_amount`, `is_active`) VALUES
('Bank Transfer', 'Direct bank transfer', 'Bank: Test Bank\nAccount: 123456789\nName: Test Company', 'Include your user ID as payment reference', 50.00000000, 50000.00000000, 1),
('Bitcoin', 'BTC cryptocurrency payment', 'Wallet: bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', 'Send exact amount to the wallet address', 0.00100000, 10.00000000, 1),
('Ethereum', 'ETH cryptocurrency payment', 'Wallet: 0x71C7656EC7ab88b098defB751B7401B5f6d8976F', 'Send exact amount to the wallet address', 0.01000000, 20.00000000, 1),
('USDT (TRC20)', 'USDT on TRON network', 'Wallet: TYMW1i1LspkUyUq5jzX7JxUq9JQYVXJ1z2', 'Only send USDT on TRC20 network', 10.00000000, 10000.00000000, 1);
