/**
 * Audit API Models
 * Models for audit logs and entity trails
 */

export type ActorType = 'APPLICANT' | 'DEPARTMENT' | 'SYSTEM' | 'ADMIN';
export type AuditAction = 'CREATE' | 'UPDATE' | 'DELETE' | 'APPROVE' | 'REJECT' | 'SUBMIT' | 'CANCEL' | 'DOWNLOAD';

export interface AuditLogDto {
  id: string;
  entityType: string;
  entityId: string;
  action: AuditAction;
  actorId: string;
  actorType: ActorType;
  changes: Record<string, any>;
  metadata: Record<string, any>;
  timestamp: string;
  ipAddress?: string;
  userAgent?: string;
}

export interface EntityAuditTrailDto {
  entityId: string;
  entityType: string;
  events: AuditLogDto[];
}

export interface AuditMetadataDto {
  actions: string[];
  entityTypes: string[];
  actorTypes: ActorType[];
}

export interface PaginatedAuditLogsResponse {
  data: AuditLogDto[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
  hasNextPage: boolean;
}

export interface AuditLogFilters {
  entityType?: string;
  entityId?: string;
  action?: AuditAction;
  actorId?: string;
  actorType?: ActorType;
  startDate?: string;
  endDate?: string;
  page?: number;
  limit?: number;
}
