Interface IErasureRetentionWithdrawalAuthority
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Withdraws a retention declaration — the deliberate administrative statement that a deployment is no longer obliged to keep an aggregate type's data for a tenant.
public interface IErasureRetentionWithdrawalAuthority
Remarks
THIS IS A SEPARATE CONTRACT SO THAT A WITHDRAWAL IS NOT EXPRESSIBLE BY THE CODE THAT DEPLOYS. A withdrawal reverses a legal obligation, so it must never be something a deploy accomplishes as a side effect — and the way to guarantee that is not a rule asking implementers to be careful. Neither the startup advance nor the erasure path resolves this interface, so neither can call it: the violation is not prevented by a check, it cannot be written. An administrative host resolves it deliberately.
Rolling a deploy BACK does not withdraw anything, and that is the intended behaviour. After a rollback the durable record is ahead of every running instance, so every instance is known-stale and erasures are withheld — which is the mechanism working, not failing. The remedy is an explicit withdrawal, which is a recorded act with the same standing as the declaration it reverses. An operator override would be a hole wide enough to make the guard theatre; a withdrawal is the narrow, auditable door that does the same job honestly.
It tombstones; it never deletes. Deleting the row would make "withdrawn" indistinguishable from "never declared", which are different facts to an auditor — and it would free the key for the advance path to re-insert, silently restoring the obligation on the next deploy of any instance whose code still declares it.
Methods
WithdrawDeclaredRetentionAsync(DeclaredRetentionKey, string, string, CancellationToken)
Tombstones declaration, recording who withdrew it, when, and why.
Task<RetentionWithdrawalOutcome> WithdrawDeclaredRetentionAsync(DeclaredRetentionKey declaration, string actor, string reason, CancellationToken cancellationToken)
Parameters
declarationDeclaredRetentionKeyThe declaration to withdraw.
actorstringThe administrator or system accountable for the withdrawal. Recorded verbatim, because the auditor's question is who decided, not which process executed it.
reasonstringWhy the obligation no longer applies. Required, and not a formality: a tombstone with no reason records that an obligation ended and nothing about the ground for ending it, which is the half an auditor needs.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<RetentionWithdrawalOutcome>
What the withdrawal did — see RetentionWithdrawalOutcome.
Remarks
The four recorded facts are the pair, the instant, the actor and the reason, and all four are the auditor's question rather than ours. AlreadyWithdrawn leaves the original four untouched: a second withdrawal does not re-date the first, because the instant that matters is when the obligation ended.
Exceptions
- ArgumentException
Any of the declaration's terms,
actororreasonis null, empty or whitespace.- ErasureStoreNotProvisionedException
The backing table is absent.