| | | 1 | | using ArturRios.Heimdall.Command.Auditing; |
| | | 2 | | using ArturRios.Heimdall.Command.Input; |
| | | 3 | | using ArturRios.Mediator.Command; |
| | | 4 | | |
| | | 5 | | namespace ArturRios.Heimdall.Command.Output; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Result of <see cref="Input.RequestErasureCommand" /> (UC-42): what the subject is owed and |
| | | 9 | | /// by when. |
| | | 10 | | /// </summary> |
| | | 11 | | public class RequestErasureCommandOutput : CommandOutput, IAuditedSideEffects |
| | | 12 | | { |
| | | 13 | | /// <summary>Public identifier of the identity the erasure was requested for.</summary> |
| | 42 | 14 | | public Guid Id { get; set; } |
| | | 15 | | |
| | | 16 | | /// <summary>When the request was recorded.</summary> |
| | 33 | 17 | | public DateTime RequestedAt { get; set; } |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// The deadline the erasure must not outlive. Returned to the subject because GDPR Art. |
| | | 21 | | /// 12(3) is an obligation owed to them, and one they cannot hold anyone to without knowing |
| | | 22 | | /// it. |
| | | 23 | | /// </summary> |
| | 33 | 24 | | public DateTime DueAt { get; set; } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Whether something prevents the erasure from proceeding yet. The request is recorded and |
| | | 28 | | /// the deadline runs either way. |
| | | 29 | | /// </summary> |
| | 40 | 30 | | public bool Blocked { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary>Why it is blocked, when it is; <c>null</c> otherwise.</summary> |
| | 33 | 33 | | public string? BlockedReason { get; set; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Whether the request lifted a restriction on processing the subject had in place (UC-44). |
| | | 37 | | /// An erasure request is the subject's own instruction to stop holding the record, so it |
| | | 38 | | /// ends the restriction that would otherwise keep the record from being erased (NFR-24) — |
| | | 39 | | /// without the Art. 18(3) notice, since the subject is the one lifting it (UC-45). |
| | | 40 | | /// </summary> |
| | 52 | 41 | | public bool RestrictionLifted { get; set; } |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// A lifted restriction is recorded in the audit trail as a lift of its own, so a reader |
| | | 45 | | /// looking for when the restriction ended finds it under the same name whichever way it was |
| | | 46 | | /// lifted. |
| | | 47 | | /// </summary> |
| | | 48 | | public IEnumerable<string> AuditedSideEffects() => |
| | 11 | 49 | | RestrictionLifted ? [nameof(LiftProcessingRestrictionCommand)] : []; |
| | | 50 | | } |