using ManagerService.DTOs; using System.ComponentModel.DataAnnotations; namespace ManagerService.Data { public class SubscriptionPlan { [Key] [Required] public string Id { get; set; } [Required] public string Name { get; set; } public long StorageQuotaBytes { get; set; } = 0; public int AiRequestsPerMonth { get; set; } = 0; /// Whether the plan includes any stats at all. public bool HasStats { get; set; } = false; /// Max history in days for stats. 0 = unlimited (Premium). public int StatsHistoryDays { get; set; } = 30; /// Whether the plan includes advanced stats (POI, quiz, game, articles, QR, etc.). public bool HasAdvancedStats { get; set; } = false; public SubscriptionPlanDTO ToDTO() { return new SubscriptionPlanDTO { id = Id, name = Name, storageQuotaBytes = StorageQuotaBytes, aiRequestsPerMonth = AiRequestsPerMonth, hasStats = HasStats, statsHistoryDays = StatsHistoryDays, hasAdvancedStats = HasAdvancedStats, }; } public SubscriptionPlan FromDTO(SubscriptionPlanDTO dto) { Name = dto.name; StorageQuotaBytes = dto.storageQuotaBytes; AiRequestsPerMonth = dto.aiRequestsPerMonth; HasStats = dto.hasStats; StatsHistoryDays = dto.statsHistoryDays; HasAdvancedStats = dto.hasAdvancedStats; return this; } } }