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

View File

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

View File

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

File diff suppressed because it is too large Load Diff