Skip to content

feat(sensor): photo upload endpoint and SensorPhoto model#125

Merged
sondresjolyst merged 3 commits intodevelopmentfrom
feat/sensor-photo
Apr 27, 2026
Merged

feat(sensor): photo upload endpoint and SensorPhoto model#125
sondresjolyst merged 3 commits intodevelopmentfrom
feat/sensor-photo

Conversation

@sondresjolyst
Copy link
Copy Markdown
Owner

Summary

  • New SensorPhoto model: SensorId, UserId, Data (base64 text), ContentType, CreatedAt
  • Unique index on SensorId — one photo per sensor
  • Cascade delete on both Sensor and User for GDPR compliance
  • Three endpoints: POST /api/sensors/{id}/photo, GET /api/sensors/{id}/photo, DELETE /api/sensors/{id}/photo
  • EF Core migration included (AddSensorPhoto)

Test plan

  • POST — upload a photo, verify it is stored
  • GET — retrieve the photo for a sensor
  • DELETE — remove the photo
  • POST again on the same sensor — should replace, not duplicate
  • Delete user — verify SensorPhoto rows are cascade-deleted

sondresjolyst and others added 3 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>
POST/GET/DELETE /api/sensors/{id}/photo. One photo per sensor (unique index), base64 stored in a text column, cascade-deleted with both the sensor and the user for GDPR compliance.
@sondresjolyst sondresjolyst merged commit 9e26e51 into development Apr 27, 2026
1 check passed
@sondresjolyst sondresjolyst deleted the feat/sensor-photo branch April 27, 2026 18:44
sondresjolyst added a commit that referenced this pull request Apr 27, 2026
* chore(main): release 2.0.4 (#116)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(sensor): add photo upload endpoint and SensorPhoto model

POST/GET/DELETE /api/sensors/{id}/photo. One photo per sensor (unique index), base64 stored in a text column, cascade-deleted with both the sensor and the user for GDPR compliance.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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