Remove Add Transaction feature and clean all related code

Deleted files:
- AddTransactionView.swift
- TransactionRepository.swift
- Transaction+CoreDataClass.swift

Cleaned files:
- SourceDetailViewModel: removed transactions published property,
  showingAddTransaction flag, transactionRepository dependency,
  addTransaction() and deleteTransaction() methods
- SourceDetailView: removed transactionsSection, TransactionRow struct,
  Add Transaction button from quickActions, sheet presentation
- InvestmentSource+CoreDataClass: removed transactions NSManaged property,
  transactionsArray, totalInvested, totalDividends, totalFees computed
  properties, and all transaction Core Data accessors
- SettingsViewModel: removed "Transaction" from resetAllData entity list
- SampleDataService: removed transactionRepository and sample transaction

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
alexandrev-tibco
2026-02-20 23:04:03 +01:00
parent b17d8866a4
commit 7cb5f92cf4
20 changed files with 215 additions and 503 deletions
@@ -416,9 +416,10 @@ struct MonthlyCheckInCard: View {
@State private var showingStartOptions = false
@State private var startDestinationActive = false
@State private var shouldDuplicatePrevious = false
@State private var cachedCompletionDate: Date?
private var effectiveLastCheckInDate: Date? {
MonthlyCheckInStore.latestCompletionDate() ?? lastUpdatedDate
cachedCompletionDate ?? lastUpdatedDate
}
private var checkInProgress: Double {
@@ -432,7 +433,8 @@ struct MonthlyCheckInCard: View {
private var nextCheckInDate: Date? {
guard let last = effectiveLastCheckInDate else { return nil }
return last.adding(months: 1)
let effective = MonthlyCheckInStore.effectiveMonth(for: last, relativeTo: last)
return effective.adding(months: 1).endOfMonth
}
private var isOverdue: Bool {
@@ -473,10 +475,10 @@ struct MonthlyCheckInCard: View {
var body: some View {
VStack(alignment: .leading, spacing: 12) {
Text(currentMonthLabel)
Text("Monthly Check-in")
.font(.headline)
Text("Keep a calm, deliberate rhythm. Update your sources and add a short note.")
Text(currentMonthLabel)
.font(.subheadline)
.foregroundColor(.secondary)
@@ -583,6 +585,14 @@ struct MonthlyCheckInCard: View {
.padding(.horizontal, 24)
.presentationDetents([.height(280)])
}
.onAppear {
cachedCompletionDate = MonthlyCheckInStore.latestCompletionDate()
}
.onChange(of: startDestinationActive) { _, isActive in
if !isActive {
cachedCompletionDate = MonthlyCheckInStore.latestCompletionDate()
}
}
}
private var defaultReminderTime: Date {