fix: Resolve all audit issues from project readiness review

Blockers:
- IYmtgTests: replace ScannerViewModel() (no-arg init removed) with CollectionViewModel() in testViewModelFiltering and testPortfolioCalculation
- IYmtgTests: fix property access — scannedList, librarySearchText, filteredList, portfolioValue all live on CollectionViewModel, not ScannerViewModel; inject test data after async init settles

Major:
- ContentView: update .onChange(of:) to two-parameter closure syntax (iOS 17 deprecation)
- ModelManager: add missing import FirebaseCore so FirebaseApp.app() resolves explicitly
- CollectionViewModel.deleteCard: call CloudEngine.delete(card:) to remove Firebase entry when a card is deleted (prevents data accumulation)
- CloudEngine: remove never-called batchUpdatePrices() — full backup already handled by backupAllToFirebase()

Minor:
- CardDetailView: move to Features/CardDetail/CardDetailView.swift; remove from ContentView.swift
- Delete PersistenceActor.swift placeholder (superseded by PersistenceController.swift)
- AppConfig.validate(): broaden placeholder-email guard to catch empty strings and common fake domains
- ModelManager: document OTA restart requirement in code comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 20:22:45 -05:00
parent e18a1080de
commit 13753359b3
8 changed files with 125 additions and 145 deletions

View File

@@ -20,8 +20,9 @@ enum CurrencyCode: String, CaseIterable, Codable {
}
struct AppConfig {
// 1. CONTACT EMAIL (Required by Scryfall)
static let contactEmail = "support@iymtg.com" // Example: Use your real email
// 1. CONTACT EMAIL (Required by Scryfall API policy)
// Replace with your real developer email before submitting to the App Store.
static let contactEmail = "support@iymtg.com" // TODO: Replace with your real email
// 2. IN-APP PURCHASE ID (Use a "Consumable" type in App Store Connect for repeatable tips)
static let tipJarProductIDs: [String] = [] // Example: Use your real Product ID
@@ -62,7 +63,8 @@ struct AppConfig {
static func validate() {
#if DEBUG
if contactEmail.contains("yourdomain.com") {
let knownPlaceholderDomains = ["yourdomain.com", "example.com", "yourapp.com"]
if knownPlaceholderDomains.contains(where: { contactEmail.contains($0) }) || contactEmail.isEmpty {
fatalError("🛑 SETUP ERROR: Change 'contactEmail' in AppConfig.swift to your real email.")
}
if tipJarProductIDs.isEmpty {