Add synced question bookmarks

This commit is contained in:
hz
2026-07-18 23:07:22 -05:00
parent 819a108451
commit 2e52a7ea0a
20 changed files with 1387 additions and 18 deletions
@@ -0,0 +1,41 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace QuestionsApi.Models;
public sealed class QuestionBookmark
{
[BsonId, BsonRepresentation(BsonType.ObjectId)] public string? Id { get; set; }
public string UserId { get; set; } = "";
public string QuestionExternalId { get; set; } = "";
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
}
public sealed class QuestionBookmarkSummary
{
public string QuestionExternalId { get; set; } = "";
public string Stem { get; set; } = "";
public string LeadIn { get; set; } = "";
public string System { get; set; } = "";
public string Discipline { get; set; } = "";
public int Difficulty { get; set; }
public bool HasMedia { get; set; }
public List<string> Tags { get; set; } = [];
public DateTime CreatedUtc { get; set; }
}
public sealed class QuestionBookmarkPageResponse
{
public List<QuestionBookmarkSummary> Items { get; set; } = [];
public string? NextCursor { get; set; }
public bool HasMore { get; set; }
public List<string> Systems { get; set; } = [];
public List<string> Disciplines { get; set; } = [];
}
public sealed class QuestionBookmarkMutationResponse
{
public string QuestionExternalId { get; set; } = "";
public bool IsBookmarked { get; set; }
}
@@ -25,6 +25,7 @@ public class QuestionResponse
public List<string> Media { get; set; } = [];
public List<string> Tags { get; set; } = [];
public List<QuestionReference> References { get; set; } = [];
public bool IsBookmarked { get; set; }
public static QuestionResponse FromModel(
Question question,