Version casi lista
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import Foundation
|
||||
import SwiftData
|
||||
|
||||
@Model
|
||||
final class WeekPlan {
|
||||
@Attribute(.unique) var id: UUID
|
||||
var weekStartDate: Date
|
||||
var createdAt: Date
|
||||
var updatedAt: Date
|
||||
|
||||
@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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user