clean up ActiveWorkoutSession

This commit is contained in:
Felix Förtsch
2024-11-12 14:47:59 +01:00
parent 19b3d89010
commit 370e070fcd
20 changed files with 281 additions and 238 deletions

View File

@@ -18,14 +18,15 @@ final class WorkoutSessionItem: Nameable, Positionable {
var plannedReps: Int // 8 times | 1 time
var plannedValue: Double // With 10 | 42,187
var unit: ExerciseUnit
var metric: ExerciseMetric? // kg (weight) | km (distance)
var unit: ExerciseUnit?
var metric: ExerciseType? // kg (weight) | km (distance)
var actualReps: Int?
var actualValue: Double?
var startDate: Date?
var stopDate: Date?
func isCompleted() -> Bool { stopDate != nil }
init(workoutSession: WorkoutSession, planned: WorkoutItem) {
self.workoutSession = workoutSession
@@ -33,8 +34,6 @@ final class WorkoutSessionItem: Nameable, Positionable {
self.position = planned.position
self.plannedReps = planned.plannedReps
self.plannedValue = planned.plannedValue
self.unit = planned.unit
self.metric = planned.metric
}
func start() { startDate = .now }