summaryrefslogtreecommitdiff
path: root/DomainDig/DomainDigApp.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-17 11:18:25 -0500
committerChristian Cleberg <[email protected]>2026-07-20 13:56:41 -0500
commitfd8ca178a379da71f5bb19c461524888cad9447e (patch)
treeadb481e4c7c22e41e919b97ccded0e506083f9b3 /DomainDig/DomainDigApp.swift
parent2b52ee5520cad3c47d30d513946645366f268762 (diff)
downloaddomain-dig-fd8ca178a379da71f5bb19c461524888cad9447e.tar.gz
domain-dig-fd8ca178a379da71f5bb19c461524888cad9447e.tar.bz2
domain-dig-fd8ca178a379da71f5bb19c461524888cad9447e.zip
v4.8.0: Add scheduled report generation
- ScheduledReportService (@MainActor, headless/storage-backed like DomainMonitoringService): builds the latest report for every tracked domain from persisted history, exports it via DomainReportExporter in the configured format (markdown/PDF/JSON), writes it to a local Documents subdirectory, logs the run, and fires a "Scheduled Report Ready" local notification. - ScheduledReportScheduler mirrors DomainMonitoringScheduler's BGTaskScheduler approach with its own task identifier (net.cleberg.DomainDig.report.schedule, added to Info.plist) and a daily/weekly cadence. - ScheduledReportsView (Settings → Scheduled Reports): enable toggle, cadence and format pickers, "Generate Now", and a log of past reports each shareable via the existing ExportPresenter share sheet. - Gated behind the existing .automatedMonitoring capability (Pro), consistent with monitoring being the other background-automation feature. - Settings/logs persist via UserDefaults (DomainExportFormat is now Codable), not DomainDataPortabilityService backup/restore — this is local automation configuration, not user-authored content, same reasoning as v4.7.0's watchlist saved views.
Diffstat (limited to 'DomainDig/DomainDigApp.swift')
-rw-r--r--DomainDig/DomainDigApp.swift3
1 files changed, 3 insertions, 0 deletions
diff --git a/DomainDig/DomainDigApp.swift b/DomainDig/DomainDigApp.swift
index d34c51d..2f2070c 100644
--- a/DomainDig/DomainDigApp.swift
+++ b/DomainDig/DomainDigApp.swift
@@ -20,6 +20,7 @@ struct DomainDigApp: App {
init() {
LocalNotificationService.shared.configureForegroundPresentation()
DomainMonitoringScheduler.shared.registerBackgroundTask()
+ ScheduledReportScheduler.shared.registerBackgroundTask()
}
var body: some Scene {
@@ -38,6 +39,7 @@ struct DomainDigApp: App {
localAPIService.refresh()
cloudSyncService.scheduleSyncIfNeeded(trigger: .launch)
viewModel.monitoringStatusMessage = DomainMonitoringScheduler.shared.syncSchedule()
+ ScheduledReportScheduler.shared.syncSchedule()
IntegrationService.shared.processQueueNow()
viewModel.refreshWidgetData()
consumeShareInbox()
@@ -58,6 +60,7 @@ struct DomainDigApp: App {
localAPIService.refresh()
cloudSyncService.scheduleSyncIfNeeded(trigger: .launch)
viewModel.monitoringStatusMessage = DomainMonitoringScheduler.shared.syncSchedule()
+ ScheduledReportScheduler.shared.syncSchedule()
IntegrationService.shared.processQueueNow()
viewModel.refreshWidgetData()
consumeShareInbox()