Data Layer medium complexity backend
0
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Manages persistent storage of audit log entries with strict append-only enforcement at the database level. Provides scoped read access with filtering and pagination, and supports bulk export queries for compliance reporting.

Feature: Audit Log

audit-log-repository

Sources & reasoning

Line 259 states an explicit hard requirement: every Global Admin support-access session must be logged in the org's audit trail. admin-security is always-on (line 241), fixing the target release at MVP. GDPR obligations for health data and encrypted assignments reinforce the critical priority; no later phase can satisfy the compliance requirement that audit trail coverage begins from day one.

  • docs/source/likeperson.md · line 259
    Every support-access session is logged in the org's audit trail.
  • docs/source/likeperson.md · line 239-241
    Always-on core. A small set of modules is non-toggleable because the operational products are meaningless without them... Admin Web Portal: `admin-dashboard`, `admin-user-management`, `admin-organization`, `admin-security`.

Responsibilities

  • Insert new audit entries with database-level immutability constraints (no UPDATE/DELETE)
  • Query entries by organization with filters for date range, event type, and user
  • Support paginated reads with stable cursor-based ordering by timestamp
  • Execute bulk export queries returning full entry sets matching filter criteria
  • Maintain indexes optimized for org-scoped time-range and event-type queries

Interfaces

insert(entry: AuditEntryRecord): Promise<AuditEntry>
findByOrg(orgId: string, filters: AuditLogFilters, page: number): Promise<PagedAuditLog>
findAllForExport(orgId: string, filters: AuditLogFilters): Promise<AuditEntry[]>
findById(entryId: string): Promise<AuditEntry | null>

Related Data Entities (2)

Data entities managed by this component