import { Module } from '@nestjs/common';
import { GembaDocsConnector } from './gembadocs.connector';
import { GembaDocsService } from './gembadocs.service';
import { GembaDocsController } from './gembadocs.controller';
import { CredentialsModule } from '../../credentials/credentials.module';

/**
 * GembaDocs Integration Module
 *
 * Provides integration with GembaDocs audit and checklist management system.
 *
 * Credentials are stored in the DB and loaded via CredentialsService.
 * Required credential keys: apiUrl, apiKey
 *
 * Features:
 * - API Key authentication
 * - Audits management (list, get, create, update)
 * - Upcoming and overdue audits tracking
 * - Checklist templates management
 * - Findings/Actions tracking with severity levels
 * - Statistics and compliance metrics
 * - Trend data for charts and reporting
 *
 * Supported Audit Types:
 * - Layered Process Audits (LPA)
 * - Safety audits
 * - 5S audits
 * - Quality audits
 * - Custom audits
 *
 * API Endpoints:
 * - POST /integrations/gembadocs/test - Connection test
 * - GET  /integrations/gembadocs/health - Health check
 *
 * Audits:
 * - GET  /integrations/gembadocs/audits - List audits
 * - GET  /integrations/gembadocs/audits/upcoming - Upcoming audits
 * - GET  /integrations/gembadocs/audits/overdue - Overdue audits
 * - GET  /integrations/gembadocs/audits/:id - Get audit
 * - POST /integrations/gembadocs/audits - Create audit
 * - PUT  /integrations/gembadocs/audits/:id - Update audit
 *
 * Checklists:
 * - GET  /integrations/gembadocs/checklists - List checklists
 * - GET  /integrations/gembadocs/checklists/:id - Get checklist
 *
 * Findings:
 * - GET  /integrations/gembadocs/findings - List findings
 * - GET  /integrations/gembadocs/findings/open - Open findings
 * - PUT  /integrations/gembadocs/findings/:id - Update finding
 * - POST /integrations/gembadocs/findings/:id/resolve - Resolve finding
 *
 * Statistics:
 * - GET  /integrations/gembadocs/statistics - Audit statistics
 * - GET  /integrations/gembadocs/trends - Trend data
 * - GET  /integrations/gembadocs/compliance-score - Compliance score
 */
@Module({
  imports: [CredentialsModule],
  controllers: [GembaDocsController],
  providers: [GembaDocsConnector, GembaDocsService],
  exports: [GembaDocsService, GembaDocsConnector],
})
export class GembaDocsModule {}
