Add POI category filters, delete item button, and fix itinerary persistence

- Expand POI categories from 5 to 7 (restaurant, bar, coffee, hotel, parking, attraction, entertainment)
- Add category filter chips with per-category API calls and caching
- Add delete button with confirmation dialog to Edit Item sheet
- Fix itinerary items not persisting: use LocalItineraryItem (SwiftData) as primary store with CloudKit sync as secondary, register model in schema

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-19 16:04:53 -06:00
parent 999b5a1190
commit c976ae5cb3
6 changed files with 337 additions and 87 deletions

View File

@@ -44,48 +44,46 @@ actor POISearchService {
enum POICategory: String, CaseIterable {
case restaurant
case bar
case coffee
case hotel
case parking
case attraction
case entertainment
case nightlife
case museum
var displayName: String {
switch self {
case .restaurant: return "Restaurant"
case .bar: return "Bar"
case .coffee: return "Coffee"
case .hotel: return "Hotel"
case .parking: return "Parking"
case .attraction: return "Attraction"
case .entertainment: return "Entertainment"
case .nightlife: return "Nightlife"
case .museum: return "Museum"
}
}
var iconName: String {
switch self {
case .restaurant: return "fork.knife"
case .bar: return "wineglass.fill"
case .coffee: return "cup.and.saucer.fill"
case .hotel: return "bed.double.fill"
case .parking: return "car.fill"
case .attraction: return "star.fill"
case .entertainment: return "theatermasks.fill"
case .nightlife: return "moon.stars.fill"
case .museum: return "building.columns.fill"
}
}
var mkPointOfInterestCategory: MKPointOfInterestCategory {
switch self {
case .restaurant: return .restaurant
case .attraction: return .nationalPark
case .entertainment: return .theater
case .nightlife: return .nightlife
case .museum: return .museum
}
}
var searchQuery: String {
switch self {
case .restaurant: return "restaurants"
case .bar: return "bars"
case .coffee: return "coffee shops"
case .hotel: return "hotels"
case .parking: return "parking"
case .attraction: return "tourist attractions"
case .entertainment: return "entertainment"
case .nightlife: return "bars nightlife"
case .museum: return "museums"
}
}
}