import Foundation
import HealthKit

extension HKWorkoutEvent {

    static var mock1: [HKWorkoutEvent] {
        [
            .init(type: .init(rawValue: 7)!,
                  dateInterval: .init(start: Date(timeIntervalSinceReferenceDate: 702107518.84307),
                                      duration: 1114.56374406815),
                  metadata: [
                    "_HKPrivateMetadataTotalDistanceQuantity": HKQuantity(unit: .meter(), doubleValue: 1000),
                    "_HKPrivateWorkoutSegmentEventSubtype": NSNumber(value: UInt64(1)),
                    "_HKPrivateMetadataSplitDistanceQuantity": HKQuantity(unit: .meter(), doubleValue: 1000),
                    "_HKPrivateMetadataSplitMeasuringSystem": NSNumber(value: UInt64(1)),
                    "_HKPrivateMetadataIsPartialSplit": NSNumber(0),
                    "_HKPrivateMetadataSplitActiveDurationQuantity": HKQuantity(unit: .second(), doubleValue: 1114.56)
                  ]),
            .init(type: .init(rawValue: 7)!,
                  dateInterval: .init(start: Date(timeIntervalSinceReferenceDate: 702107518.84307),
                                      duration: 1972.17168283463),
                  metadata: [
                    "_HKPrivateMetadataSplitDistanceQuantity": HKQuantity(unit: .meter(), doubleValue: 1609.34),
                    "_HKPrivateMetadataSplitActiveDurationQuantity": HKQuantity(unit: .second(), doubleValue: 1972.17),
                    "_HKPrivateMetadataIsPartialSplit": NSNumber(value: UInt64(0)),
                    "_HKPrivateMetadataTotalDistanceQuantity": HKQuantity(unit: .meter(), doubleValue: 1609.34),
                    "_HKPrivateWorkoutSegmentEventSubtype": NSNumber(value: UInt64(1)),
                    "_HKPrivateMetadataSplitMeasuringSystem": NSNumber(value: UInt64(2))
                  ]),
            .init(type: .init(rawValue: 1)!,
                  dateInterval: .init(start: Date(timeIntervalSinceReferenceDate: 702112942.707113),
                                      duration: 0.0),
                  metadata: [
                    "_HKPrivateMetadataSplitDistanceQuantity": HKQuantity(unit: .meter(), doubleValue: 1609.34),
                    "_HKPrivateMetadataSplitActiveDurationQuantity": HKQuantity(unit: .second(), doubleValue: 1972.17),
                    "_HKPrivateMetadataIsPartialSplit": NSNumber(value: UInt64(0)),
                    "_HKPrivateMetadataTotalDistanceQuantity": HKQuantity(unit: .meter(), doubleValue: 1609.34),
                    "_HKPrivateWorkoutSegmentEventSubtype": NSNumber(value: UInt64(1)),
                    "_HKPrivateMetadataSplitMeasuringSystem": NSNumber(value: UInt64(2)),
                  ]),
            .init(type: .init(rawValue: 2)!,
                  dateInterval: .init(start: Date(timeIntervalSinceReferenceDate: 702113161.221132),
                                      duration: 0.0),
                  metadata: [:])
        ]
    }
}
