Bifrost/src/Bifrost.Web/Domain/ConceptVoteModels.cs
Heimdall 84ff2c4578 Account merge ledger: AccountMerge receipt, reductions, alias standing, undo and final sweep
AccountMergeLedger owns what a merge does to Bifrost records: PlanAsync (dry run, block codes),
CommitAsync (one save, total, idempotent), UndoLocalAsync (journal replay), FinalizeDueAsync
(AccountMergeSweeper) and StandingAsync/ResolveAsync. Votes and concept appraisals are voided by a
stamp that a model query filter hides from every tally. The actor accessor no longer ORs several
credentials under SingleOrDefault (a latent crash); a frozen or folded account resolves to no
account on every route, the OIDC authorize and chat refusal deny it, and patron intake follows the
alias. Migration AddAccountMerges is additive. No UI, no Heimdall call, nothing deployed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 02:31:51 +00:00

55 lines
1.2 KiB
C#

namespace Bifrost.Web.Domain;
public enum ConceptStance
{
Up,
Down
}
public enum VoterClass
{
Anonymous,
Account,
Member
}
public sealed class ConceptSubject
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Collection { get; set; } = string.Empty;
public string Key { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public DateTimeOffset RegisteredAtUtc { get; set; }
public DateTimeOffset? RetiredAtUtc { get; set; }
}
public sealed class ConceptAppraisal
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid SubjectId { get; set; }
public string VoterKey { get; set; } = string.Empty;
public ConceptStance Stance { get; set; }
public VoterClass VoterClass { get; set; }
public Guid? UserAccountId { get; set; }
public string NetworkTag { get; set; } = string.Empty;
public DateTimeOffset CastAtUtc { get; set; }
/// <summary>Set by the account merge ledger when a merge removes this appraisal from every tally; the model's query filter then hides the row.</summary>
public Guid? VoidedByMergeId { get; set; }
public DateTimeOffset? VoidedUtc { get; set; }
public ConceptSubject? Subject { get; set; }
}