-- Tabla para gestionar los precios de los tests
-- Soporta múltiples monedas (MXN para español, USD para inglés)

CREATE TABLE IF NOT EXISTS test_prices (
  id INT PRIMARY KEY AUTO_INCREMENT,
  test_type ENUM('personal', 'student', 'business') NOT NULL,
  currency ENUM('MXN', 'USD') NOT NULL,
  price DECIMAL(10,2) NOT NULL,
  language ENUM('es', 'en') NOT NULL,
  active TINYINT(1) DEFAULT 1,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  UNIQUE KEY unique_test_price (test_type, currency, language)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Insertar precios iniciales (basados en los valores actuales en translations.js)
-- Precios en pesos mexicanos (MXN) para español
INSERT INTO test_prices (test_type, currency, price, language, active) VALUES
('personal', 'MXN', 650.00, 'es', 1),
('student', 'MXN', 850.00, 'es', 1),
('business', 'MXN', 750.00, 'es', 1);

-- Precios en dólares (USD) para inglés
-- Conversión aproximada: 1 USD = 18 MXN (puedes ajustar según necesites)
INSERT INTO test_prices (test_type, currency, price, language, active) VALUES
('personal', 'USD', 36.00, 'en', 1),
('student', 'USD', 47.00, 'en', 1),
('business', 'USD', 42.00, 'en', 1);
