import { AuditAction } from '@prisma/client';

export interface CreateAuditLogParams {
    userId?: number;
    action: AuditAction;
    entityType: string;
    entityId?: number;
    oldValue?: any;
    newValue?: any;
    ipAddress?: string;
    userAgent?: string;
    metadata?: any;
}

export interface AuditLogFilters {
    userId?: number;
    action?: AuditAction;
    entityType?: string;
    entityId?: number;
    startDate?: Date;
    endDate?: Date;
    page?: number;
    limit?: number;
}

export interface AuditLogResponse {
    id: number;
    user_id: number | null;
    action: AuditAction;
    entity_type: string;
    entity_id: number | null;
    old_value: any;
    new_value: any;
    ip_address: string | null;
    user_agent: string | null;
    metadata: any;
    created_at: Date;
    user?: {
        id: number;
        username: string;
        email: string;
    } | null;
}

export interface ListAuditLogsResponse {
    data: AuditLogResponse[];
    pagination: {
        page: number;
        limit: number;
        total: number;
        totalPages: number;
    };
}

export interface AuditLogSummary {
    action: AuditAction;
    count: number;
}

export interface AuditLogStats {
    totalLogs: number;
    todayLogs: number;
    actionSummary: AuditLogSummary[];
    recentActivity: AuditLogResponse[];
}
