Add volume core domain message.

Commit
ff77b27a95458a3c0d8cee99042dfbf16b5515db
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
src/MyFitnessTracker-Core/MFTSetGroupLog.class.st
index 0e741905..0f508a2f 100644..100644
@@ -19,12 +19,10 @@
19 19 { #category : 'accessing' }
20 20 MFTSetGroupLog class >> forPrescription: aMFTSetGroupPrescription [
21 21
22 Removed: | groupLog |
23 Removed: groupLog := self new.
24 Removed: groupLog prescription: aMFTSetGroupPrescription.
25 Removed: groupLog sets: (aMFTSetGroupPrescription sets collect: [ :each |
26 Removed: MFTSetLog forPrescription: each ]).
27 Removed: ^ groupLog
22 Added: ^ self new
23 Added: prescription: aMFTSetGroupPrescription;
24 Added: sets: (aMFTSetGroupPrescription sets collect: [ :each |
25 Added: MFTSetLog forPrescription: each ])
28 26 ]
29 27
30 28 { #category : 'initialization' }
@@ -135,4 +133,10 @@
135 133 MFTSetGroupLog >> uniqueExercisesInSets [
136 134
137 135 ^ prescription uniqueExercisesInSets
136 Added: ]
137 Added:
138 Added: { #category : 'initialization' }
139 Added: MFTSetGroupLog >> volume [
140 Added:
141 Added: ^ (sets collect: #volume) sum
138 142 ]
src/MyFitnessTracker-Core/MFTSetLog.class.st
index aed63589..4501665d 100644..100644
@@ -126,5 +126,7 @@
126 126 { #category : 'as yet unclassified' }
127 127 MFTSetLog >> volume [
128 128
129 Removed: ^ reps * load
129 Added: ^ (reps isNil or: [ load isNil ])
130 Added: ifTrue: [ 0 ]
131 Added: ifFalse: [ reps * load ]
130 132 ]
src/MyFitnessTracker-Core/MFTWorkoutLog.class.st
index 5835ff8f..840ed1cb 100644..100644
@@ -191,3 +191,9 @@
191 191 date := start ifNotNil: [ start asDate ] ifNil: [ Date today ].
192 192 start := DateAndTime date: date time: aTime
193 193 ]
194 Added:
195 Added: { #category : 'accessing' }
196 Added: MFTWorkoutLog >> volume [
197 Added:
198 Added: ^ (setGroups collect: #volume) sum
199 Added: ]