// // Entry.swift // gastrack // // Created by Pradyun Setti on 23/02/2025. // import Foundation import SwiftData @Model final class Entry { var id: UUID var date: Date var odo: Int var cost: Double var quantity: Double var fuelType: String public init(date: Date = Date(), odo: Int, cost: Double, quantity: Double, fuelType: String) { self.id = UUID() self.date = date self.odo = odo self.cost = cost self.quantity = quantity self.fuelType = fuelType } public func getFormattedDate() -> String { return self.date.formatted(date: .numeric, time: .omitted) } }