Refactoring data model

This commit is contained in:
Will Baumbach
2026-03-26 16:49:50 -05:00
parent 7ae3dbd27f
commit 349ac48fa2
4 changed files with 860 additions and 928 deletions

View File

@@ -11,16 +11,16 @@
<th>Sunday</th>
<th>Total Milage</th>
</tr>
@for (week of examplePlan.workouts; track $index) {
@for (planWeek of examplePlan.planDetials; track $index) {
<tr>
<td>
<div>Week {{$index + 1}}</div>
<div>Week {{planWeek.week}}</div>
</td>
@for (day of week; track $index) {
@for (workout of planWeek.workouts; track $index) {
<td class="hoverOverWorkout">
<div>{{day.type}}</div>
<div>{{day.totalDistance == 0 ? '' : day.totalDistance + ' miles'}}</div>
<div>{{day.description}}</div>
<div>{{workout.type}}</div>
<div>{{workout.totalDistance == 0 ? '' : workout.totalDistance + ' miles'}}</div>
<div>{{workout.description}}</div>
</td>
}
<td>43</td>

View File

@@ -6,5 +6,10 @@ export interface Plan {
startDate: Date,
endDate: Date,
numWeeks: number,
workouts: Workout[][]
planDetials: Week[]
}
export interface Week {
week: number,
workouts: Workout[]
}

View File

@@ -1,5 +1,4 @@
export interface Workout {
week: number
day: number,
type: WorkoutType,
totalDistance: number,

File diff suppressed because it is too large Load Diff