Files
step3/api/QuestionsApi/Models/AnswerStatistics.cs
T

62 lines
1.8 KiB
C#

using MongoDB.Bson.Serialization.Attributes;
namespace QuestionsApi.Models;
public sealed class QuestionAttemptCounter
{
public string QuestionExternalId { get; set; } = "";
public int Bucket { get; set; }
public string ChoiceId { get; set; } = "";
public long SelectionCount { get; set; }
public long PresentationCount { get; set; }
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
}
public sealed class QuestionAttemptCounterTotal
{
[BsonId]
public QuestionChoiceCounterKey Key { get; set; } = new();
public long SelectionCount { get; set; }
public long PresentationCount { get; set; }
}
public sealed class QuestionAttemptCounterAggregate
{
[BsonId]
public QuestionChoiceBucketKey Key { get; set; } = new();
public long SelectionCount { get; set; }
public long PresentationCount { get; set; }
}
public sealed class QuestionChoiceBucketKey
{
public string QuestionExternalId { get; set; } = "";
public int Bucket { get; set; }
public string ChoiceId { get; set; } = "";
}
public sealed class QuestionChoiceCounterKey
{
public string QuestionExternalId { get; set; } = "";
public string ChoiceId { get; set; } = "";
}
public sealed class AnswerStatisticsState
{
[BsonId]
public string Id { get; set; } = "answer-statistics-v2";
public bool Completed { get; set; }
public string LeaseOwner { get; set; } = "";
public DateTime LeaseUntilUtc { get; set; }
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
public DateTime CutoverUtc { get; set; }
}
public sealed class QuestionPresentationBaseline
{
[BsonId]
public string QuestionExternalId { get; set; } = "";
public List<string> ChoiceIds { get; set; } = [];
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
}