export interface SidebarItem {
    label: string
    to: string
    icon: string
}

export interface SidebarSection {
    label: string
    icon: string
    items: SidebarItem[]
}

/**
 * Entree d'audit telle qu'elle est renvoyee par GET /api/audit-logs.
 *
 * `changes` est un payload libre dont le format depend de `action` :
 *  - `create` / `delete` : snapshot complet { champ: valeur } ;
 *  - `update`            : diff { champ: { old, new } }.
 */
export interface AuditLogEntry {
    id: string
    entityType: string
    entityId: string
    action: 'create' | 'update' | 'delete'
    changes: Record<string, unknown>
    performedBy: string
    performedAt: string
    ipAddress: string | null
    requestId: string | null
}

/**
 * Filtres combinables en query params (AND) pour GET /api/audit-logs.
 * Les bornes de date utilisent la syntaxe API Platform `performed_at[after]` /
 * `performed_at[before]`.
 */
export interface AuditLogFilters {
    /** Chaine pour un seul type, liste pour un filtre multi-selection. */
    entityType?: string | string[]
    entityId?: string
    action?: string
    performedBy?: string
    performedAtAfter?: string
    performedAtBefore?: string
    page?: number
    itemsPerPage?: number
}

export interface AuditLogEntityTypes {
    id: string
    entityTypes: string[]
}
