Repository: Automattic/pocket-casts-ios
File: podcasts/Notifications/NotificationsCoordinator.swift (Swift)

Code before:
            return "pktc://settings/import"
        case .onboardingThemes:
            return "pktc://settings/themes"
        case .onboardingUpNext:
            return "pktc://upnext/?location=tab"
        case .onboardingFilters:
            return "pktc://filters"
        case .onboardingUpsell:
            return "pktc://upsell"
        case .onboardingStaffPicks:
            return "pktc://discover/staff-picks"
        case .reengagementWeekly:
            return "pktc://discover"
        }
    }
}

class NotificationsCoordinator {

    static let shared: NotificationsCoordinator = NotificationsCoordinator()

    var onboardingTimeIntervalStep: TimeInterval = 24.hours
    var reEngagementTimeIntervalStep: TimeInterval = 1.week
    var ignoreScheduleHours: Bool = false

    enum Constants {
        static let onboardingScheduleHour: Int = 10
        static let reengagementScheduleHour: Int = 16
    }

    private let notificationCenter: UNUserNotificationCenter

    private init(notificationCenter: UNUserNotificationCenter = .current()) {
        self.notificationCenter = notificationCenter
    }

    let onboardingNotifications: [NotificationType] = [.onboardingSignUp, .onboardingImport, .onboardingUpNext, .onboardingFilters, .onboardingThemes, .onboardingStaffPicks, .onboardingUpsell]

    func setupDailyRemindersNotifications() {
        Settings.notificationsDailyReminders = true
        NotificationsHelper.shared.registerForPushNotifications { [weak self] granted in
            guard let self, granted else { return }
            let timeIntervalToSchedule: TimeInterval = calculateTimeIntervalToHour(Constants.onboardingScheduleHour)
            var timeInterval: TimeInterval = timeIntervalToSchedule + onboardingTimeIntervalStep
            onboardingNotifications.forEach { notification in
                self.scheduleNotification(notification, timeInterval: timeInterval)
                timeInterval += self.onboardingTimeIntervalStep
            }
        }
    }


Review comment (suggestion):
⛏️  Can the Constants be private?

```suggestion
    private enum Constants {
```

Code after:
            return "pktc://settings/import"
        case .onboardingThemes:
            return "pktc://settings/themes"
        case .onboardingUpNext:
            return "pktc://upnext/?location=tab"
        case .onboardingFilters:
            return "pktc://filters"
        case .onboardingUpsell:
            return "pktc://upsell"
        case .onboardingStaffPicks:
            return "pktc://discover/staff-picks"
        case .reengagementWeekly:
            return "pktc://discover"
        }
    }
}

class NotificationsCoordinator {

    static let shared: NotificationsCoordinator = NotificationsCoordinator()

    var onboardingTimeIntervalStep: TimeInterval = 24.hours
    var reEngagementTimeIntervalStep: TimeInterval = 1.week
    var ignoreScheduleHours: Bool = false

    private enum Constants {
        static let onboardingScheduleHour: Int = 10
        static let reengagementScheduleHour: Int = 16
    }

    private let notificationCenter: UNUserNotificationCenter

    private init(notificationCenter: UNUserNotificationCenter = .current()) {
        self.notificationCenter = notificationCenter
    }

    let onboardingNotifications: [NotificationType] = [.onboardingSignUp, .onboardingImport, .onboardingUpNext, .onboardingFilters, .onboardingThemes, .onboardingStaffPicks, .onboardingUpsell]

    func setupDailyRemindersNotifications() {
        Settings.notificationsDailyReminders = true
        NotificationsHelper.shared.registerForPushNotifications { [weak self] granted in
            guard let self, granted else { return }
            let timeIntervalToSchedule: TimeInterval = calculateTimeIntervalToHour(Constants.onboardingScheduleHour)
            var timeInterval: TimeInterval = timeIntervalToSchedule + onboardingTimeIntervalStep
            onboardingNotifications.forEach { notification in
                self.scheduleNotification(notification, timeInterval: timeInterval)
                timeInterval += self.onboardingTimeIntervalStep
            }
        }
    }