| | | 1 | | using AsiBackbone.Core.Actors; |
| | | 2 | | using AsiBackbone.Core.Entities; |
| | | 3 | | using AsiBackbone.Core.Serialization; |
| | | 4 | | |
| | | 5 | | namespace AsiBackbone.EntityFrameworkCore.Persistence; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Represents the Entity Framework Core persistence shape for an AsiBackbone audit ledger record. |
| | | 9 | | /// </summary> |
| | | 10 | | public sealed class AsiBackboneAuditLedgerRecordEntity : AsiBackboneEntity |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Gets or sets the stable audit ledger record identifier. |
| | | 14 | | /// </summary> |
| | 96 | 15 | | public string RecordId { get; set; } = string.Empty; |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// Gets or sets the serialized schema version for this audit ledger record. |
| | | 19 | | /// </summary> |
| | 104 | 20 | | public string SchemaVersion { get; set; } = AsiBackboneSchemaVersions.StableArtifactsV1; |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Gets or sets the stable audit event identifier. |
| | | 24 | | /// </summary> |
| | 98 | 25 | | public string EventId { get; set; } = string.Empty; |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Gets or sets the stable audit residue identifier. |
| | | 29 | | /// </summary> |
| | 34 | 30 | | public string? AuditResidueId { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Gets or sets the UTC timestamp when the audited event occurred. |
| | | 34 | | /// </summary> |
| | 46 | 35 | | public DateTimeOffset OccurredUtc { get; set; } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Gets or sets the UTC timestamp when the ledger record was created by the host or storage adapter. |
| | | 39 | | /// </summary> |
| | 46 | 40 | | public DateTimeOffset RecordedUtc { get; set; } |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Gets or sets the stable actor identifier associated with the event. |
| | | 44 | | /// </summary> |
| | 98 | 45 | | public string ActorId { get; set; } = string.Empty; |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets or sets the actor type associated with the event. |
| | | 49 | | /// </summary> |
| | 50 | 50 | | public AsiBackboneActorType ActorType { get; set; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets or sets the optional display name or label associated with the actor. |
| | | 54 | | /// </summary> |
| | 40 | 55 | | public string? ActorDisplayName { get; set; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets or sets the operation name associated with the audited event. |
| | | 59 | | /// </summary> |
| | 98 | 60 | | public string OperationName { get; set; } = string.Empty; |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// Gets or sets the governance, constraint, or host-defined outcome associated with the event. |
| | | 64 | | /// </summary> |
| | 98 | 65 | | public string Outcome { get; set; } = string.Empty; |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets or sets the serialized machine-readable reason codes associated with the event. |
| | | 69 | | /// </summary> |
| | 96 | 70 | | public string ReasonCodesJson { get; set; } = "[]"; |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Gets or sets the correlation identifier associated with the event, when supplied by the host. |
| | | 74 | | /// </summary> |
| | 46 | 75 | | public string? CorrelationId { get; set; } |
| | | 76 | | |
| | | 77 | | /// <summary> |
| | | 78 | | /// Gets or sets the trace identifier associated with the event, when supplied by the host. |
| | | 79 | | /// </summary> |
| | 46 | 80 | | public string? TraceId { get; set; } |
| | | 81 | | |
| | | 82 | | /// <summary> |
| | | 83 | | /// Gets or sets the span identifier associated with the event, when supplied by the host or observability adapter. |
| | | 84 | | /// </summary> |
| | 34 | 85 | | public string? SpanId { get; set; } |
| | | 86 | | |
| | | 87 | | /// <summary> |
| | | 88 | | /// Gets or sets the parent span identifier associated with the event, when supplied by the host or observability ad |
| | | 89 | | /// </summary> |
| | 34 | 90 | | public string? ParentSpanId { get; set; } |
| | | 91 | | |
| | | 92 | | /// <summary> |
| | | 93 | | /// Gets or sets the decision latency in milliseconds, when supplied by the host. |
| | | 94 | | /// </summary> |
| | 34 | 95 | | public long? DecisionLatencyMs { get; set; } |
| | | 96 | | |
| | | 97 | | /// <summary> |
| | | 98 | | /// Gets or sets the hash of the evaluated constraint set, when supplied by the host. |
| | | 99 | | /// </summary> |
| | 34 | 100 | | public string? ConstraintSetHash { get; set; } |
| | | 101 | | |
| | | 102 | | /// <summary> |
| | | 103 | | /// Gets or sets the number of evaluated constraints, when supplied by the host. |
| | | 104 | | /// </summary> |
| | 34 | 105 | | public int? ConstraintCount { get; set; } |
| | | 106 | | |
| | | 107 | | /// <summary> |
| | | 108 | | /// Gets or sets the host-defined risk score associated with the decision, when supplied by the host. |
| | | 109 | | /// </summary> |
| | 34 | 110 | | public double? RiskScore { get; set; } |
| | | 111 | | |
| | | 112 | | /// <summary> |
| | | 113 | | /// Gets or sets the policy scope associated with the decision, when supplied by the host. |
| | | 114 | | /// </summary> |
| | 34 | 115 | | public string? PolicyScope { get; set; } |
| | | 116 | | |
| | | 117 | | /// <summary> |
| | | 118 | | /// Gets or sets the privacy-preserving tenant hash associated with the decision, when supplied by the host. |
| | | 119 | | /// </summary> |
| | 34 | 120 | | public string? TenantHash { get; set; } |
| | | 121 | | |
| | | 122 | | /// <summary> |
| | | 123 | | /// Gets or sets the privacy-preserving organization hash associated with the decision, when supplied by the host. |
| | | 124 | | /// </summary> |
| | 34 | 125 | | public string? OrganizationHash { get; set; } |
| | | 126 | | |
| | | 127 | | /// <summary> |
| | | 128 | | /// Gets or sets the provider-neutral emitter status, when supplied by the host or outbox provider. |
| | | 129 | | /// </summary> |
| | 34 | 130 | | public string? EmitterStatus { get; set; } |
| | | 131 | | |
| | | 132 | | /// <summary> |
| | | 133 | | /// Gets or sets the provider-neutral emitter provider name, when supplied by the host or outbox provider. |
| | | 134 | | /// </summary> |
| | 34 | 135 | | public string? EmitterProvider { get; set; } |
| | | 136 | | |
| | | 137 | | /// <summary> |
| | | 138 | | /// Gets or sets the outbox sequence associated with the event, when supplied by the host or outbox provider. |
| | | 139 | | /// </summary> |
| | 34 | 140 | | public long? OutboxSequence { get; set; } |
| | | 141 | | |
| | | 142 | | /// <summary> |
| | | 143 | | /// Gets or sets the gateway execution identifier associated with the event, when supplied by the host or gateway pr |
| | | 144 | | /// </summary> |
| | 34 | 145 | | public string? GatewayExecutionId { get; set; } |
| | | 146 | | |
| | | 147 | | /// <summary> |
| | | 148 | | /// Gets or sets the provider-neutral decision stage associated with the event, when supplied by the host. |
| | | 149 | | /// </summary> |
| | 34 | 150 | | public string? DecisionStage { get; set; } |
| | | 151 | | |
| | | 152 | | /// <summary> |
| | | 153 | | /// Gets or sets the policy version associated with the event, when supplied by the host. |
| | | 154 | | /// </summary> |
| | 46 | 155 | | public string? PolicyVersion { get; set; } |
| | | 156 | | |
| | | 157 | | /// <summary> |
| | | 158 | | /// Gets or sets the policy hash associated with the event, when supplied by the host. |
| | | 159 | | /// </summary> |
| | 46 | 160 | | public string? PolicyHash { get; set; } |
| | | 161 | | |
| | | 162 | | /// <summary> |
| | | 163 | | /// Gets or sets the related responsibility or liability handshake identifier, when available. |
| | | 164 | | /// </summary> |
| | 40 | 165 | | public string? HandshakeId { get; set; } |
| | | 166 | | |
| | | 167 | | /// <summary> |
| | | 168 | | /// Gets or sets the related acknowledgment identifier, when available. |
| | | 169 | | /// </summary> |
| | 40 | 170 | | public string? AcknowledgmentId { get; set; } |
| | | 171 | | |
| | | 172 | | /// <summary> |
| | | 173 | | /// Gets or sets the related capability token identifier, when available. |
| | | 174 | | /// </summary> |
| | 40 | 175 | | public string? CapabilityTokenId { get; set; } |
| | | 176 | | |
| | | 177 | | /// <summary> |
| | | 178 | | /// Gets or sets the previous ledger record hash, when supplied by a host or signing package. |
| | | 179 | | /// </summary> |
| | 38 | 180 | | public string? PreviousRecordHash { get; set; } |
| | | 181 | | |
| | | 182 | | /// <summary> |
| | | 183 | | /// Gets or sets this ledger record hash, when supplied by a host or signing package. |
| | | 184 | | /// </summary> |
| | 38 | 185 | | public string? RecordHash { get; set; } |
| | | 186 | | |
| | | 187 | | /// <summary> |
| | | 188 | | /// Gets or sets the signature key identifier, when supplied by a signing package or host. |
| | | 189 | | /// </summary> |
| | 38 | 190 | | public string? SignatureKeyId { get; set; } |
| | | 191 | | |
| | | 192 | | /// <summary> |
| | | 193 | | /// Gets or sets the signature algorithm, when supplied by a signing package or host. |
| | | 194 | | /// </summary> |
| | 38 | 195 | | public string? SignatureAlgorithm { get; set; } |
| | | 196 | | |
| | | 197 | | /// <summary> |
| | | 198 | | /// Gets or sets the signature value, when supplied by a signing package or host. |
| | | 199 | | /// </summary> |
| | 38 | 200 | | public string? SignatureValue { get; set; } |
| | | 201 | | |
| | | 202 | | /// <summary> |
| | | 203 | | /// Gets or sets serialized framework-neutral audit metadata supplied by the host. |
| | | 204 | | /// </summary> |
| | 96 | 205 | | public string MetadataJson { get; set; } = "{}"; |
| | | 206 | | } |