Add debug bypass subscription toggle, tests, and data layer improvements
- Add runtime toggle in Settings (DEBUG only) to bypass subscription/hide trial banner - IAPManager.bypassSubscription is now a @Published var persisted via UserDefaults - Hide upgrade banner in SettingsTabView and trial warnings when bypass is enabled - Add FeelsTests directory with integration tests - Update DataController, DataControllerGET, DataControllerUPDATE - Update Xcode project and scheme configuration - Update localization strings and App Store screen docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,8 +41,8 @@ final class DataController: ObservableObject {
|
||||
return try? modelContext.fetch(descriptor).first
|
||||
}
|
||||
|
||||
private init() {
|
||||
container = SharedModelContainer.createWithFallback(useCloudKit: true)
|
||||
init(container: ModelContainer? = nil) {
|
||||
self.container = container ?? SharedModelContainer.createWithFallback(useCloudKit: true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ extension DataController {
|
||||
|
||||
var descriptor = FetchDescriptor<MoodEntryModel>(
|
||||
predicate: #Predicate { entry in
|
||||
entry.forDate >= startDate && entry.forDate <= endDate
|
||||
entry.forDate >= startDate && entry.forDate < endDate
|
||||
},
|
||||
sortBy: [SortDescriptor(\.forDate, order: .forward)]
|
||||
)
|
||||
@@ -66,7 +66,8 @@ extension DataController {
|
||||
return (0, nil)
|
||||
}
|
||||
|
||||
let entries = getData(startDate: yearAgo, endDate: votingDate, includedDays: [])
|
||||
let endOfVotingDay = calendar.date(byAdding: .day, value: 1, to: dayStart) ?? votingDate
|
||||
let entries = getData(startDate: yearAgo, endDate: endOfVotingDay, includedDays: [])
|
||||
.filter { $0.mood != .missing && $0.mood != .placeholder }
|
||||
|
||||
guard !entries.isEmpty else { return (0, nil) }
|
||||
|
||||
@@ -16,6 +16,7 @@ extension DataController {
|
||||
}
|
||||
|
||||
entry.moodValue = mood.rawValue
|
||||
entry.timestamp = Date()
|
||||
saveAndRunDataListeners()
|
||||
|
||||
AnalyticsManager.shared.track(.moodUpdated(mood: mood.rawValue))
|
||||
|
||||
Reference in New Issue
Block a user