import Foundation
import SwiftData

@Model
final class YearlyCount {
    @Attribute(.unique) var id: UUID
    @Attribute var year: Int
    @Attribute var count: Int
    @Attribute var typeIdentifier: String
    @Attribute var isApproximate: Bool
    var typeCount: TypeCount?

    init(year: Int, count: Int, typeIdentifier: String, isApproximate: Bool = false) {
        self.id = UUID()
        self.year = year
        self.count = count
        self.typeIdentifier = typeIdentifier
        self.isApproximate = isApproximate
        self.typeCount = nil
    }
}
