Conversation
|
Hi Yasamin, I’ll review it within the next few days and let you know if anything needs adjustment. Thanks again for the contribution! 🙌 |
|
Thanks a lot for the quick feedback🌹 I'm Glad to hear audit logging is a useful addition. Looking forward to your review and will address any adjustments you suggest. |
|
Heads-up: I just pushed some updates to the dev branch (structural tweaks + minor service changes), so please pull/rebase from dev and resolve any merge conflicts before I start the review. That’ll keep feedback focused on the audit layer itself. To help speed things up, could you add (or confirm) a concise section in the PR description covering: Architecture / Pattern Capture approach: interceptor, decorator, domain events, EF Core SaveChanges hook, or pipeline behavior? Performance / Reliability Any batching or deferred write? Configuration How to enable/disable globally or per module. If you drop that summary in, the review will go much faster. Let me know once you’ve rebased and updated. |
|
Thank you for the comprehensive feedback! ❤️ I'll rebase from the dev branch and resolve any conflicts, I updated the descriptions of PR and it includes all of the concerns you raised. Looking back, I realize I should have initiated a technical discussion and maybe modeling document before implementing the audit layer to align on the architectural approach and gather your input on design decisions. I've learned from this experience and will make sure to engage in upfront technical discussions for future significant features. Thanks again for your patience and thorough guidance 🌹 |
|
I resolved the conflicts, and I am waiting for your feedback 💯 |
|
Hi Yasamin ✌🏻, Column Type for
|
|
Hi Mr. Rahmani, I’m really sorry I haven’t had the chance to go through everything yet. It’s been a bit busy these past few days, but I’ll take some time this weekend to review everything carefully and make the updates. Thanks again for your patience and all the helpful insights! |
|
Thank you for your great feedback. Summary of the last changes:
|
Audit Logging
linked issue: #1
Hi Mr. Rahmani 🌹 Thank you for the recent updates, it is great and I use FastCrud in my daily works.
I apologize for the extended development time on this implementation I wanted to ensure it follows the project's architecture patterns correctly and maintains the high quality standards of FastCrud.
Features
This PR adds audit logging functionality to FastCrud, enabling automatic tracking of all CRUD operations including Create, Update, Delete on entities.
New Endpoint for Audit
Response Example
However, the responses need refinement. I want to confirm the implementation on your end, and then, if permissible, I will proceed with some refactoring.
🔴 Architecture and Patterns Details
1. Capture approach:
EF Core SaveChanges Interceptor and Manual Service (Manual Service for
EfAuditService<TDbContext, TAuditEntry>)2. Persistence:
This code implemented with sync / async approach and audit entries will save immediately and doesn't go to the queue for processing
🔍 Performance and Reliability
1. Batching / Deferred
We used both in the EntityAuditingInterceptor but we don't heve neither in EfAuditService
✅EntityAuditingInterceptor
❌ EfAuditService
2. Transaction coupling
✅EntityAuditingInterceptor has Same Transaction
❌ EfAuditService has Fire-and-forget
❌ CrudServices has Fire-and-forget:
3. Handling large diffs (field-level vs full snapshot)
We used field-level tracking.
🔍 Configuration
1. Enable/disable globally or per module?
✅ Global Enable exists in AddEfAuditing registration
We don't have any disable globally in Configuration Options and we ONLY have per entity in IAuditEntry and HasId checks
2. DI Registration Pattern
✅ Yes
Extension method pattern
Generic constraints
coped lifetime
Factory pattern for IAuditService
Method AddCustomAuditUserProvider