import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CacheModule } from '@nestjs/cache-manager';
import { JobPosts } from './entities/job_posts.entity';
import { JobPostsService } from './job_posts.service';
import { JobPostsController } from './job_posts.controller';
import { Companies } from '../companies/entities/companies.entity';
import { JobPostSkills } from '../job_post_skills/entities/job_post_skills.entity';
import { JobMatchesModule } from '../job_matches/job_matches.module';
import { DashboardModule } from '../dashboard/dashboard.module';
import { TagsModule } from '../tags/tags.module';
import { JobsPostTagModule } from '../jobs_post_tag/jobs_post_tag.module';
import { SkillsModule } from '../skills/skills.module';

import { JobPostAiSettings } from '../job_post_ai_settings/entities/job_post_ai_settings.entity';
import { ActivityLogsModule } from '../activity_logs/activity_logs.module';
import { PlansModule } from '../plans/plans.module';
import { WalletModule } from '../wallet/wallet.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      JobPosts,
      Companies,
      JobPostSkills,
      JobPostAiSettings,
    ]),
    CacheModule.register({
      ttl: 900000, // 15 minutes
      max: 100, // maximum number of items in cache
    }),
    JobMatchesModule,
    DashboardModule,
    TagsModule,
    JobsPostTagModule,
    SkillsModule,
    ActivityLogsModule,
    PlansModule,
    WalletModule,
  ],
  providers: [JobPostsService],
  controllers: [JobPostsController],
})
export class JobPostsModule {}
