summaryrefslogtreecommitdiff
path: root/DomainDig/PremiumAccessService.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-20 16:24:20 -0500
committerChristian Cleberg <[email protected]>2026-04-20 16:24:20 -0500
commit9999f876feb9a2d419a79ad601f78053c44d44f8 (patch)
treeb920aacd1192646dcca71ddae17879355ed4f040 /DomainDig/PremiumAccessService.swift
parent397c7c420c22fc1c235893bd85b2029da9145730 (diff)
downloaddomain-dig-9999f876feb9a2d419a79ad601f78053c44d44f8.tar.gz
domain-dig-9999f876feb9a2d419a79ad601f78053c44d44f8.tar.bz2
domain-dig-9999f876feb9a2d419a79ad601f78053c44d44f8.zip
feat(v2.0.0): introduce tracked domains, diffing, and monitoring foundationsv2.0.0
- replace basic watchlist with structured TrackedDomain model - add manual refresh flow for tracked domains - implement snapshot diffing (DNS, IP, TLS, HTTP, redirect, email, availability) - add change summaries (changed/unchanged + affected sections) - link tracked domains to history snapshots - enhance HistoryEntry with normalized summary fields - persist availability + suggestions in history and export - add WatchlistView with pinning, notes, and status display - introduce premium capability scaffolding (no StoreKit) - enforce free-tier tracked domain limit (local only) - refactor view model to support tracking, diffing, and refresh flows notes: - no background monitoring, notifications, or paid APIs yet - all features remain local-first and manual
Diffstat (limited to 'DomainDig/PremiumAccessService.swift')
-rw-r--r--DomainDig/PremiumAccessService.swift27
1 files changed, 27 insertions, 0 deletions
diff --git a/DomainDig/PremiumAccessService.swift b/DomainDig/PremiumAccessService.swift
new file mode 100644
index 0000000..698a2d2
--- /dev/null
+++ b/DomainDig/PremiumAccessService.swift
@@ -0,0 +1,27 @@
+import Foundation
+
+enum PremiumAccessService {
+ static let freeTrackedDomainLimit = 3
+
+ static func hasAccess(to capability: PremiumCapability) -> Bool {
+ switch capability {
+ case .unlimitedTrackedDomains,
+ .automatedMonitoring,
+ .pushAlerts,
+ .batchTracking,
+ .advancedExports:
+ return false
+ }
+ }
+
+ static func trackedDomainLimitMessage(currentCount: Int) -> String? {
+ guard currentCount >= freeTrackedDomainLimit, !hasAccess(to: .unlimitedTrackedDomains) else {
+ return nil
+ }
+ return "More tracked domains will be available in a future Pro upgrade."
+ }
+
+ static func canAddTrackedDomain(currentCount: Int) -> Bool {
+ hasAccess(to: .unlimitedTrackedDomains) || currentCount < freeTrackedDomainLimit
+ }
+}