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

102 lines
3.4 KiB
C#

using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace QuestionsApi.Models;
public static class QuestionReportCategory
{
public const string Clarity = "clarity";
public const string MedicalAccuracy = "medical_accuracy";
public const string AnswerExplanation = "answer_explanation";
public const string FormattingMedia = "formatting_media";
public const string TechnicalIssue = "technical_issue";
public const string Other = "other";
public static readonly HashSet<string> All =
[
Clarity,
MedicalAccuracy,
AnswerExplanation,
FormattingMedia,
TechnicalIssue,
Other
];
}
public static class QuestionReportStatus
{
public const string Open = "open";
public const string Resolved = "resolved";
public const string Dismissed = "dismissed";
public static readonly HashSet<string> Terminal = [Resolved, Dismissed];
}
public class QuestionReport
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string? Id { get; set; }
public string QuestionExternalId { get; set; } = "";
public string QuestionMongoId { get; set; } = "";
public string UserId { get; set; } = "";
public string Category { get; set; } = "";
public string Details { get; set; } = "";
public string Status { get; set; } = QuestionReportStatus.Open;
public QuestionReportSnapshot QuestionSnapshot { get; set; } = new();
public string SourceType { get; set; } = "authored";
public DynamicGenerationDescriptor? DynamicGeneration { get; set; }
public string ReviewedByUserId { get; set; } = "";
public string ReviewerNote { get; set; } = "";
public DateTime? ReviewedUtc { get; set; }
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
}
public class QuestionReportSnapshot
{
public string Stem { get; set; } = "";
public string LeadIn { get; set; } = "";
public List<QuestionChoice> Choices { get; set; } = [];
public string CorrectChoiceId { get; set; } = "";
public string Explanation { get; set; } = "";
public string KeyTakeaway { get; set; } = "";
public string UsmlePearl { get; set; } = "";
public List<QuestionReviewFollowup> ReviewFollowups { get; set; } = [];
public Dictionary<string, string> ChoiceExplanations { get; set; } = [];
public Dictionary<string, WrongAnswerFollowup> WrongAnswerFollowups { get; set; } = [];
public List<QuestionLab> Labs { get; set; } = [];
public List<string> Media { get; set; } = [];
}
public class CreateQuestionReportRequest
{
public string QuestionExternalId { get; set; } = "";
public string Category { get; set; } = "";
public string Details { get; set; } = "";
}
public class CreateQuestionReportResponse
{
public string Id { get; set; } = "";
public string QuestionExternalId { get; set; } = "";
public string Category { get; set; } = "";
public string Status { get; set; } = QuestionReportStatus.Open;
public DateTime CreatedUtc { get; set; }
}
public class UpdateQuestionReportStatusRequest
{
public string Status { get; set; } = "";
public string ReviewerNote { get; set; } = "";
}
public class QuestionReportListResponse
{
public List<QuestionReport> Items { get; set; } = [];
public long Total { get; set; }
public int Skip { get; set; }
public int Limit { get; set; }
}