Audit Log

This commit is contained in:
2026-03-27 14:58:12 +01:00
parent d7ae840ac6
commit a3247a69b6
13 changed files with 734 additions and 9 deletions
+41
View File
@@ -0,0 +1,41 @@
/**
* Client API per Audit Log.
*/
import apiClient from './client'
import type { PaginatedResponse } from '@/types/api.types'
export interface AuditLogEntry {
id: number
tenant_id: string | null
user_id: string | null
action: string
resource_type: string | null
resource_id: string | null
ip_address: string | null
user_agent: string | null
payload: Record<string, unknown> | null
outcome: 'success' | 'failure'
occurred_at: string
}
export type AuditLogListResponse = PaginatedResponse<AuditLogEntry>
export interface AuditLogParams {
page?: number
page_size?: number
action?: string
user_id?: string
outcome?: 'success' | 'failure'
date_from?: string
date_to?: string
resource_type?: string
tenant_id?: string
}
export const auditLogApi = {
list: (params: AuditLogParams = {}): Promise<AuditLogListResponse> =>
apiClient
.get<AuditLogListResponse>('/audit-log', { params })
.then((r) => r.data),
}