AutoCat/AutoCatCore/Models/VehicleNote.swift
2021-09-26 18:47:14 +03:00

32 lines
788 B
Swift

import Foundation
import RealmSwift
public class VehicleNote: Object, Codable, Cloneable {
@objc public dynamic var id: String = UUID().uuidString
@objc public dynamic var user: String = ""
@objc public dynamic var date: TimeInterval = Date().timeIntervalSince1970
@objc public dynamic var text: String = ""
// MARK: - Cloneable
public required init(copy: VehicleNote) {
self.id = copy.id
self.user = copy.user
self.date = copy.date
self.text = copy.text
}
required init() {
super.init()
}
public init(text: String) {
self.text = text
self.user = Settings.shared.user.email
}
public override static func primaryKey() -> String? {
return "id"
}
}