Skip to content

core audit service implementation#4

Merged
y-aithnini merged 5 commits intodevelopfrom
feature/AK-002-core-audit-service
Mar 16, 2026
Merged

core audit service implementation#4
y-aithnini merged 5 commits intodevelopfrom
feature/AK-002-core-audit-service

Conversation

@y-aithnini
Copy link

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

Copilot AI review requested due to automatic review settings March 13, 2026 13:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the core AuditService class, which is the main business logic layer for audit logging operations. It orchestrates creating audit log entries, querying/retrieving logs, and detecting changes between object states. The service follows a clean architecture pattern with dependency injection of port interfaces. A comprehensive test suite and a schema extension for change detection options are also included.

Changes:

  • Added AuditService class with methods for logging, querying, change detection, and actor validation
  • Added unit tests covering all service methods, error handling, and edge cases
  • Extended CreateAuditLogWithChangesSchema with an options field for change detection configuration

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/core/audit.service.ts New core audit service with log, query, change detection, and validation methods
src/core/audit.service.spec.ts Comprehensive Jest unit tests for the audit service
src/core/dtos/create-audit-log.dto.ts Added options field to CreateAuditLogWithChangesSchema for change detection config

Copilot AI review requested due to automatic review settings March 13, 2026 13:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings March 13, 2026 14:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@sonarqubecloud
Copy link

@y-aithnini y-aithnini merged commit 370361d into develop Mar 16, 2026
2 checks passed
@y-aithnini y-aithnini deleted the feature/AK-002-core-audit-service branch March 16, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants