View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |

Plans for Cat.Auditing

Records who changed what and when.
Status: not started. This plan collects what we know. The open questions need an answer before the build.

Contents

The idea

Some changes matter later: a price that was changed, an order that was cancelled. People ask who did it and when. An audit trail answers that without anyone writing log statements by hand.

Cat.Auditing records the change together with the user and the time. The business logic should not have to know about it.

What we already know

From the demo plan:

From the module conventions:

From the architecture:

Decisions and open questions

Decided

Topic Decision
Content Who, what and when.
Style Added through a decorator or an event subscriber, not in the business logic.
User The module gets the user from ICatUser in Cat.Authorization.Abstractions. Cat.Authorization owns that interface.

Open

Questions before building

  1. What is audited: use cases, entity changes or both?
  2. Do you want old and new values, or only the fact?
  3. Where should the trail live: in each service database or in one central place?
  4. Is it fine that this module references Cat.Authorization.Abstractions for ICatUser? Which members of ICatUser does auditing need?
  5. How long must the trail be kept, and are there privacy rules we must follow?
  6. Is an audit failure allowed to fail the business action?
  7. How do we mark what to audit?
  8. What should be recorded when there is no user?
  9. Do we need to read the trail in the demo, and through which endpoint?
  10. Does OrderAuditSubscriber in the demo stay as an example of the event approach, or does the module replace it?