💰 Abstractions / Audit¶
🎯 Purpose¶
The Audit folder defines the public audit-related contracts and data types for the Currency system.
These types describe how audit information is represented and exposed. They do not define how audit history is stored, retained, or internally produced.
🧠 Usage Guidance¶
Audit abstractions are intended to:
- Define the data shape for currency audit records
- Provide optional capability interfaces for reading or observing audit data
- Keep audit consumers independent from concrete audit implementations
🧩 What Lives Here¶
CurOpKind¶
-
High-level kind of committed currency mutation:
-
Set CreditDebitTransfer
CurrencyAuditEntry¶
- Immutable snapshot of a single audit record
-
Includes:
-
operation kind
- source/destination owners
- currency
- before/after values
- delta
- optional reason/sourceId
- session and UTC timestamps
ICurrencyAuditReader¶
- Optional read-only audit history capability
- Exposes recent entries for an owner
ICurrencyAuditEvents¶
- Optional live audit event capability
- Exposes
OnAuditEntryfor services that emit audit records as operations occur
⚠️ Important Notes¶
- Audit is an optional capability
- These abstractions do not guarantee that auditing exists
- They define the shape of audit data when a composed service supports it
- History ordering and retention are implementation-defined
- Live events and stored history are separate capabilities
🧠 Usage Guidance¶
Mental model¶
- Abstractions define the contract
- Implementations decide storage, retention, and emission
- Consumers should depend only on available capabilities
If a service does not record audit history, it may not implement:
ICurrencyAuditReaderICurrencyAuditEvents
🚫 Internal Use Only¶
This folder defines contracts only.
Do not:
- Add storage or retention logic
- Assume persistence or buffering behaviour
- Depend on implementation details from other layers
🧹 Safe to Remove¶
This folder should not be removed if any audit-related functionality is required.
Other systems may depend on these contracts when audit capabilities are composed.
🔗 Related Documentation¶
- Abstractions / Primitives — shared primitive types like
CurrencyId - PublicAPI / Audit — supported helpers for reading/subscribing to audit data
- Internal — audit implementation details (not part of the public contract)