import Foundation
import HealthKit
import HealthDB
import HealthKitExtensions

extension Workout {

    static var mock1: Workout {
        let activity = HKWorkoutActivity.mock1
        return .init(dataId: 8196339,
              startDate: activity.startDate,
              endDate: activity.endDate!,
              totalDistance: 16.7620435816585,
              goalType: 2,
              goal: 19800.0,
              events: HKWorkoutEvent.mock1,
              activities: [activity],
              metadata: Metadata.mock1)
    }
}

extension Workout {
    
    var duration: TimeInterval {
        endDate.timeIntervalSince(startDate)
    }
}
