The Audit subsystem manages audit-trail access and exports across organization-wide and project scopes. AuditController handles organization queries, filter facets, and CSV or JSON exports through queryOrg, orgFacets, and exportOrg, while query, exportCSV, and exportJSON cover project audit trails. AuditService records or retrieves audit information against the Database, using the standardized AUDIT_ACTIONS taxonomy and AuditAction inputs.
12 entities in atloria-monorepo/apps/api/src/audit. 9 other subsystems depend on it, which makes it the 6th most depended-upon part of this codebase.
What it is made of
Its 12 entities sit in 4 files under atloria-monorepo/apps/api/src/audit: 6 HTTP endpoints, 1 controller, 1 module, 1 service and 3 more.
audit.controller.ts holds 7 of them — more than any other file here.
AuditService declares 4 methods, the widest surface here.
Where work enters
1 controller publishes 6 GET endpoints. They answer under /audit. Every one of them declares a guard — JwtAuthGuard on 6 and OrganizationGuard on 6.
AuditController—atloria-monorepo/apps/api/src/audit/audit.controller.ts:16queryOrg—atloria-monorepo/apps/api/src/audit/audit.controller.ts:27orgFacets—atloria-monorepo/apps/api/src/audit/audit.controller.ts:55exportOrg—atloria-monorepo/apps/api/src/audit/audit.controller.ts:63query—atloria-monorepo/apps/api/src/audit/audit.controller.ts:104exportCSV—atloria-monorepo/apps/api/src/audit/audit.controller.ts:128
How work moves through it
mermaidflowchart LR AuditController0["AuditController"] AuditService10["AuditService"] AuditController0 --> AuditService10 PrismaService20["PrismaService"] AuditService10 --> PrismaService20
Work enters at AuditController and passes through 2 other components. Each step below is a dependency edge between two entities in this repository, followed outward in order.
AuditControllertakes the work first —atloria-monorepo/apps/api/src/audit/audit.controller.ts:16.- Next,
AuditControllerhands off toAuditService—atloria-monorepo/apps/api/src/audit/audit.service.ts:19. - Finally,
AuditServicehands off toPrismaService—atloria-monorepo/libs/database/src/lib/prisma.service.ts:28.
When a step fails
AuditServicehandles failure in 1 place: it logs it and continues in all 1.PrismaServicehandles failure in 1 place: it lets it reach the caller in all 1.
How it refuses and fails
1 of its components records a refusal or a failure handler.
Its catch blocks handle a failure that already happened in 1 place.
Boundaries
9 other subsystems depend on this one — Api, Auth, Branding, Doc Version, Invitation, Platform, Project, Reader Access, Scim. Changing what it exposes changes them.
Those 9 hold 21 edges between them, unevenly: Doc Version reaches in across 4 edges, while another holds one. 21 edges arrive against 2 leaving — more of this repository reaches into it than it reaches out to. What they reach is narrower than the folder: 2 of its 12 members carry every inbound edge — AuditService (12) and AuditModule (9).
It depends on Database, and on nothing else in this repository.
Was this page helpful?