/**
 * 数据清理配置相关类型定义
 */

// 数据清理配置
export interface DataCleanupConfig {
  id: number
  table_name: string
  description: string
  retention_days: number
  batch_size: number
  enabled: number // 0=禁用，1=启用
  created_at: string
  updated_at: string
  updated_by: number
}

// 创建数据清理配置请求
export interface CreateDataCleanupConfigRequest {
  table_name: string
  retention_days: number
  batch_size?: number
  description?: string
}

// 更新数据清理配置请求
export interface UpdateDataCleanupConfigRequest {
  retention_days?: number
  batch_size?: number
  description?: string
  enabled?: number
}

// 数据清理日志
export interface DataCleanupLog {
  id: number
  table_name: string
  cleanup_type: 'scheduled' | 'manual'
  status: 'success' | 'failed' | 'running'
  retention_days: number
  deleted_count: number
  duration_ms: number
  started_at: string
  completed_at: string | null
  error_message: string
  triggered_by: number | null
}

// 数据清理日志查询参数
export interface DataCleanupLogQueryParams {
  table_name?: string
  page?: number
  page_size?: number
}

// 数据清理预览项
export interface DataCleanupPreviewItem {
  table_name: string
  description: string
  retention_days: number
  record_count: number
}

// 数据清理进度
export interface DataCleanupProgress {
  is_running: boolean
  current_table: string
  total_tables: number
  processed_tables: number
  total_deleted: number
  started_at: string | null
  last_log: DataCleanupLog | null
}

// 手动触发数据清理请求
export interface TriggerDataCleanupRequest {
  table_name?: string
}
