Skip to content

MongoDb, User, IAuditable and Tests implementation added.#3

Open
victorioustr wants to merge 2 commits intofurkandeveloper:mainfrom
Snappyup:feature/mongodb
Open

MongoDb, User, IAuditable and Tests implementation added.#3
victorioustr wants to merge 2 commits intofurkandeveloper:mainfrom
Snappyup:feature/mongodb

Conversation

@victorioustr
Copy link
Copy Markdown

This PR introduces a series of improvements and features to enhance the audit logging functionality for entities implementing the IAuditable interface. The main changes include:

  1. MongoDB Integration for Audit Logs
  • Implemented MongoDB as the backend for storing audit logs, ensuring scalability and reliability.
  1. Selective Entity Auditing
  • Configured the audit logging system to work exclusively with entities implementing the IAuditable interface. This ensures that only the relevant entities are logged, reducing unnecessary overhead.
  1. Change Tracking Enhancements
  • Introduced a parameter to ignore logging for fields that have not changed during an update operation. This reduces noise in the audit logs and focuses on meaningful changes.
  1. User Information Logging
  • Integrated IHttpContextAccessor to capture and log the user information performing the changes. This includes details like the user's identity, enhancing traceability and accountability.
  1. Database Migrations for Audit Log Storage
  • Added the necessary database migrations to support for storing audit logs.

Key Benefits:

  • Improved clarity and focus in audit logs by excluding unchanged fields.

  • Enhanced traceability with user information logged for each operation.

  • Optimized auditing system by restricting it to IAuditable entities.

  • Scalability with MongoDB as the audit log backend.

Testing & Validation:

  • Verified the new audit logging functionality with various IAuditable entities.

  • Tested the change tracking parameter to ensure unchanged fields are ignored as expected.

  • Confirmed successful integration of user information from IHttpContextAccessor.

  • Validated the database migrations for compatibility and correctness.

Please review the changes and let me know if additional refinements or documentation are needed.

@furkandeveloper furkandeveloper self-requested a review December 22, 2024 11:17
@furkandeveloper furkandeveloper self-assigned this Dec 22, 2024
@furkandeveloper furkandeveloper added the enhancement New feature or request label Dec 22, 2024
@furkandeveloper
Copy link
Copy Markdown
Owner

Looks great. There are quite a few changes. It may take me a while to check them all. Thanks for your input. I'll take care of it as soon as possible. 🚀 @victorioustr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants