feat(commons): add Audit{Channel,Kind,Status,ForwardState} enums for #23
This commit is contained in:
13
src/ScadaLink.Commons/Types/Enums/AuditChannel.cs
Normal file
13
src/ScadaLink.Commons/Types/Enums/AuditChannel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace ScadaLink.Commons.Types.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Top-level Audit Log (#23) channel — the trust boundary the audited action crosses.
|
||||
/// One of: outbound API call, outbound DB write, notification send/deliver, or inbound API request.
|
||||
/// </summary>
|
||||
public enum AuditChannel
|
||||
{
|
||||
ApiOutbound,
|
||||
DbOutbound,
|
||||
Notification,
|
||||
ApiInbound
|
||||
}
|
||||
14
src/ScadaLink.Commons/Types/Enums/AuditForwardState.cs
Normal file
14
src/ScadaLink.Commons/Types/Enums/AuditForwardState.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace ScadaLink.Commons.Types.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Site-local Audit Log (#23) forwarding state, tracked only in the site SQLite hot-path.
|
||||
/// Central rows leave this null. <c>Pending</c> = not yet sent; <c>Forwarded</c> = telemetry sent
|
||||
/// and acked; <c>Reconciled</c> = confirmed present centrally via the periodic pull fallback.
|
||||
/// The site retention purge MUST NOT drop a row whose state is still <c>Pending</c>.
|
||||
/// </summary>
|
||||
public enum AuditForwardState
|
||||
{
|
||||
Pending,
|
||||
Forwarded,
|
||||
Reconciled
|
||||
}
|
||||
20
src/ScadaLink.Commons/Types/Enums/AuditKind.cs
Normal file
20
src/ScadaLink.Commons/Types/Enums/AuditKind.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace ScadaLink.Commons.Types.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Specific Audit Log (#23) event kind within a channel — what action produced the row.
|
||||
/// Cached variants emit multiple rows per operation (submit → forward → attempt → resolve).
|
||||
/// See alog.md §4 for the full taxonomy.
|
||||
/// </summary>
|
||||
public enum AuditKind
|
||||
{
|
||||
ApiCall,
|
||||
ApiCallCached,
|
||||
DbWrite,
|
||||
DbWriteCached,
|
||||
NotifySend,
|
||||
NotifyDeliver,
|
||||
InboundRequest,
|
||||
InboundAuthFailure,
|
||||
CachedSubmit,
|
||||
CachedResolve
|
||||
}
|
||||
18
src/ScadaLink.Commons/Types/Enums/AuditStatus.cs
Normal file
18
src/ScadaLink.Commons/Types/Enums/AuditStatus.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace ScadaLink.Commons.Types.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Lifecycle status of an Audit Log (#23) event row.
|
||||
/// Cached operations produce multiple rows tracking <c>Submitted → Forwarded → Attempted → Delivered/Parked/Discarded</c>.
|
||||
/// <c>Skipped</c> is used when an action was short-circuited (e.g. dry-run) but should still be audited.
|
||||
/// </summary>
|
||||
public enum AuditStatus
|
||||
{
|
||||
Submitted,
|
||||
Forwarded,
|
||||
Attempted,
|
||||
Delivered,
|
||||
Failed,
|
||||
Parked,
|
||||
Discarded,
|
||||
Skipped
|
||||
}
|
||||
Reference in New Issue
Block a user