/**
 * Utility to manage deprecated functions and ensure clean migration
 * from specific edge functions to the generic SMTP service.
 */

const DEPRECATED_FUNCTIONS = [
  'send-test-email',
  'send-homeowner-request-email',
  'send-notification',
  'send-reminder-emails'
];

/**
 * Checks if a function name is deprecated.
 * @param {string} functionName 
 * @returns {boolean}
 */
export function isFunctionDeprecated(functionName) {
  if (DEPRECATED_FUNCTIONS.includes(functionName)) {
    console.warn(`[Deprecation Warning] The edge function '${functionName}' is deprecated. Please use 'smtpEmailService' instead.`);
    return true;
  }
  return false;
}

/**
 * Placeholder for any future cleanup logic (e.g., removing rows from a config table)
 */
export async function runCleanupRoutine() {
  console.log('Running cleanup routine for deprecated email functions...');
  // Logic to perhaps flag old logs or clean up old templates could go here
  return { success: true, message: 'Cleanup complete' };
}