Table of Contents

Class AuditResidueLifecycleEvent

Namespace
AsiBackbone.Core.Audit
Assembly
AsiBackbone.Core.dll

Represents a framework-neutral lifecycle event linked to a governed audit residue flow.

public sealed class AuditResidueLifecycleEvent
Inheritance
AuditResidueLifecycleEvent
Inherited Members

Remarks

Lifecycle events are append-only progress records. They allow acknowledgment, capability token, gateway, outbox, and provider delivery activity to be recorded without rewriting the original decision residue.

Properties

AuditResidueId

Gets the related audit residue identifier when the original decision residue is available.

public string? AuditResidueId { get; }

Property Value

string

CorrelationId

Gets the correlation identifier that links this lifecycle event to the original decision context.

public string CorrelationId { get; }

Property Value

string

EventId

Gets the stable identifier for this lifecycle event.

public string EventId { get; }

Property Value

string

HasAuditResidueId

Gets a value indicating whether this lifecycle event is linked to an audit residue identifier.

public bool HasAuditResidueId { get; }

Property Value

bool

HasMetadata

Gets a value indicating whether this lifecycle event contains metadata.

public bool HasMetadata { get; }

Property Value

bool

Metadata

Gets additional framework-neutral lifecycle metadata supplied by the host.

public IReadOnlyDictionary<string, string> Metadata { get; }

Property Value

IReadOnlyDictionary<string, string>

OccurredUtc

Gets the UTC timestamp when the lifecycle event occurred.

public DateTimeOffset OccurredUtc { get; }

Property Value

DateTimeOffset

OperationName

Gets the operation name associated with the lifecycle event, when supplied by the host or original residue.

public string? OperationName { get; }

Property Value

string

Outcome

Gets the decision, gateway, emission, or host-defined outcome associated with this lifecycle event, when supplied.

public string? Outcome { get; }

Property Value

string

Stage

Gets the lifecycle stage represented by this event.

public AuditResidueLifecycleStage Stage { get; }

Property Value

AuditResidueLifecycleStage

StageSequence

Gets the stable sequence value for this lifecycle stage.

public int StageSequence { get; }

Property Value

int

TraceId

Gets the trace identifier associated with the lifecycle event, when supplied by the host or original residue.

public string? TraceId { get; }

Property Value

string

Methods

Create(AuditResidueLifecycleStage, string, string?, string?, DateTimeOffset?, string?, string?, string?, IReadOnlyDictionary<string, string>?)

Creates an audit residue lifecycle event.

public static AuditResidueLifecycleEvent Create(AuditResidueLifecycleStage stage, string correlationId, string? auditResidueId = null, string? eventId = null, DateTimeOffset? occurredUtc = null, string? traceId = null, string? operationName = null, string? outcome = null, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

stage AuditResidueLifecycleStage

The lifecycle stage represented by this event.

correlationId string

The correlation identifier linking the event to the original decision context.

auditResidueId string

Optional audit residue identifier when the original decision residue is available.

eventId string

Optional lifecycle event identifier. When omitted, a new identifier is generated.

occurredUtc DateTimeOffset?

Optional lifecycle timestamp. When omitted, the current UTC timestamp is used.

traceId string

Optional trace identifier.

operationName string

Optional operation name.

outcome string

Optional lifecycle or host-defined outcome.

metadata IReadOnlyDictionary<string, string>

Optional host-provided lifecycle metadata.

Returns

AuditResidueLifecycleEvent

An audit residue lifecycle event.

FromResidue(AuditResidueLifecycleStage, IAsiBackboneAuditResidue, string?, string?, string?, DateTimeOffset?, string?, IReadOnlyDictionary<string, string>?)

Creates an audit residue lifecycle event by copying correlation context from existing audit residue.

public static AuditResidueLifecycleEvent FromResidue(AuditResidueLifecycleStage stage, IAsiBackboneAuditResidue residue, string? correlationId = null, string? auditResidueId = null, string? eventId = null, DateTimeOffset? occurredUtc = null, string? outcome = null, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

stage AuditResidueLifecycleStage

The lifecycle stage represented by this event.

residue IAsiBackboneAuditResidue

The original audit residue to correlate with the lifecycle event.

correlationId string

Optional correlation identifier override. When omitted, the residue correlation identifier is used.

auditResidueId string

Optional audit residue identifier override. When omitted, the residue event identifier is used.

eventId string

Optional lifecycle event identifier. When omitted, a new identifier is generated.

occurredUtc DateTimeOffset?

Optional lifecycle timestamp. When omitted, the current UTC timestamp is used.

outcome string

Optional lifecycle or host-defined outcome. When omitted, the residue outcome is used.

metadata IReadOnlyDictionary<string, string>

Optional host-provided lifecycle metadata merged after residue metadata.

Returns

AuditResidueLifecycleEvent

An audit residue lifecycle event.