39 lines
793 B
Swift
39 lines
793 B
Swift
//
|
|
// DebugInfoEntry.swift
|
|
// AutoCatCore
|
|
//
|
|
// Created by Selim Mustafaev on 03.04.2022.
|
|
//
|
|
|
|
import Foundation
|
|
import CoreData
|
|
|
|
public enum DebugInfoStatus: Int64 {
|
|
case success = 0
|
|
case error = 1
|
|
case warning = 2
|
|
}
|
|
|
|
public struct DebugInfoEntry: Decodable {
|
|
|
|
let fields: Int64
|
|
let error: String?
|
|
let status: Int64
|
|
}
|
|
|
|
extension CDDebugInfoEntry {
|
|
|
|
convenience init(model: DebugInfoEntry?, context: NSManagedObjectContext) {
|
|
self.init(context: context)
|
|
|
|
self.fields = model?.fields ?? 0
|
|
self.error = model?.error
|
|
self.status = model?.status ?? 0
|
|
}
|
|
|
|
public var statusEnum: DebugInfoStatus {
|
|
get { DebugInfoStatus(rawValue: self.status)! }
|
|
set { self.status = newValue.rawValue }
|
|
}
|
|
}
|