import { Module } from '@nestjs/common'
import { MongooseModule } from '@nestjs/mongoose'
import {
  FormTemplate, FormTemplateSchema,
  FormGenerationLog, FormGenerationLogSchema,
  ClientFolder, ClientFolderSchema,
  Matter, MatterSchema,
  LegalDocument, LegalDocumentSchema,
  LawCorpusEntry, LawCorpusEntrySchema,
} from '../common/schemas'
import { RagAgentService } from './rag-agent.service'
import { RagAgentController } from './rag-agent.controller'
import { FormCalibrationAgent } from '../form-templates/form-calibration.agent'
import { FormTemplatesService } from '../form-templates/form-templates.service'

@Module({
  imports: [
    MongooseModule.forFeature([
      { name: FormTemplate.name,       schema: FormTemplateSchema },
      { name: FormGenerationLog.name,  schema: FormGenerationLogSchema },
      { name: ClientFolder.name,       schema: ClientFolderSchema },
      { name: Matter.name,             schema: MatterSchema },
      { name: LegalDocument.name,      schema: LegalDocumentSchema },
      { name: LawCorpusEntry.name,     schema: LawCorpusEntrySchema },
    ]),
  ],
  providers: [RagAgentService, FormCalibrationAgent, FormTemplatesService],
  controllers: [RagAgentController],
  exports: [RagAgentService],
})
export class RagAgentModule {}
