| | | 1 | | using ArturRios.Mediator.Command; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Heimdall.Command.Output; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Result of <see cref="Input.PurgeExpiredTokensCommand" />: how many rows the run removed from |
| | | 7 | | /// each table. Zero everywhere is an ordinary successful run, not a failure — most runs find |
| | | 8 | | /// nothing to do. |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// Deliberately carries no <c>Id</c>: a purge has no single target entity, so the auditing |
| | | 12 | | /// decorator records the entry with a null <c>TargetId</c>, which is the honest answer. The |
| | | 13 | | /// counts are what make the entry useful. |
| | | 14 | | /// </remarks> |
| | | 15 | | public class PurgeExpiredTokensCommandOutput : CommandOutput |
| | | 16 | | { |
| | | 17 | | /// <summary>Password reset tokens removed (UC-12/UC-13).</summary> |
| | 64 | 18 | | public int PasswordResetTokensPurged { get; set; } |
| | | 19 | | |
| | | 20 | | /// <summary>Email verification tokens removed (UC-14/UC-15).</summary> |
| | 55 | 21 | | public int EmailVerificationTokensPurged { get; set; } |
| | | 22 | | |
| | | 23 | | /// <summary>Two-factor email codes removed (UC-36/UC-38).</summary> |
| | 54 | 24 | | public int TwoFactorEmailCodesPurged { get; set; } |
| | | 25 | | |
| | | 26 | | /// <summary>Unconfirmed pending registrations removed (UC-47).</summary> |
| | 54 | 27 | | public int PendingRegistrationsPurged { get; set; } |
| | | 28 | | |
| | | 29 | | /// <summary>Revoked or expired application credentials removed (UC-55).</summary> |
| | 55 | 30 | | public int ApplicationCredentialsPurged { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary>Registration-attempt notice budgets whose window had ended removed (FR-SR-14).</summary> |
| | 54 | 33 | | public int AttemptNoticeBudgetsPurged { get; set; } |
| | | 34 | | |
| | | 35 | | /// <summary>Records of used Google ID tokens removed (FR-GO-21).</summary> |
| | 54 | 36 | | public int GoogleIdTokenUsesPurged { get; set; } |
| | | 37 | | |
| | | 38 | | /// <summary>Scope owner invitations that ended or expired more than 90 days ago, removed (FR-SC-18).</summary> |
| | 55 | 39 | | public int ScopeOwnerInvitationsPurged { get; set; } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Rows across all eight tables still due once the run ended (#206): left because a table reached |
| | | 43 | | /// <c>MaxBatchesPerTick</c> full batches. Zero when every table drained. |
| | | 44 | | /// </summary> |
| | | 45 | | /// <remarks> |
| | | 46 | | /// Counted only for a table whose last batch came back full, since a batch that was not full took |
| | | 47 | | /// everything that was due: a run that keeps up costs no count at all, and a backlog that is not |
| | | 48 | | /// draining shows here run after run. |
| | | 49 | | /// </remarks> |
| | 39 | 50 | | public int Backlog { get; set; } |
| | | 51 | | |
| | | 52 | | /// <summary>Rows removed across all eight tables.</summary> |
| | | 53 | | public int TotalPurged => |
| | 21 | 54 | | PasswordResetTokensPurged + EmailVerificationTokensPurged + TwoFactorEmailCodesPurged + |
| | 21 | 55 | | PendingRegistrationsPurged + ApplicationCredentialsPurged + AttemptNoticeBudgetsPurged + |
| | 21 | 56 | | GoogleIdTokenUsesPurged + ScopeOwnerInvitationsPurged; |
| | | 57 | | } |