Table of Contents

Class ErasureStatus

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

Detailed status information for an erasure request.

public sealed record ErasureStatus : IEquatable<ErasureStatus>
Inheritance
ErasureStatus
Implements
Inherited Members

Properties

CanCancel

Gets whether the request can be cancelled.

public bool CanCancel { get; }

Property Value

bool

CancellationReason

Gets the cancellation reason (if applicable).

public string? CancellationReason { get; init; }

Property Value

string

CancelledAt

Gets when the request was cancelled (if applicable).

public DateTimeOffset? CancelledAt { get; init; }

Property Value

DateTimeOffset?

CancelledBy

Gets who cancelled the request (if applicable).

public string? CancelledBy { get; init; }

Property Value

string

CertificateId

Gets the certificate ID if erasure is complete.

public Guid? CertificateId { get; init; }

Property Value

Guid?

CompletedAt

Gets when the erasure completed.

public DateTimeOffset? CompletedAt { get; init; }

Property Value

DateTimeOffset?

DataSubjectIdHash

Gets the SHA-256 hash of the data subject identifier.

public required string DataSubjectIdHash { get; init; }

Property Value

string

Remarks

The actual identifier is not stored for privacy - only the hash for verification.

DestroyedKeyHandles

Gets the key handles this request has destroyed, across every pass it has made.

public IReadOnlyCollection<string> DestroyedKeyHandles { get; init; }

Property Value

IReadOnlyCollection<string>

Remarks

A count cannot answer the question this does. KeysDeleted says how many keys the LAST pass destroyed; this says WHICH keys the request has destroyed in total. A retry needs the second, because a key an earlier pass destroyed now reports as absent — indistinguishable from one that never existed — and without this record the retry attests less coverage than the request has actually achieved, so an interrupted erasure could never be reported complete.

Empty when the request has destroyed nothing yet, never null. Order is not meaningful and duplicates do not appear.

ErrorMessage

Gets any error message if the request failed.

public string? ErrorMessage { get; init; }

Property Value

string

ExecutedAt

Gets when the erasure execution started.

public DateTimeOffset? ExecutedAt { get; init; }

Property Value

DateTimeOffset?

ExternalReference

Gets the external case/ticket reference.

public string? ExternalReference { get; init; }

Property Value

string

IdType

Gets the type of identifier used.

public required DataSubjectIdType IdType { get; init; }

Property Value

DataSubjectIdType

IsExecuted

Gets whether the erasure has been executed (completed, partially completed, or executed and awaiting the key-management provider's destruction of a scheduled key).

public bool IsExecuted { get; }

Property Value

bool

KeysDeleted

Gets the number of keys deleted.

public int? KeysDeleted { get; init; }

Property Value

int?

LegalBasis

Gets the legal basis for the erasure.

public required ErasureLegalBasis LegalBasis { get; init; }

Property Value

ErasureLegalBasis

RecordsAffected

Gets the number of records affected.

public int? RecordsAffected { get; init; }

Property Value

int?

RequestId

Gets the unique request identifier.

public required Guid RequestId { get; init; }

Property Value

Guid

RequestedAt

Gets when the request was submitted.

public required DateTimeOffset RequestedAt { get; init; }

Property Value

DateTimeOffset

RequestedBy

Gets who requested the erasure.

public required string RequestedBy { get; init; }

Property Value

string

ScheduledExecutionAt

Gets when the erasure is/was scheduled to execute.

public DateTimeOffset? ScheduledExecutionAt { get; init; }

Property Value

DateTimeOffset?

Scope

Gets the scope of the erasure request.

public required ErasureScope Scope { get; init; }

Property Value

ErasureScope

Status

Gets the current request status.

public required ErasureRequestStatus Status { get; init; }

Property Value

ErasureRequestStatus

TenantId

Gets the tenant identity this request was filed as — the OWNER of the data it erases.

public string? TenantId { get; init; }

Property Value

string

Remarks

This is the exact ambient term the write path encrypted under, and it is what key handles are derived from. It is NOT a partition and must not be compared against one: a single-tenant deployment operates as DefaultTenantId, which is a real tenant identity rather than a reserved marker. Use TenantPartition for anything that joins against a declaration.

TenantPartition

Gets the tenant partition this request belongs to — the thing a retention declaration names.

public required KeyedTenantPartition TenantPartition { get; init; }

Property Value

KeyedTenantPartition

Remarks

This is the second of two facts, and they are separate because they answer different questions. TenantId answers whose data is this, and therefore which key decrypts it; this answers which partition's legal obligations apply. They were one field, and the consequence was not a missed lookup: a single-tenant deployment filed a request as DefaultTenantId while declaring its retention against Untenanted, the join missed, and the key protecting the legally retained record was destroyed while the signed certificate reported the record as kept.

It is decided when the request is FILED, from whether multi-tenancy is configured — not from the shape of the tenant string. A host with multi-tenancy active yields a scoped partition whatever its tenants are named, including one named like the single-tenant default; a host without it yields Untenanted. It is persisted so a certificate stays reproducible if the deployment is reconfigured between filing and execution.

UpdatedAt

Gets when the status was last updated.

public required DateTimeOffset UpdatedAt { get; init; }

Property Value

DateTimeOffset

Methods

DaysUntilDeadline(DateTimeOffset)

Gets the days remaining until the GDPR deadline (30 days from request), as of asOf.

public int DaysUntilDeadline(DateTimeOffset asOf)

Parameters

asOf DateTimeOffset

The point in time to measure the remaining days from.

Returns

int

The whole number of days remaining, floored at zero once the deadline has passed.

Remarks

A method rather than a property: a DTO cannot carry an injected clock, so a property here could only read ambient wall-clock time, making this value untestable at a boundary and non-deterministic on every read. Callers pass the current time explicitly -- typically TimeProvider.GetUtcNow().