Skip to content

feat: admin page, sensor activities, and CreatedAt tracking#124

Merged
sondresjolyst merged 4 commits intodevelopmentfrom
feat/admin-page
Apr 27, 2026
Merged

feat: admin page, sensor activities, and CreatedAt tracking#124
sondresjolyst merged 4 commits intodevelopmentfrom
feat/admin-page

Conversation

@sondresjolyst
Copy link
Copy Markdown
Owner

Summary

  • Super admin page (Admin role only) with user management, role assign/remove, delete, aggregate stats, MQTT device overview, and stats-over-time charts
  • SensorActivity model and CRUD endpoints for per-sensor maintenance logging (title, notes, date, odometer)
  • CreatedAt added to User, Sensor, Switch, AutomationRule with migrations
  • GET /api/admin/stats and GET /api/admin/stats/history endpoints
  • UserDto extended with roles; history endpoint guards against pre-2020 timestamps

Test plan

  • Run dotnet ef database update to apply the three new migrations
  • Fix -infinity CreatedAt values on existing rows with SQL UPDATE queries
  • Verify /api/admin/stats and /api/admin/stats/history return correct data
  • Verify role assign/remove and user delete work via the admin page
  • Confirm non-Admin users receive 403 on admin endpoints

sondresjolyst and others added 4 commits April 23, 2026 07:59
fix(electricity): surface NordPool warnings and refresh today+tomorrow on daily run
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Add super admin page with user management (role assign/remove, delete),
  aggregate stats, MQTT device list, and stats-over-time charts
- Add CreatedAt to User, Sensor, Switch, AutomationRule models with
  migrations; history endpoint returns cumulative daily counts
- Add SensorActivity model, migrations, and CRUD controller so users
  can log maintenance activities with title, notes, date, and odometer
- Extend UserDto to include roles; add AdminStatsDto
- Guard stats history endpoint against pre-2020 timestamps
# Conflicts:
#	Controllers/SensorActivitiesController.cs
#	Dtos/Sensor/CreateSensorActivityDto.cs
#	Dtos/Sensor/SensorActivityDto.cs
#	Dtos/Sensor/UpdateSensorActivityDto.cs
#	Models/Sensor/SensorActivity.cs
#	Program.cs
@sondresjolyst sondresjolyst merged commit 0902b8e into development Apr 27, 2026
1 check passed
@sondresjolyst sondresjolyst deleted the feat/admin-page branch April 27, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant