module.exports = {
  apps: [
    {
      name: 'telegram-bot',
      script: 'telegram-bot.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '500M',
      env: { NODE_ENV: 'production' },
      error_file: './logs/telegram-error.log',
      out_file: './logs/telegram-out.log',
      time: true,
    },
    {
      name: 'whatsapp-bot',
      script: 'whatsapp-bot.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '300M',
      env: { NODE_ENV: 'production' },
      error_file: './logs/whatsapp-error.log',
      out_file: './logs/whatsapp-out.log',
      time: true,
    },
    {
      name: 'ai-agents',
      script: 'ai-agents.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '300M',
      env: { NODE_ENV: 'production' },
      error_file: './logs/ai-error.log',
      out_file: './logs/ai-out.log',
      time: true,
    },
    {
      name: 'admin-bot',
      script: 'admin-bot.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '200M',
      env: { NODE_ENV: 'production' },
      error_file: './logs/admin-error.log',
      out_file: './logs/admin-out.log',
      time: true,
    },
    {
      name: 'scheduler',
      script: 'scheduler.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '200M',
      env: { NODE_ENV: 'production' },
      error_file: './logs/scheduler-error.log',
      out_file: './logs/scheduler-out.log',
      time: true,
    },
    {
      name: 'enterprise-api',
      script: 'enterprise-api.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '300M',
      env: { NODE_ENV: 'production', PORT: 3001 },
      error_file: './logs/api-error.log',
      out_file: './logs/api-out.log',
      time: true,
    },
  ],
};
