| | | 1 | | using System.Collections.ObjectModel; |
| | | 2 | | using System.Text.Json; |
| | | 3 | | using AsiBackbone.Core.Actors; |
| | | 4 | | using AsiBackbone.Core.Audit; |
| | | 5 | | using AsiBackbone.Core.Results; |
| | | 6 | | using AsiBackbone.EntityFrameworkCore.Persistence; |
| | | 7 | | using Microsoft.EntityFrameworkCore; |
| | | 8 | | |
| | | 9 | | namespace AsiBackbone.EntityFrameworkCore.Audit; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Entity Framework Core-backed audit ledger store that persists records through a host-owned <see cref="DbContext" />. |
| | | 13 | | /// </summary> |
| | | 14 | | /// <remarks> |
| | | 15 | | /// This store is append-oriented and intentionally relies on the host application to expose the ASI Backbone entities f |
| | | 16 | | /// its own <see cref="DbContext" /> and migrations. It does not create a package-owned context or select a database pro |
| | | 17 | | /// </remarks> |
| | | 18 | | public sealed class EfCoreAuditLedgerStore : IAsiBackboneAuditLedgerStore |
| | | 19 | | { |
| | 2 | 20 | | private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web); |
| | | 21 | | |
| | | 22 | | private readonly DbContext dbContext; |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Initializes a new instance of the <see cref="EfCoreAuditLedgerStore" /> class. |
| | | 26 | | /// </summary> |
| | | 27 | | /// <param name="dbContext">The host-owned database context.</param> |
| | 14 | 28 | | public EfCoreAuditLedgerStore(DbContext dbContext) |
| | | 29 | | { |
| | 14 | 30 | | ArgumentNullException.ThrowIfNull(dbContext); |
| | | 31 | | |
| | 14 | 32 | | this.dbContext = dbContext; |
| | 14 | 33 | | } |
| | | 34 | | |
| | | 35 | | /// <inheritdoc /> |
| | | 36 | | public async ValueTask<OperationResult<AuditLedgerRecord>> AppendAsync( |
| | | 37 | | AuditLedgerRecord record, |
| | | 38 | | CancellationToken cancellationToken = default) |
| | | 39 | | { |
| | 14 | 40 | | ArgumentNullException.ThrowIfNull(record); |
| | 14 | 41 | | cancellationToken.ThrowIfCancellationRequested(); |
| | | 42 | | |
| | 14 | 43 | | AsiBackboneAuditLedgerRecordEntity entity = ToEntity(record); |
| | | 44 | | |
| | 14 | 45 | | _ = await dbContext |
| | 14 | 46 | | .Set<AsiBackboneAuditLedgerRecordEntity>() |
| | 14 | 47 | | .AddAsync(entity, cancellationToken) |
| | 14 | 48 | | .ConfigureAwait(false); |
| | | 49 | | |
| | 48 | 50 | | foreach (AsiBackboneAuditLedgerReasonCodeEntity reasonCode in ToReasonCodeEntities(entity.Id, record.ReasonCodes |
| | | 51 | | { |
| | 10 | 52 | | _ = await dbContext |
| | 10 | 53 | | .Set<AsiBackboneAuditLedgerReasonCodeEntity>() |
| | 10 | 54 | | .AddAsync(reasonCode, cancellationToken) |
| | 10 | 55 | | .ConfigureAwait(false); |
| | | 56 | | } |
| | | 57 | | |
| | 44 | 58 | | foreach (AsiBackboneAuditLedgerMetadataEntity metadata in ToMetadataEntities(entity.Id, record.Metadata)) |
| | | 59 | | { |
| | 8 | 60 | | _ = await dbContext |
| | 8 | 61 | | .Set<AsiBackboneAuditLedgerMetadataEntity>() |
| | 8 | 62 | | .AddAsync(metadata, cancellationToken) |
| | 8 | 63 | | .ConfigureAwait(false); |
| | | 64 | | } |
| | | 65 | | |
| | | 66 | | try |
| | | 67 | | { |
| | 14 | 68 | | _ = await dbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false); |
| | 12 | 69 | | } |
| | 2 | 70 | | catch (DbUpdateException ex) |
| | | 71 | | { |
| | 2 | 72 | | dbContext.ChangeTracker.Clear(); |
| | | 73 | | |
| | 2 | 74 | | return OperationResult.Failure<AuditLedgerRecord>( |
| | 2 | 75 | | "asi_backbone.audit_ledger.append_failed", |
| | 2 | 76 | | ex.Message); |
| | | 77 | | } |
| | | 78 | | |
| | 12 | 79 | | return OperationResult.Success(record); |
| | 14 | 80 | | } |
| | | 81 | | |
| | | 82 | | /// <inheritdoc /> |
| | | 83 | | public async ValueTask<AuditLedgerRecord?> FindByRecordIdAsync( |
| | | 84 | | string recordId, |
| | | 85 | | CancellationToken cancellationToken = default) |
| | | 86 | | { |
| | 8 | 87 | | ArgumentException.ThrowIfNullOrWhiteSpace(recordId); |
| | | 88 | | |
| | 8 | 89 | | string normalizedRecordId = recordId.Trim(); |
| | | 90 | | |
| | 8 | 91 | | AsiBackboneAuditLedgerRecordEntity? entity = await LedgerRecords() |
| | 8 | 92 | | .Where(record => record.RecordId == normalizedRecordId) |
| | 8 | 93 | | .SingleOrDefaultAsync(cancellationToken) |
| | 8 | 94 | | .ConfigureAwait(false); |
| | | 95 | | |
| | 8 | 96 | | return entity is null ? null : ToRecord(entity); |
| | 8 | 97 | | } |
| | | 98 | | |
| | | 99 | | /// <inheritdoc /> |
| | | 100 | | public async ValueTask<IReadOnlyList<AuditLedgerRecord>> FindByCorrelationIdAsync( |
| | | 101 | | string correlationId, |
| | | 102 | | CancellationToken cancellationToken = default) |
| | | 103 | | { |
| | 2 | 104 | | ArgumentException.ThrowIfNullOrWhiteSpace(correlationId); |
| | | 105 | | |
| | 2 | 106 | | string normalizedCorrelationId = correlationId.Trim(); |
| | | 107 | | |
| | 2 | 108 | | List<AsiBackboneAuditLedgerRecordEntity> entities = await LedgerRecords() |
| | 2 | 109 | | .Where(record => record.CorrelationId == normalizedCorrelationId) |
| | 2 | 110 | | .OrderBy(record => record.RecordedUtc) |
| | 2 | 111 | | .ThenBy(record => record.RecordId) |
| | 2 | 112 | | .ToListAsync(cancellationToken) |
| | 2 | 113 | | .ConfigureAwait(false); |
| | | 114 | | |
| | 2 | 115 | | return ToRecords(entities); |
| | 2 | 116 | | } |
| | | 117 | | |
| | | 118 | | /// <inheritdoc /> |
| | | 119 | | public async ValueTask<IReadOnlyList<AuditLedgerRecord>> FindByTraceIdAsync( |
| | | 120 | | string traceId, |
| | | 121 | | CancellationToken cancellationToken = default) |
| | | 122 | | { |
| | 2 | 123 | | ArgumentException.ThrowIfNullOrWhiteSpace(traceId); |
| | | 124 | | |
| | 2 | 125 | | string normalizedTraceId = traceId.Trim(); |
| | | 126 | | |
| | 2 | 127 | | List<AsiBackboneAuditLedgerRecordEntity> entities = await LedgerRecords() |
| | 2 | 128 | | .Where(record => record.TraceId == normalizedTraceId) |
| | 2 | 129 | | .OrderBy(record => record.RecordedUtc) |
| | 2 | 130 | | .ThenBy(record => record.RecordId) |
| | 2 | 131 | | .ToListAsync(cancellationToken) |
| | 2 | 132 | | .ConfigureAwait(false); |
| | | 133 | | |
| | 2 | 134 | | return ToRecords(entities); |
| | 2 | 135 | | } |
| | | 136 | | |
| | | 137 | | /// <inheritdoc /> |
| | | 138 | | public async ValueTask<IReadOnlyList<AuditLedgerRecord>> FindByActorIdAsync( |
| | | 139 | | string actorId, |
| | | 140 | | CancellationToken cancellationToken = default) |
| | | 141 | | { |
| | 2 | 142 | | ArgumentException.ThrowIfNullOrWhiteSpace(actorId); |
| | | 143 | | |
| | 2 | 144 | | string normalizedActorId = actorId.Trim(); |
| | | 145 | | |
| | 2 | 146 | | List<AsiBackboneAuditLedgerRecordEntity> entities = await LedgerRecords() |
| | 2 | 147 | | .Where(record => record.ActorId == normalizedActorId) |
| | 2 | 148 | | .OrderBy(record => record.RecordedUtc) |
| | 2 | 149 | | .ThenBy(record => record.RecordId) |
| | 2 | 150 | | .ToListAsync(cancellationToken) |
| | 2 | 151 | | .ConfigureAwait(false); |
| | | 152 | | |
| | 2 | 153 | | return ToRecords(entities); |
| | 2 | 154 | | } |
| | | 155 | | |
| | | 156 | | /// <inheritdoc /> |
| | | 157 | | public async ValueTask<IReadOnlyList<AuditLedgerRecord>> FindByRecordedUtcRangeAsync( |
| | | 158 | | DateTimeOffset recordedFromUtc, |
| | | 159 | | DateTimeOffset recordedToUtc, |
| | | 160 | | CancellationToken cancellationToken = default) |
| | | 161 | | { |
| | 4 | 162 | | DateTimeOffset normalizedFromUtc = recordedFromUtc.ToUniversalTime(); |
| | 4 | 163 | | DateTimeOffset normalizedToUtc = recordedToUtc.ToUniversalTime(); |
| | | 164 | | |
| | 4 | 165 | | if (normalizedFromUtc > normalizedToUtc) |
| | | 166 | | { |
| | 2 | 167 | | throw new ArgumentException( |
| | 2 | 168 | | "The recorded UTC range start must be less than or equal to the range end.", |
| | 2 | 169 | | nameof(recordedFromUtc)); |
| | | 170 | | } |
| | | 171 | | |
| | 2 | 172 | | List<AsiBackboneAuditLedgerRecordEntity> entities = await LedgerRecords() |
| | 2 | 173 | | .Where(record => record.RecordedUtc >= normalizedFromUtc && record.RecordedUtc <= normalizedToUtc) |
| | 2 | 174 | | .OrderBy(record => record.RecordedUtc) |
| | 2 | 175 | | .ThenBy(record => record.RecordId) |
| | 2 | 176 | | .ToListAsync(cancellationToken) |
| | 2 | 177 | | .ConfigureAwait(false); |
| | | 178 | | |
| | 2 | 179 | | return ToRecords(entities); |
| | 2 | 180 | | } |
| | | 181 | | |
| | | 182 | | private IQueryable<AsiBackboneAuditLedgerRecordEntity> LedgerRecords() |
| | | 183 | | { |
| | 16 | 184 | | return dbContext.Set<AsiBackboneAuditLedgerRecordEntity>().AsNoTracking(); |
| | | 185 | | } |
| | | 186 | | |
| | | 187 | | private static AsiBackboneAuditLedgerRecordEntity ToEntity(AuditLedgerRecord record) |
| | | 188 | | { |
| | 14 | 189 | | return new AsiBackboneAuditLedgerRecordEntity |
| | 14 | 190 | | { |
| | 14 | 191 | | RecordId = record.RecordId, |
| | 14 | 192 | | SchemaVersion = record.SchemaVersion, |
| | 14 | 193 | | EventId = record.EventId, |
| | 14 | 194 | | AuditResidueId = record.AuditResidueId, |
| | 14 | 195 | | OccurredUtc = record.OccurredUtc, |
| | 14 | 196 | | RecordedUtc = record.RecordedUtc, |
| | 14 | 197 | | ActorId = record.ActorId, |
| | 14 | 198 | | ActorType = record.ActorType, |
| | 14 | 199 | | ActorDisplayName = record.ActorDisplayName, |
| | 14 | 200 | | OperationName = record.OperationName, |
| | 14 | 201 | | Outcome = record.Outcome, |
| | 14 | 202 | | ReasonCodesJson = JsonSerializer.Serialize(record.ReasonCodes, JsonOptions), |
| | 14 | 203 | | CorrelationId = record.CorrelationId, |
| | 14 | 204 | | TraceId = record.TraceId, |
| | 14 | 205 | | SpanId = record.SpanId, |
| | 14 | 206 | | ParentSpanId = record.ParentSpanId, |
| | 14 | 207 | | DecisionLatencyMs = record.DecisionLatencyMs, |
| | 14 | 208 | | ConstraintSetHash = record.ConstraintSetHash, |
| | 14 | 209 | | ConstraintCount = record.ConstraintCount, |
| | 14 | 210 | | RiskScore = record.RiskScore, |
| | 14 | 211 | | PolicyScope = record.PolicyScope, |
| | 14 | 212 | | TenantHash = record.TenantHash, |
| | 14 | 213 | | OrganizationHash = record.OrganizationHash, |
| | 14 | 214 | | EmitterStatus = record.EmitterStatus, |
| | 14 | 215 | | EmitterProvider = record.EmitterProvider, |
| | 14 | 216 | | OutboxSequence = record.OutboxSequence, |
| | 14 | 217 | | GatewayExecutionId = record.GatewayExecutionId, |
| | 14 | 218 | | DecisionStage = record.DecisionStage, |
| | 14 | 219 | | PolicyVersion = record.PolicyVersion, |
| | 14 | 220 | | PolicyHash = record.PolicyHash, |
| | 14 | 221 | | HandshakeId = record.HandshakeId, |
| | 14 | 222 | | AcknowledgmentId = record.AcknowledgmentId, |
| | 14 | 223 | | CapabilityTokenId = record.CapabilityTokenId, |
| | 14 | 224 | | PreviousRecordHash = record.PreviousRecordHash, |
| | 14 | 225 | | RecordHash = record.RecordHash, |
| | 14 | 226 | | SignatureKeyId = record.SignatureKeyId, |
| | 14 | 227 | | SignatureAlgorithm = record.SignatureAlgorithm, |
| | 14 | 228 | | SignatureValue = record.SignatureValue, |
| | 14 | 229 | | MetadataJson = JsonSerializer.Serialize(record.Metadata, JsonOptions) |
| | 14 | 230 | | }; |
| | | 231 | | } |
| | | 232 | | |
| | | 233 | | private static AsiBackboneAuditLedgerReasonCodeEntity[] ToReasonCodeEntities( |
| | | 234 | | Guid auditLedgerRecordId, |
| | | 235 | | IReadOnlyList<string> reasonCodes) |
| | | 236 | | { |
| | 14 | 237 | | return [.. reasonCodes |
| | 24 | 238 | | .Select((reasonCode, index) => new AsiBackboneAuditLedgerReasonCodeEntity |
| | 24 | 239 | | { |
| | 24 | 240 | | AuditLedgerRecordId = auditLedgerRecordId, |
| | 24 | 241 | | Sequence = index, |
| | 24 | 242 | | ReasonCode = reasonCode |
| | 24 | 243 | | })]; |
| | | 244 | | } |
| | | 245 | | |
| | | 246 | | private static AsiBackboneAuditLedgerMetadataEntity[] ToMetadataEntities( |
| | | 247 | | Guid auditLedgerRecordId, |
| | | 248 | | IReadOnlyDictionary<string, string> metadata) |
| | | 249 | | { |
| | 14 | 250 | | return [.. metadata |
| | 22 | 251 | | .Select(item => new AsiBackboneAuditLedgerMetadataEntity |
| | 22 | 252 | | { |
| | 22 | 253 | | AuditLedgerRecordId = auditLedgerRecordId, |
| | 22 | 254 | | MetadataKey = item.Key, |
| | 22 | 255 | | MetadataValue = item.Value |
| | 22 | 256 | | })]; |
| | | 257 | | } |
| | | 258 | | |
| | | 259 | | private static AuditLedgerRecord[] ToRecords(IEnumerable<AsiBackboneAuditLedgerRecordEntity> entities) |
| | | 260 | | { |
| | 8 | 261 | | return [.. entities.Select(ToRecord)]; |
| | | 262 | | } |
| | | 263 | | |
| | | 264 | | private static AuditLedgerRecord ToRecord(AsiBackboneAuditLedgerRecordEntity entity) |
| | | 265 | | { |
| | 20 | 266 | | string[] reasonCodes = DeserializeReasonCodes(entity.ReasonCodesJson); |
| | 20 | 267 | | ReadOnlyDictionary<string, string> metadata = DeserializeMetadata(entity.MetadataJson); |
| | | 268 | | |
| | 20 | 269 | | var residue = new EntityAuditResidue( |
| | 20 | 270 | | entity.EventId, |
| | 20 | 271 | | entity.AuditResidueId, |
| | 20 | 272 | | entity.SchemaVersion, |
| | 20 | 273 | | entity.OccurredUtc, |
| | 20 | 274 | | entity.ActorId, |
| | 20 | 275 | | entity.ActorType, |
| | 20 | 276 | | entity.ActorDisplayName, |
| | 20 | 277 | | entity.OperationName, |
| | 20 | 278 | | entity.Outcome, |
| | 20 | 279 | | Array.AsReadOnly(reasonCodes), |
| | 20 | 280 | | entity.CorrelationId, |
| | 20 | 281 | | entity.TraceId, |
| | 20 | 282 | | entity.SpanId, |
| | 20 | 283 | | entity.ParentSpanId, |
| | 20 | 284 | | entity.DecisionLatencyMs, |
| | 20 | 285 | | entity.ConstraintSetHash, |
| | 20 | 286 | | entity.ConstraintCount, |
| | 20 | 287 | | entity.RiskScore, |
| | 20 | 288 | | entity.PolicyScope, |
| | 20 | 289 | | entity.TenantHash, |
| | 20 | 290 | | entity.OrganizationHash, |
| | 20 | 291 | | entity.EmitterStatus, |
| | 20 | 292 | | entity.EmitterProvider, |
| | 20 | 293 | | entity.OutboxSequence, |
| | 20 | 294 | | entity.GatewayExecutionId, |
| | 20 | 295 | | entity.DecisionStage, |
| | 20 | 296 | | entity.PolicyVersion, |
| | 20 | 297 | | entity.PolicyHash, |
| | 20 | 298 | | metadata); |
| | | 299 | | |
| | 20 | 300 | | return AuditLedgerRecord.FromResidue( |
| | 20 | 301 | | residue, |
| | 20 | 302 | | entity.RecordId, |
| | 20 | 303 | | entity.RecordedUtc, |
| | 20 | 304 | | entity.HandshakeId, |
| | 20 | 305 | | entity.AcknowledgmentId, |
| | 20 | 306 | | entity.CapabilityTokenId, |
| | 20 | 307 | | entity.PreviousRecordHash, |
| | 20 | 308 | | entity.RecordHash, |
| | 20 | 309 | | entity.SignatureKeyId, |
| | 20 | 310 | | entity.SignatureAlgorithm, |
| | 20 | 311 | | entity.SignatureValue, |
| | 20 | 312 | | schemaVersion: entity.SchemaVersion); |
| | | 313 | | } |
| | | 314 | | |
| | | 315 | | private static string[] DeserializeReasonCodes(string? json) |
| | | 316 | | { |
| | 20 | 317 | | return string.IsNullOrWhiteSpace(json) |
| | 20 | 318 | | ? [] |
| | 20 | 319 | | : JsonSerializer.Deserialize<string[]>(json, JsonOptions) ?? []; |
| | | 320 | | } |
| | | 321 | | |
| | | 322 | | private static ReadOnlyDictionary<string, string> DeserializeMetadata(string? json) |
| | | 323 | | { |
| | 20 | 324 | | if (string.IsNullOrWhiteSpace(json)) |
| | | 325 | | { |
| | 2 | 326 | | return new ReadOnlyDictionary<string, string>(new Dictionary<string, string>(StringComparer.Ordinal)); |
| | | 327 | | } |
| | | 328 | | |
| | 18 | 329 | | Dictionary<string, string>? metadata = JsonSerializer.Deserialize<Dictionary<string, string>>(json, JsonOptions) |
| | | 330 | | |
| | 18 | 331 | | return metadata is null || metadata.Count == 0 |
| | 18 | 332 | | ? new ReadOnlyDictionary<string, string>(new Dictionary<string, string>(StringComparer.Ordinal)) |
| | 18 | 333 | | : new ReadOnlyDictionary<string, string>(new Dictionary<string, string>(metadata, StringComparer.Ordinal)); |
| | | 334 | | } |
| | | 335 | | |
| | 20 | 336 | | private sealed class EntityAuditResidue( |
| | 20 | 337 | | string eventId, |
| | 20 | 338 | | string? auditResidueId, |
| | 20 | 339 | | string schemaVersion, |
| | 20 | 340 | | DateTimeOffset occurredUtc, |
| | 20 | 341 | | string actorId, |
| | 20 | 342 | | AsiBackboneActorType actorType, |
| | 20 | 343 | | string? actorDisplayName, |
| | 20 | 344 | | string operationName, |
| | 20 | 345 | | string outcome, |
| | 20 | 346 | | IReadOnlyList<string> reasonCodes, |
| | 20 | 347 | | string? correlationId, |
| | 20 | 348 | | string? traceId, |
| | 20 | 349 | | string? spanId, |
| | 20 | 350 | | string? parentSpanId, |
| | 20 | 351 | | long? decisionLatencyMs, |
| | 20 | 352 | | string? constraintSetHash, |
| | 20 | 353 | | int? constraintCount, |
| | 20 | 354 | | double? riskScore, |
| | 20 | 355 | | string? policyScope, |
| | 20 | 356 | | string? tenantHash, |
| | 20 | 357 | | string? organizationHash, |
| | 20 | 358 | | string? emitterStatus, |
| | 20 | 359 | | string? emitterProvider, |
| | 20 | 360 | | long? outboxSequence, |
| | 20 | 361 | | string? gatewayExecutionId, |
| | 20 | 362 | | string? decisionStage, |
| | 20 | 363 | | string? policyVersion, |
| | 20 | 364 | | string? policyHash, |
| | 20 | 365 | | IReadOnlyDictionary<string, string> metadata) : IAsiBackboneAuditResidue |
| | | 366 | | { |
| | 40 | 367 | | public string EventId { get; } = eventId; |
| | | 368 | | |
| | 40 | 369 | | public string? AuditResidueId { get; } = auditResidueId; |
| | | 370 | | |
| | 20 | 371 | | public string SchemaVersion { get; } = schemaVersion; |
| | | 372 | | |
| | 40 | 373 | | public DateTimeOffset OccurredUtc { get; } = occurredUtc; |
| | | 374 | | |
| | 40 | 375 | | public string ActorId { get; } = actorId; |
| | | 376 | | |
| | 40 | 377 | | public AsiBackboneActorType ActorType { get; } = actorType; |
| | | 378 | | |
| | 40 | 379 | | public string? ActorDisplayName { get; } = actorDisplayName; |
| | | 380 | | |
| | 40 | 381 | | public string OperationName { get; } = operationName; |
| | | 382 | | |
| | 40 | 383 | | public string Outcome { get; } = outcome; |
| | | 384 | | |
| | 40 | 385 | | public IReadOnlyList<string> ReasonCodes { get; } = reasonCodes; |
| | | 386 | | |
| | 40 | 387 | | public string? CorrelationId { get; } = correlationId; |
| | | 388 | | |
| | 40 | 389 | | public string? TraceId { get; } = traceId; |
| | | 390 | | |
| | 40 | 391 | | public string? SpanId { get; } = spanId; |
| | | 392 | | |
| | 40 | 393 | | public string? ParentSpanId { get; } = parentSpanId; |
| | | 394 | | |
| | 40 | 395 | | public long? DecisionLatencyMs { get; } = decisionLatencyMs; |
| | | 396 | | |
| | 40 | 397 | | public string? ConstraintSetHash { get; } = constraintSetHash; |
| | | 398 | | |
| | 40 | 399 | | public int? ConstraintCount { get; } = constraintCount; |
| | | 400 | | |
| | 40 | 401 | | public double? RiskScore { get; } = riskScore; |
| | | 402 | | |
| | 40 | 403 | | public string? PolicyScope { get; } = policyScope; |
| | | 404 | | |
| | 40 | 405 | | public string? TenantHash { get; } = tenantHash; |
| | | 406 | | |
| | 40 | 407 | | public string? OrganizationHash { get; } = organizationHash; |
| | | 408 | | |
| | 40 | 409 | | public string? EmitterStatus { get; } = emitterStatus; |
| | | 410 | | |
| | 40 | 411 | | public string? EmitterProvider { get; } = emitterProvider; |
| | | 412 | | |
| | 40 | 413 | | public long? OutboxSequence { get; } = outboxSequence; |
| | | 414 | | |
| | 40 | 415 | | public string? GatewayExecutionId { get; } = gatewayExecutionId; |
| | | 416 | | |
| | 40 | 417 | | public string? DecisionStage { get; } = decisionStage; |
| | | 418 | | |
| | 40 | 419 | | public string? PolicyVersion { get; } = policyVersion; |
| | | 420 | | |
| | 40 | 421 | | public string? PolicyHash { get; } = policyHash; |
| | | 422 | | |
| | 40 | 423 | | public IReadOnlyDictionary<string, string> Metadata { get; } = metadata; |
| | | 424 | | } |
| | | 425 | | } |