84b74f9ea4
A) Implicit: HomeViewModel tracks auto-assigned slot IDs after each autocomplete run. When the user manually replaces one of those dishes, the rejected dish ID is recorded in FeedbackStore (UserDefaults). AutocompleteEngine applies a 25% penalty per rejection (floor 0.30). B) Explicit: WeekPlan gains userRating (0/1/-1). Past weeks with dishes show a compact 👍/👎 row (Premium only). Liked weeks boost their dishes (+0.20 each, max +0.50); disliked weeks penalise them (-0.25 each, max -0.50). Signal is intentionally modest so the period cycle score remains dominant. Also adds Stats + week-rating localization strings to all 6 languages (were missing from the previous commit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
688 B
Swift
30 lines
688 B
Swift
import Foundation
|
|
import SwiftData
|
|
|
|
@Model
|
|
final class WeekPlan {
|
|
@Attribute(.unique) var id: UUID
|
|
var weekStartDate: Date
|
|
var createdAt: Date
|
|
var updatedAt: Date
|
|
var userRating: Int = 0 // 0 = unrated, 1 = liked, -1 = disliked
|
|
|
|
@Relationship(deleteRule: .cascade)
|
|
var slots: [MealSlot]
|
|
|
|
init(
|
|
id: UUID = UUID(),
|
|
weekStartDate: Date,
|
|
slots: [MealSlot] = [],
|
|
createdAt: Date = Date(),
|
|
updatedAt: Date = Date()
|
|
) {
|
|
self.id = id
|
|
self.weekStartDate = weekStartDate
|
|
self.slots = slots
|
|
self.createdAt = createdAt
|
|
self.updatedAt = updatedAt
|
|
self.userRating = 0
|
|
}
|
|
}
|