// File: src/modules/rfa/rfa.module.ts
// Change Log:
// - 2026-06-14: ตัด deprecated routing-template entities + RfaWorkflowService ออก (ADR-001 migration)
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

// Entities
import { Correspondence } from '../correspondence/entities/correspondence.entity';
import { CorrespondenceRevision } from '../correspondence/entities/correspondence-revision.entity';
import { CorrespondenceStatus } from '../correspondence/entities/correspondence-status.entity';
import { CorrespondenceType } from '../correspondence/entities/correspondence-type.entity';
import { CorrespondenceRecipient } from '../correspondence/entities/correspondence-recipient.entity';
import { Organization } from '../organization/entities/organization.entity';
import { AsBuiltDrawingRevision } from '../drawing/entities/asbuilt-drawing-revision.entity';
import { ShopDrawingRevision } from '../drawing/entities/shop-drawing-revision.entity';
import { Discipline } from '../master/entities/discipline.entity';
import { RfaApproveCode } from './entities/rfa-approve-code.entity';
import { RfaItem } from './entities/rfa-item.entity';
import { RfaRevision } from './entities/rfa-revision.entity';
import { RfaStatusCode } from './entities/rfa-status-code.entity';
import { RfaType } from './entities/rfa-type.entity';
import { Rfa } from './entities/rfa.entity';
import { RfaWorkflow } from './entities/rfa-workflow.entity';

// Services & Controllers
import { RfaController } from './rfa.controller';
import { RfaService } from './rfa.service';

// External Modules
import { DocumentNumberingModule } from '../document-numbering/document-numbering.module';
import { NotificationModule } from '../notification/notification.module';
import { ProjectModule } from '../project/project.module';
import { ReviewTeamModule } from '../review-team/review-team.module';
import { SearchModule } from '../search/search.module';
import { UserModule } from '../user/user.module';
import { WorkflowEngineModule } from '../workflow-engine/workflow-engine.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      Rfa,
      RfaRevision,
      RfaItem,
      RfaType,
      RfaStatusCode,
      RfaApproveCode,
      RfaWorkflow,
      Correspondence,
      CorrespondenceRevision,
      CorrespondenceStatus,
      CorrespondenceType,
      AsBuiltDrawingRevision,
      ShopDrawingRevision,
      Discipline,
      CorrespondenceRecipient,
      Organization,
    ]),
    DocumentNumberingModule,
    UserModule,
    ProjectModule,
    ReviewTeamModule,
    SearchModule,
    WorkflowEngineModule,
    NotificationModule,
  ],
  providers: [RfaService],
  controllers: [RfaController],
  exports: [RfaService],
})
export class RfaModule {}
