using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; namespace QRRapidoApp.Models { public class QRCodeHistory { [BsonId] [BsonRepresentation(BsonType.ObjectId)] public string Id { get; set; } = string.Empty; [BsonElement("userId")] public string? UserId { get; set; } // null for anonymous users [BsonElement("type")] public string Type { get; set; } = string.Empty; // URL, Text, WiFi, vCard, SMS, Email [BsonElement("content")] public string Content { get; set; } = string.Empty; [BsonElement("qrCodeBase64")] public string QRCodeBase64 { get; set; } = string.Empty; [BsonElement("customizationSettings")] public string CustomizationSettings { get; set; } = string.Empty; // JSON [BsonElement("createdAt")] public DateTime CreatedAt { get; set; } = DateTime.UtcNow; [BsonElement("language")] public string Language { get; set; } = "pt-BR"; [BsonElement("scanCount")] public int ScanCount { get; set; } = 0; [BsonElement("isDynamic")] public bool IsDynamic { get; set; } = false; [BsonElement("size")] public int Size { get; set; } = 300; [BsonElement("generationTimeMs")] public long GenerationTimeMs { get; set; } = 0; [BsonElement("fromCache")] public bool FromCache { get; set; } = false; [BsonElement("isActive")] public bool IsActive { get; set; } = true; [BsonElement("lastAccessedAt")] public DateTime LastAccessedAt { get; set; } = DateTime.UtcNow; } }