Skip to content

implemented adapter#5

Merged
y-aithnini merged 1 commit intodevelopfrom
feature/AK-003-database-kit-adapter
Mar 16, 2026
Merged

implemented adapter#5
y-aithnini merged 1 commit intodevelopfrom
feature/AK-003-database-kit-adapter

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 16, 2026 13:27
@sonarqubecloud
Copy link

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

Adds infrastructure-layer repository adapters for persisting and querying audit logs, including a MongoDB (Mongoose) implementation and an in-memory implementation, and exposes them through the package’s public exports.

Changes:

  • Added MongoDB audit repository adapter + Mongoose schema with indexes/middleware.
  • Added in-memory audit repository adapter supporting filtering/pagination/sorting.
  • Expanded AuditLogFilters (multi-action filter + request/session IDs) and re-exported infra from the root package.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/infra/repositories/mongodb/mongo-audit.repository.ts Implements IAuditLogRepository using a Mongoose Model with filtering/pagination helpers.
src/infra/repositories/mongodb/audit-log.schema.ts Defines AuditLogSchema, indexes, and immutability-focused middleware.
src/infra/repositories/mongodb/index.ts Public exports for MongoDB repository/schema types.
src/infra/repositories/in-memory/in-memory-audit.repository.ts Implements IAuditLogRepository in-memory with filtering/pagination/sorting utilities.
src/infra/repositories/in-memory/index.ts Public export for the in-memory repository.
src/infra/repositories/index.ts Aggregates repository implementations for infra layer.
src/infra/index.ts Exposes infra-layer exports.
src/index.ts Re-exports infra from the package root.
src/core/types.ts Extends AuditLogFilters with actions, requestId, sessionId.
package.json Adds mongoose as a peer dependency and dev dependency.
package-lock.json Locks newly added mongoose dependency tree.

@y-aithnini y-aithnini merged commit e82150b into develop Mar 16, 2026
6 checks passed
@y-aithnini y-aithnini deleted the feature/AK-003-database-kit-adapter branch March 16, 2026 13:41
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