// import { CompanyExpiryJobType } from '@/jobs/company/company.job';
// import { CheckExpiredCompanies } from '@/jobs/services/CheckExpiredCompanies.job';
// import { createWorker } from '@/shared/config/bullmq.config.js';

// createWorker(
//   'company-expiry',
//   async (job) => {
//     const { name } = job;

//     switch (name) {
//       case CompanyExpiryJobType.CHECK_EXPIRED_PLANS: {
//         console.log('Starting company expiry check...');

//         try {
//           const result = await CheckExpiredCompanies();
//           console.log('Company expiry check completed successfully:', result);
//           return result;
//         } catch (error) {
//           console.error('Error in company expiry check:', error);
//           throw error;
//         }
//       }

//       default:
//         console.log(`Unknown job type: ${name}`);
//         return;
//     }
//   },
//   {
//     concurrency: 1, // Process one at a time to avoid conflicts
//     limiter: {
//       max: 100,
//       duration: 60000,
//     },
//   },
// );
