using LiteDB; using System.Numerics; using static DeluxeBackend.Enums; namespace DeluxeBackend.Models { public class SavedImage { public long Id { get; set; } [BsonRef("accounts")] public required Account Player { get; set; } public List PlayerIds { get; set; } = new List(); public string ImageName { get; set; } = string.Empty; public long? RoomId { get; set; } = null; public SavedImageType SavedImageType { get; set; } = SavedImageType.None; public SavedImageAccessibility Accessibility { get; set; } = SavedImageAccessibility.Private; public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public Dictionary ToDictionary() { Dictionary keyValuePairs = new Dictionary { ["SavedImageId"] = Id, ["SavedImageType"] = (int)SavedImageType, ["Accessibility"] = (int)Accessibility, ["AccessibilityLocked"] = false, ["ImageName"] = ImageName, ["Description"] = "", ["PlayerId"] = Player.Id, ["TaggedPlayerIds"] = PlayerIds, ["CreatedAt"] = CreatedAt.ToString("O"), ["CheerCount"] = 0, ["CommentCount"] = 0 }; if (RoomId.HasValue) { keyValuePairs["RoomId"] = RoomId.Value; } return keyValuePairs; } } }