import type { Response } from 'express';
import { AuditService } from './audit.service';
import { ComplianceReportService } from './services/compliance-report.service';
import { AuditAlertService } from './services/alert.service';
import { QueryAuditLogDto, EntityAuditQueryDto, UserAuditQueryDto, FinancialAuditQueryDto, SensitiveAuditQueryDto, AuditStatisticsDto, VerifyIntegrityDto, IntegrityCheckDto, AuditExportDto, DetectFailuresDto, DetectAnomalyDto, BatchCheckAlertsDto, DateRangeReportDto } from './dto/query-audit-log.dto';
export declare class AuditController {
    private readonly auditService;
    private readonly complianceReportService;
    private readonly alertService;
    constructor(auditService: AuditService, complianceReportService: ComplianceReportService, alertService: AuditAlertService);
    queryLogs(query: QueryAuditLogDto, user: any): Promise<{
        items: ({
            id: any;
            region: any;
            tenantId: any;
            who: any;
            what: any;
            when: any;
            where: any;
            why: any;
            how: any;
            module: any;
            action: any;
            entityType: any;
            entityId: any;
            userId: any;
            ipAddress: any;
            userAgent: any;
            status: any;
            duration: any;
            riskLevel: any;
            complianceLevel: any;
            isFinancial: any;
            isSensitive: any;
            user: any;
        } | {
            oldValue: any;
            newValue: any;
            changes: any;
            sessionId: any;
            traceId: any;
            requestId: any;
            deviceId: any;
            geoLocation: any;
            businessType: any;
            businessKey: any;
            errorMessage: any;
            previousHash: any;
            currentHash: any;
            signature: any;
            createdAt: any;
            archivedAt: any;
            retentionYears: any;
            id: any;
            region: any;
            tenantId: any;
            who: any;
            what: any;
            when: any;
            where: any;
            why: any;
            how: any;
            module: any;
            action: any;
            entityType: any;
            entityId: any;
            userId: any;
            ipAddress: any;
            userAgent: any;
            status: any;
            duration: any;
            riskLevel: any;
            complianceLevel: any;
            isFinancial: any;
            isSensitive: any;
            user: any;
        })[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
        hasNext: boolean;
        hasPrev: boolean;
    }>;
    getLogDetail(id: string, user: any): Promise<{
        id: any;
        region: any;
        tenantId: any;
        who: any;
        what: any;
        when: any;
        where: any;
        why: any;
        how: any;
        module: any;
        action: any;
        entityType: any;
        entityId: any;
        userId: any;
        ipAddress: any;
        userAgent: any;
        status: any;
        duration: any;
        riskLevel: any;
        complianceLevel: any;
        isFinancial: any;
        isSensitive: any;
        user: any;
    }>;
    verifySingleLog(id: string, user: any): Promise<{
        id: string;
        valid: boolean;
        storedHash: string;
        calculatedHash: string;
        verifiedAt: string;
    }>;
    getEntityHistory(entityType: string, entityId: string, query: EntityAuditQueryDto, user: any): Promise<{
        entityType: string;
        entityId: string;
        history: {
            status: import("@prisma/client").$Enums.AuditStatus;
            user: {
                displayName: string;
                id: string;
                username: string;
            } | null;
            oldValue?: import("@prisma/client/runtime/library").JsonValue | undefined;
            newValue?: import("@prisma/client/runtime/library").JsonValue | undefined;
            changes?: import("@prisma/client/runtime/library").JsonValue | undefined;
            id: string;
            action: import("@prisma/client").$Enums.AuditAction;
            when: string;
            who: string;
        }[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
        hasNext: boolean;
        hasPrev: boolean;
    }>;
    getUserHistory(userId: string, query: UserAuditQueryDto, user: any): Promise<{
        userId: string;
        username: string | undefined;
        displayName: string | undefined;
        operations: {
            id: string;
            action: import("@prisma/client").$Enums.AuditAction;
            module: string;
            when: string;
            entityType: string;
            entityId: string;
            what: string;
            status: import("@prisma/client").$Enums.AuditStatus;
            riskLevel: import("@prisma/client").$Enums.RiskLevel;
            isFinancial: boolean;
            isSensitive: boolean;
        }[];
        summary: {
            total: number;
            byAction: {
                [k: string]: number;
            };
            byModule: {
                [k: string]: number;
            };
            sensitiveCount: number;
            financialCount: number;
            failedCount: number;
        };
        total: number;
        page: number;
        limit: number;
        totalPages: number;
        hasNext: boolean;
        hasPrev: boolean;
    }>;
    getFinancialLogs(query: FinancialAuditQueryDto, user: any): Promise<{
        items: ({
            oldValue: import("@prisma/client/runtime/library").JsonValue;
            newValue: import("@prisma/client/runtime/library").JsonValue;
            retentionYears: number;
            id: any;
            region: any;
            tenantId: any;
            who: any;
            what: any;
            when: any;
            where: any;
            why: any;
            how: any;
            module: any;
            action: any;
            entityType: any;
            entityId: any;
            userId: any;
            ipAddress: any;
            userAgent: any;
            status: any;
            duration: any;
            riskLevel: any;
            complianceLevel: any;
            isFinancial: any;
            isSensitive: any;
            user: any;
        } | {
            oldValue: import("@prisma/client/runtime/library").JsonValue;
            newValue: import("@prisma/client/runtime/library").JsonValue;
            retentionYears: number;
            changes: any;
            sessionId: any;
            traceId: any;
            requestId: any;
            deviceId: any;
            geoLocation: any;
            businessType: any;
            businessKey: any;
            errorMessage: any;
            previousHash: any;
            currentHash: any;
            signature: any;
            createdAt: any;
            archivedAt: any;
            id: any;
            region: any;
            tenantId: any;
            who: any;
            what: any;
            when: any;
            where: any;
            why: any;
            how: any;
            module: any;
            action: any;
            entityType: any;
            entityId: any;
            userId: any;
            ipAddress: any;
            userAgent: any;
            status: any;
            duration: any;
            riskLevel: any;
            complianceLevel: any;
            isFinancial: any;
            isSensitive: any;
            user: any;
        })[];
        summary: {
            total: number;
            byAction: {
                [k: string]: number;
            };
            byModule: {
                [k: string]: number;
            };
        };
        total: number;
        page: number;
        limit: number;
        totalPages: number;
        hasNext: boolean;
        hasPrev: boolean;
    }>;
    getSensitiveLogs(query: SensitiveAuditQueryDto, user: any): Promise<{
        items: ({
            mfaVerified: boolean;
            deviceId: string | null;
            geoLocation: string | null;
            requiresApproval: boolean;
            approvedBy: string | null;
            approvalTime: string | undefined;
            id: any;
            region: any;
            tenantId: any;
            who: any;
            what: any;
            when: any;
            where: any;
            why: any;
            how: any;
            module: any;
            action: any;
            entityType: any;
            entityId: any;
            userId: any;
            ipAddress: any;
            userAgent: any;
            status: any;
            duration: any;
            riskLevel: any;
            complianceLevel: any;
            isFinancial: any;
            isSensitive: any;
            user: any;
        } | {
            mfaVerified: boolean;
            deviceId: string | null;
            geoLocation: string | null;
            requiresApproval: boolean;
            approvedBy: string | null;
            approvalTime: string | undefined;
            oldValue: any;
            newValue: any;
            changes: any;
            sessionId: any;
            traceId: any;
            requestId: any;
            businessType: any;
            businessKey: any;
            errorMessage: any;
            previousHash: any;
            currentHash: any;
            signature: any;
            createdAt: any;
            archivedAt: any;
            retentionYears: any;
            id: any;
            region: any;
            tenantId: any;
            who: any;
            what: any;
            when: any;
            where: any;
            why: any;
            how: any;
            module: any;
            action: any;
            entityType: any;
            entityId: any;
            userId: any;
            ipAddress: any;
            userAgent: any;
            status: any;
            duration: any;
            riskLevel: any;
            complianceLevel: any;
            isFinancial: any;
            isSensitive: any;
            user: any;
        })[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
        hasNext: boolean;
        hasPrev: boolean;
    }>;
    getByTraceId(traceId: string, user: any): Promise<{
        traceId: string;
        logs: {
            id: string;
            action: import("@prisma/client").$Enums.AuditAction;
            module: string;
            when: string;
            duration: number | null;
            status: import("@prisma/client").$Enums.AuditStatus;
            errorMessage: string | null;
        }[];
        totalDuration: number;
    }>;
    getStatistics(dto: AuditStatisticsDto, user: any): Promise<{
        period: {
            start: string;
            end: string;
        };
        summary: {
            total: number;
            success: number;
            failed: number;
            financial: number;
            sensitive: number;
        };
        byModule: {
            module: string;
            count: number;
            successRate: number;
        }[];
        byAction: {
            action: import("@prisma/client").$Enums.AuditAction;
            count: number;
        }[];
        byDay: {
            date: string;
            count: number;
        }[];
    }>;
    verifyIntegrity(dto: VerifyIntegrityDto, user: any): Promise<{
        verified: boolean;
        totalRecords: number;
        passCount: number;
        failCount: number;
        failures: {
            logId: string;
            type: "HASH_CHAIN_BROKEN" | "HASH_MISMATCH" | "INVALID_GENESIS" | "SIGNATURE_INVALID";
            message: string;
            expectedHash: string | undefined;
            actualHash: string | undefined;
        }[];
        verifiedAt: string;
        duration: number;
    }>;
    triggerIntegrityCheck(dto: IntegrityCheckDto, user: any): Promise<{
        jobId: string;
        status: string;
        createdAt: string;
        message: string;
    }>;
    getIntegrityCheckStatus(jobId: string, user: any): Promise<import("./audit.service").IntegrityCheckJob>;
    exportLogs(dto: AuditExportDto, user: any, res: Response): Promise<Response<any, Record<string, any>>>;
    private convertToCSV;
    generateSoxReport(dto: DateRangeReportDto, user: any): Promise<{
        reportType: string;
        reportPeriod: {
            start: string;
            end: string;
        };
        generatedAt: string;
        region: string;
        tenantId: string;
        sections: {
            financialOperations: {
                totalOperations: number;
                operationsByType: {
                    action: import("@prisma/client").$Enums.AuditAction;
                    count: number;
                }[];
                topUsers: {
                    userId: string;
                    username: string;
                    displayName: string | null;
                    operationCount: number;
                }[];
                retentionCompliance: {
                    required: string;
                    status: string;
                };
            };
            accessControlChanges: {
                totalChanges: number;
                changesByType: {
                    roleAssignments: number;
                    permissionChanges: number;
                };
                recentChanges: {
                    id: string;
                    when: string;
                    who: string;
                    action: import("@prisma/client").$Enums.AuditAction;
                    entityType: string;
                    entityId: string;
                    what: string;
                    riskLevel: import("@prisma/client").$Enums.RiskLevel;
                }[];
            };
            highRiskOperations: {
                totalHighRisk: number;
                byModule: Record<string, number>;
                byAction: Record<string, number>;
                recentOperations: {
                    id: string;
                    when: string;
                    who: string;
                    module: string;
                    action: import("@prisma/client").$Enums.AuditAction;
                    what: string;
                    status: import("@prisma/client").$Enums.AuditStatus;
                    isSensitive: boolean;
                }[];
            };
            failedOperations: {
                totalFailed: number;
                errorPatterns: Record<string, number>;
                moduleFailures: Record<string, number>;
                recentFailures: {
                    id: string;
                    when: string;
                    who: string;
                    module: string;
                    action: import("@prisma/client").$Enums.AuditAction;
                    what: string;
                    errorMessage: string | null;
                }[];
            };
            integrityChecks: {
                totalChecks: number;
                passedChecks: number;
                failedChecks: number;
                passRate: number;
                recentChecks: {
                    id: string;
                    checkType: import("@prisma/client").$Enums.IntegrityCheckType;
                    when: string;
                    recordCount: number;
                    passCount: number;
                    failCount: number;
                    status: import("@prisma/client").$Enums.CheckStatus;
                }[];
                failures: {
                    id: string;
                    when: string;
                    failCount: number;
                    errorMessage: string | null;
                    failures: import("@prisma/client/runtime/library").JsonValue;
                }[];
            };
            anomalies: {
                loginFailures: {
                    detected: number;
                    anomalies: {
                        userId: string;
                        username: string;
                        failureCount: number;
                        severity: string;
                    }[];
                };
                bulkOperations: {
                    detected: number;
                    operations: {
                        id: string;
                        when: string;
                        who: string;
                        action: import("@prisma/client").$Enums.AuditAction;
                        module: string;
                        entityType: string;
                        what: string;
                        status: import("@prisma/client").$Enums.AuditStatus;
                    }[];
                };
                afterHoursOps: {
                    detected: number;
                    operations: {
                        id: string;
                        when: string;
                        who: string;
                        module: string;
                        action: import("@prisma/client").$Enums.AuditAction;
                        what: string;
                        riskLevel: import("@prisma/client").$Enums.RiskLevel;
                        isSensitive: boolean;
                    }[];
                };
            };
        };
        complianceStatus: {
            status: string;
            issues: {
                severity: string;
                message: string;
            }[];
            summary: string;
        };
    }>;
    generateGdprReport(userId: string, user: any): Promise<{
        reportType: string;
        generatedAt: string;
        dataSubject: {
            userId: string;
        };
        summary: {
            totalAccesses: number;
            accessByAction: Record<string, number>;
            uniqueAccessors: number;
        };
        accessors: {
            userId: string;
            username: string;
            accessCount: number;
        }[];
        recentAccesses: {
            when: string;
            who: string;
            action: import("@prisma/client").$Enums.AuditAction;
            module: string;
            what: string;
        }[];
    }>;
    generateAnomalyReport(dto: DateRangeReportDto, user: any): Promise<{
        reportType: string;
        reportPeriod: {
            start: string;
            end: string;
        };
        generatedAt: string;
        region: string;
        tenantId: string;
        anomalies: {
            loginFailures: {
                detected: number;
                anomalies: {
                    userId: string;
                    username: string;
                    failureCount: number;
                    severity: string;
                }[];
            };
            bulkOperations: {
                detected: number;
                operations: {
                    id: string;
                    when: string;
                    who: string;
                    action: import("@prisma/client").$Enums.AuditAction;
                    module: string;
                    entityType: string;
                    what: string;
                    status: import("@prisma/client").$Enums.AuditStatus;
                }[];
            };
            afterHoursOps: {
                detected: number;
                operations: {
                    id: string;
                    when: string;
                    who: string;
                    module: string;
                    action: import("@prisma/client").$Enums.AuditAction;
                    what: string;
                    riskLevel: import("@prisma/client").$Enums.RiskLevel;
                    isSensitive: boolean;
                }[];
            };
        };
        severity: string;
    }>;
    exportSoxReport(dto: DateRangeReportDto, user: any, res: Response): Promise<Response<any, Record<string, any>>>;
    batchCheckAlerts(dto: BatchCheckAlertsDto, user: any): Promise<{
        period: {
            start: string;
            end: string;
        };
        alertCount: number;
        alerts: {
            userId: string;
            username?: string;
            alertType: string;
            severity: string;
            count: number;
            details: any;
        }[];
    }>;
    getUserAlertStatus(userId: string, user: any): Promise<{
        hasActiveAlerts: boolean;
        alerts: any[];
        riskScore: number;
    }>;
    detectContinuousFailures(dto: DetectFailuresDto, user: any): Promise<{
        detected: boolean;
        failureCount: number;
        shouldLock?: boolean;
    }>;
    detectAnomalousPattern(dto: DetectAnomalyDto, user: any): Promise<{
        detected: boolean;
        anomalies: Array<{
            type: string;
            description: string;
            severity: "HIGH" | "MEDIUM" | "LOW";
        }>;
    }>;
}
