# Snapshot Entities, Not Outbound DTOs

Captures audit before and after state from stored entities so the history reflects what changed.

Follow these project instructions.
# Snapshot Entities, Not Outbound DTOs

Captures audit before and after state from stored entities so the history reflects what changed.

Version: `1.0.0`

Snapshot the stored entity, not the shape you were about to send back. An outbound DTO is built for a reader: it hides fields, flattens relationships and formats values, and every one of those decisions removes something the history needed.

The failure is delayed and total. A year later, reconstructing what a record looked like, you find the fields the API happened not to expose were never captured - and there is no way to recover them.

Take the before state from what was loaded and the after state from what was saved, on the same entity type. Then the two are comparable, and a difference between them is a real change rather than an artefact of formatting.

Exclude by decision, not by accident. Secrets and data you must not retain should be removed from the snapshot explicitly, which documents why they are absent.

#### Constraints
- Do not let a formatted or flattened value stand in for the stored one.
- Never leave secrets in a snapshot - remove them explicitly.
- Never pass an outbound DTO into an audit snapshot.

#### Verification
- A field the API does not expose still appears in the history
- Anything excluded was excluded deliberately, with the reason recorded
- Before and after snapshots are the same stored entity type
