|
11 | 11 |
|
12 | 12 | **Purpose**: Add the dashboard-specific frontend dependency and prepare the shared visualization foundation. |
13 | 13 |
|
14 | | -- [ ] T001 Add the `recharts` dependency in `src/BikeTracking.Frontend/package.json` and `src/BikeTracking.Frontend/package-lock.json` |
15 | | -- [ ] T002 Create the shared ShadCN-style chart wrapper in `src/BikeTracking.Frontend/src/components/ui/chart.tsx` |
| 14 | +- [x] T001 Add the `recharts` dependency in `src/BikeTracking.Frontend/package.json` and `src/BikeTracking.Frontend/package-lock.json` |
| 15 | +- [x] T002 Create the shared ShadCN-style chart wrapper in `src/BikeTracking.Frontend/src/components/ui/chart.tsx` |
16 | 16 |
|
17 | 17 | --- |
18 | 18 |
|
|
22 | 22 |
|
23 | 23 | **⚠️ CRITICAL**: No user story work can begin until this phase is complete. |
24 | 24 |
|
25 | | -- [ ] T003 Create the dashboard API contracts in `src/BikeTracking.Api/Contracts/DashboardContracts.cs` |
26 | | -- [ ] T004 Extend dashboard preference fields in `src/BikeTracking.Api/Contracts/UsersContracts.cs` |
27 | | -- [ ] T005 [P] Add ride snapshot fields in `src/BikeTracking.Api/Infrastructure/Persistence/Entities/RideEntity.cs` |
28 | | -- [ ] T006 [P] Add dashboard preference fields in `src/BikeTracking.Api/Infrastructure/Persistence/Entities/UserSettingsEntity.cs` |
29 | | -- [ ] T007 Configure snapshot and preference persistence in `src/BikeTracking.Api/Infrastructure/Persistence/BikeTrackingDbContext.cs` |
30 | | -- [ ] T008 Create the EF Core migration in `src/BikeTracking.Api/Infrastructure/Persistence/Migrations/` |
31 | | -- [ ] T009 Add migration coverage for the new migration in `src/BikeTracking.Api.Tests/Infrastructure/MigrationTestCoveragePolicyTests.cs` |
| 25 | +- [x] T003 Create the dashboard API contracts in `src/BikeTracking.Api/Contracts/DashboardContracts.cs` |
| 26 | +- [x] T004 Extend dashboard preference fields in `src/BikeTracking.Api/Contracts/UsersContracts.cs` |
| 27 | +- [x] T005 [P] Add ride snapshot fields in `src/BikeTracking.Api/Infrastructure/Persistence/Entities/RideEntity.cs` |
| 28 | +- [x] T006 [P] Add dashboard preference fields in `src/BikeTracking.Api/Infrastructure/Persistence/Entities/UserSettingsEntity.cs` |
| 29 | +- [x] T007 Configure snapshot and preference persistence in `src/BikeTracking.Api/Infrastructure/Persistence/BikeTrackingDbContext.cs` |
| 30 | +- [x] T008 Create the EF Core migration in `src/BikeTracking.Api/Infrastructure/Persistence/Migrations/` |
| 31 | +- [x] T009 Add migration coverage for the new migration in `src/BikeTracking.Api.Tests/Infrastructure/MigrationTestCoveragePolicyTests.cs` |
32 | 32 |
|
33 | 33 | **Checkpoint**: Foundation ready. Core dashboard, historical accuracy, and optional metric work can now proceed. |
34 | 34 |
|
|
44 | 44 |
|
45 | 45 | > **NOTE**: Write these tests first, ensure they fail, and get user confirmation before implementation. |
46 | 46 |
|
47 | | -- [ ] T010 [US1] Add dashboard aggregation unit tests in `src/BikeTracking.Api.Tests/Application/Dashboard/GetDashboardServiceTests.cs` |
48 | | -- [ ] T011 [US1] Add dashboard endpoint tests in `src/BikeTracking.Api.Tests/Endpoints/DashboardEndpointsTests.cs` |
49 | | -- [ ] T012 [US1] Add dashboard API client tests in `src/BikeTracking.Frontend/src/services/dashboard-api.test.ts` |
50 | | -- [ ] T013 [US1] Add dashboard page rendering tests in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.test.tsx` |
51 | | -- [ ] T014 [US1] Add dashboard landing and totals E2E coverage in `src/BikeTracking.Frontend/tests/e2e/dashboard.spec.ts` |
| 47 | +- [x] T010 [US1] Add dashboard aggregation unit tests in `src/BikeTracking.Api.Tests/Application/Dashboard/GetDashboardServiceTests.cs` |
| 48 | +- [x] T011 [US1] Add dashboard endpoint tests in `src/BikeTracking.Api.Tests/Endpoints/DashboardEndpointsTests.cs` |
| 49 | +- [x] T012 [US1] Add dashboard API client tests in `src/BikeTracking.Frontend/src/services/dashboard-api.test.ts` |
| 50 | +- [x] T013 [US1] Add dashboard page rendering tests in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.test.tsx` |
| 51 | +- [x] T014 [US1] Add dashboard landing and totals E2E coverage in `src/BikeTracking.Frontend/tests/e2e/dashboard.spec.ts` |
52 | 52 |
|
53 | 53 | ### Implementation for User Story 1 |
54 | 54 |
|
55 | | -- [ ] T015 [US1] Implement dashboard aggregation logic in `src/BikeTracking.Api/Application/Dashboard/GetDashboardService.cs` |
56 | | -- [ ] T016 [US1] Implement the dashboard endpoint in `src/BikeTracking.Api/Endpoints/DashboardEndpoints.cs` |
57 | | -- [ ] T017 [US1] Register dashboard services and endpoint mapping in `src/BikeTracking.Api/Program.cs` |
58 | | -- [ ] T018 [US1] Implement the dashboard API client in `src/BikeTracking.Frontend/src/services/dashboard-api.ts` |
59 | | -- [ ] T019 [US1] Create dashboard summary card and metric components in `src/BikeTracking.Frontend/src/components/dashboard/dashboard-summary-card.tsx` |
60 | | -- [ ] T020 [US1] Create dashboard chart section components in `src/BikeTracking.Frontend/src/components/dashboard/dashboard-chart-section.tsx` |
61 | | -- [ ] T021 [US1] Create dashboard empty and partial-data callouts in `src/BikeTracking.Frontend/src/components/dashboard/dashboard-status-panel.tsx` |
62 | | -- [ ] T022 [US1] Build the dashboard page layout in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.tsx` |
63 | | -- [ ] T023 [US1] Implement dashboard styling in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.css` |
64 | | -- [ ] T024 [US1] Make the dashboard the authenticated main page in `src/BikeTracking.Frontend/src/App.tsx` |
65 | | -- [ ] T025 [US1] Update the main navigation links for the new dashboard route in `src/BikeTracking.Frontend/src/components/app-header/app-header.tsx` |
66 | | -- [ ] T026 [US1] Replace the legacy miles page with a redirect shell in `src/BikeTracking.Frontend/src/pages/miles/miles-shell-page.tsx` |
| 55 | +- [x] T015 [US1] Implement dashboard aggregation logic in `src/BikeTracking.Api/Application/Dashboard/GetDashboardService.cs` |
| 56 | +- [x] T016 [US1] Implement the dashboard endpoint in `src/BikeTracking.Api/Endpoints/DashboardEndpoints.cs` |
| 57 | +- [x] T017 [US1] Register dashboard services and endpoint mapping in `src/BikeTracking.Api/Program.cs` |
| 58 | +- [x] T018 [US1] Implement the dashboard API client in `src/BikeTracking.Frontend/src/services/dashboard-api.ts` |
| 59 | +- [x] T019 [US1] Create dashboard summary card and metric components in `src/BikeTracking.Frontend/src/components/dashboard/dashboard-summary-card.tsx` |
| 60 | +- [x] T020 [US1] Create dashboard chart section components in `src/BikeTracking.Frontend/src/components/dashboard/dashboard-chart-section.tsx` |
| 61 | +- [x] T021 [US1] Create dashboard empty and partial-data callouts in `src/BikeTracking.Frontend/src/components/dashboard/dashboard-status-panel.tsx` |
| 62 | +- [x] T022 [US1] Build the dashboard page layout in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.tsx` |
| 63 | +- [x] T023 [US1] Implement dashboard styling in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.css` |
| 64 | +- [x] T024 [US1] Make the dashboard the authenticated main page in `src/BikeTracking.Frontend/src/App.tsx` |
| 65 | +- [x] T025 [US1] Update the main navigation links for the new dashboard route in `src/BikeTracking.Frontend/src/components/app-header/app-header.tsx` |
| 66 | +- [x] T026 [US1] Replace the legacy miles page with a redirect shell in `src/BikeTracking.Frontend/src/pages/miles/miles-shell-page.tsx` |
67 | 67 |
|
68 | 68 | **Checkpoint**: User Story 1 is independently functional when an authenticated rider lands on the dashboard and sees baseline cards, averages, and charts without using ride history. |
69 | 69 |
|
|
77 | 77 |
|
78 | 78 | ### Tests for User Story 2 ⚠️ |
79 | 79 |
|
80 | | -- [ ] T027 [US2] Extend ride write-service tests for snapshot capture in `src/BikeTracking.Api.Tests/Application/RidesApplicationServiceTests.cs` |
81 | | -- [ ] T028 [US2] Add snapshot persistence coverage in `src/BikeTracking.Api.Tests/Infrastructure/RidesPersistenceTests.cs` |
82 | | -- [ ] T029 [US2] Add historical-savings stability E2E coverage in `src/BikeTracking.Frontend/tests/e2e/dashboard.spec.ts` |
| 80 | +- [x] T027 [US2] Extend ride write-service tests for snapshot capture in `src/BikeTracking.Api.Tests/Application/RidesApplicationServiceTests.cs` |
| 81 | +- [x] T028 [US2] Add snapshot persistence coverage in `src/BikeTracking.Api.Tests/Infrastructure/RidesPersistenceTests.cs` |
| 82 | +- [x] T029 [US2] Add historical-savings stability E2E coverage in `src/BikeTracking.Frontend/tests/e2e/dashboard.spec.ts` |
83 | 83 |
|
84 | 84 | ### Implementation for User Story 2 |
85 | 85 |
|
86 | | -- [ ] T030 [US2] Add snapshot fields to recorded ride events in `src/BikeTracking.Api/Application/Events/RideRecordedEventPayload.cs` |
87 | | -- [ ] T031 [US2] Add snapshot fields to edited ride events in `src/BikeTracking.Api/Application/Events/RideEditedEventPayload.cs` |
88 | | -- [ ] T032 [US2] Capture calculation snapshots during ride creation in `src/BikeTracking.Api/Application/Rides/RecordRideService.cs` |
89 | | -- [ ] T033 [US2] Refresh calculation snapshots during ride edits in `src/BikeTracking.Api/Application/Rides/EditRideService.cs` |
90 | | -- [ ] T034 [US2] Apply snapshot-first and legacy fallback rules in `src/BikeTracking.Api/Application/Dashboard/GetDashboardService.cs` |
| 86 | +- [x] T030 [US2] Add snapshot fields to recorded ride events in `src/BikeTracking.Api/Application/Events/RideRecordedEventPayload.cs` |
| 87 | +- [x] T031 [US2] Add snapshot fields to edited ride events in `src/BikeTracking.Api/Application/Events/RideEditedEventPayload.cs` |
| 88 | +- [x] T032 [US2] Capture calculation snapshots during ride creation in `src/BikeTracking.Api/Application/Rides/RecordRideService.cs` |
| 89 | +- [x] T033 [US2] Refresh calculation snapshots during ride edits in `src/BikeTracking.Api/Application/Rides/EditRideService.cs` |
| 90 | +- [x] T034 [US2] Apply snapshot-first and legacy fallback rules in `src/BikeTracking.Api/Application/Dashboard/GetDashboardService.cs` |
91 | 91 |
|
92 | 92 | **Checkpoint**: User Story 2 is independently functional when changing user settings no longer rewrites prior ride savings in the dashboard. |
93 | 93 |
|
|
101 | 101 |
|
102 | 102 | ### Tests for User Story 3 ⚠️ |
103 | 103 |
|
104 | | -- [ ] T035 [US3] Extend user settings service tests for dashboard approvals in `src/BikeTracking.Api.Tests/Application/Users/UserSettingsServiceTests.cs` |
105 | | -- [ ] T036 [US3] Extend user settings endpoint tests for dashboard approvals in `src/BikeTracking.Api.Tests/Endpoints/UsersEndpointsTests.cs` |
106 | | -- [ ] T037 [US3] Extend settings page approval tests in `src/BikeTracking.Frontend/src/pages/settings/SettingsPage.test.tsx` |
107 | | -- [ ] T038 [US3] Add optional-metric approval E2E coverage in `src/BikeTracking.Frontend/tests/e2e/dashboard.spec.ts` |
| 104 | +- [x] T035 [US3] Extend user settings service tests for dashboard approvals in `src/BikeTracking.Api.Tests/Application/Users/UserSettingsServiceTests.cs` |
| 105 | +- [x] T036 [US3] Extend user settings endpoint tests for dashboard approvals in `src/BikeTracking.Api.Tests/Endpoints/UsersEndpointsTests.cs` |
| 106 | +- [x] T037 [US3] Extend settings page approval tests in `src/BikeTracking.Frontend/src/pages/settings/SettingsPage.test.tsx` |
| 107 | +- [x] T038 [US3] Add optional-metric approval E2E coverage in `src/BikeTracking.Frontend/tests/e2e/dashboard.spec.ts` |
108 | 108 |
|
109 | 109 | ### Implementation for User Story 3 |
110 | 110 |
|
111 | | -- [ ] T039 [US3] Persist dashboard approval fields in `src/BikeTracking.Api/Application/Users/UserSettingsService.cs` |
112 | | -- [ ] T040 [US3] Accept and return dashboard approval fields in `src/BikeTracking.Api/Endpoints/UsersEndpoints.cs` |
113 | | -- [ ] T041 [US3] Extend frontend user settings DTOs in `src/BikeTracking.Frontend/src/services/users-api.ts` |
114 | | -- [ ] T042 [US3] Add gallons avoided and goal progress approval controls in `src/BikeTracking.Frontend/src/pages/settings/SettingsPage.tsx` |
115 | | -- [ ] T043 [US3] Render optional metric suggestions and approved metrics in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.tsx` |
| 111 | +- [x] T039 [US3] Persist dashboard approval fields in `src/BikeTracking.Api/Application/Users/UserSettingsService.cs` |
| 112 | +- [x] T040 [US3] Accept and return dashboard approval fields in `src/BikeTracking.Api/Endpoints/UsersEndpoints.cs` |
| 113 | +- [x] T041 [US3] Extend frontend user settings DTOs in `src/BikeTracking.Frontend/src/services/users-api.ts` |
| 114 | +- [x] T042 [US3] Add gallons avoided and goal progress approval controls in `src/BikeTracking.Frontend/src/pages/settings/SettingsPage.tsx` |
| 115 | +- [x] T043 [US3] Render optional metric suggestions and approved metrics in `src/BikeTracking.Frontend/src/pages/dashboard/dashboard-page.tsx` |
116 | 116 |
|
117 | 117 | **Checkpoint**: User Story 3 is independently functional when optional metrics stay hidden until approved and appear only after rider opt-in. |
118 | 118 |
|
|
122 | 122 |
|
123 | 123 | **Purpose**: Final validation and cleanup across stories. |
124 | 124 |
|
125 | | -- [ ] T044 [P] Update manual API examples for dashboard and settings approvals in `src/BikeTracking.Api/BikeTracking.Api.http` |
126 | | -- [ ] T045 Code cleanup and shared helper refactoring in `src/BikeTracking.Api/Application/Dashboard/GetDashboardService.cs` |
127 | | -- [ ] T046 [P] Run full validation from `specs/012-dashboard-stats/quickstart.md` |
| 125 | +- [x] T044 [P] Update manual API examples for dashboard and settings approvals in `src/BikeTracking.Api/BikeTracking.Api.http` |
| 126 | +- [x] T045 Code cleanup and shared helper refactoring in `src/BikeTracking.Api/Application/Dashboard/GetDashboardService.cs` |
| 127 | +- [x] T046 [P] Run full validation from `specs/012-dashboard-stats/quickstart.md` |
128 | 128 |
|
129 | 129 | --- |
130 | 130 |
|
|
0 commit comments