import { Module } from '@nestjs/common';

import { CaslModule } from '@/casl/casl.module';
import { SystemNotificationsModule } from '@/modules/system-notifications/system-notifications.module';
import { WorkingGroupIssuesModule } from '@/modules/working-group-issues/working-group-issues.module';
import { IssuesController } from './issues.controller';
import { IssuesRepository } from './issues.repository';
import { IssuesService } from './issues.service';

/**
 * The issues CDC and CEFP work with: the ones a ministry escalated to them and
 * the ones their own users raised. Which of the two matrices a caller sees is
 * decided from the role they hold.
 *
 * Issue writes are reused from WorkingGroupIssuesModule rather than repeated
 * here.
 */
@Module({
  imports: [WorkingGroupIssuesModule, CaslModule, SystemNotificationsModule],
  controllers: [IssuesController],
  providers: [IssuesService, IssuesRepository],
  exports: [IssuesService],
})
export class IssuesModule {}
