You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no audit trail for any actions performed in the system. When an asset is created, updated, or transferred, there is no record of who made the change or when.
Proposed Solution
Create backend/src/opsce/audit/entities/audit-log.entity.ts. This should be a write-once, append-only entity. Create an AuditService with a log() method injected by other services.
Acceptance Criteria
Entity has fields: id (UUID), userId, action (string), resourceType (string), resourceId (string), oldValue (JSON), newValue (JSON), ipAddress, userAgent, createdAt
No updatedAt or deletedAt (audit logs are immutable)
@Index() on userId, resourceType, resourceId, createdAt
AuditService.log(dto) method created for use by other modules
Problem
There is no audit trail for any actions performed in the system. When an asset is created, updated, or transferred, there is no record of who made the change or when.
Proposed Solution
Create
backend/src/opsce/audit/entities/audit-log.entity.ts. This should be a write-once, append-only entity. Create anAuditServicewith alog()method injected by other services.Acceptance Criteria
id(UUID),userId,action(string),resourceType(string),resourceId(string),oldValue(JSON),newValue(JSON),ipAddress,userAgent,createdAtupdatedAtordeletedAt(audit logs are immutable)@Index()onuserId,resourceType,resourceId,createdAtAuditService.log(dto)method created for use by other modulesOpsceModule