Add report media uploads

This commit is contained in:
gabdevele
2026-06-02 20:38:44 +02:00 Unverified
parent b59536757b
commit 1ef41bb2a3
12 changed files with 77 additions and 46 deletions
+3 -1
View File
@@ -30,7 +30,9 @@ Authorization: Bearer <token>
- `GET /reports/{id}/messages`: list report messages.
- `POST /reports/{id}/assignments`: assign a team.
- `POST /reports/{id}/feedback`: add citizen feedback.
- `POST /reports/{id}/photos`: upload up to five JPEG/PNG/WebP multipart files.
- `POST /reports/{id}/media`: upload up to five multipart media files. Supported
types are JPEG, PNG, WebP, MP4, WebM and QuickTime. The legacy
`/reports/{id}/photos` path is kept as a compatibility alias.
## Admin Reference Data
- `GET|POST /admin/categories`
+2 -1
View File
@@ -14,7 +14,8 @@ Important tables:
- `reports`: citizen reports with coordinates, address, status, area and assigned operator.
- `report_status_history`: immutable status transition log.
- `assignments`: report-to-team assignment history.
- `report_photos`: uploaded photo URL, original filename, content type and size.
- `report_photos`: uploaded report media URL, original filename, content type,
media kind and size. The table name is historical; rows can be images or videos.
- `messages`: citizen/operator report conversation.
- `feedback`: citizen rating and comment after resolution.
- `reward_events`: indirect gamification points ledger.
+4 -3
View File
@@ -1,7 +1,8 @@
# Visione Backend LLM Context
Visione is a C++20/Drogon backend for a municipal urban issue reporting system.
Citizens create reports with category, position, address, description and photos.
Citizens create reports with category, position, address, description and media
attachments.
Operators manage reports, assign teams, update status and chat with citizens.
Admins manage roles, users, areas, teams and reference data.
@@ -16,5 +17,5 @@ Important conventions:
- Use Drogon references from `/home/gabdevele/Projects/snitchitaly/backend/drogon`
and `https://drogonframework.github.io/drogon-docs/`.
- `AGENTS.md` is the durable agent instruction entrypoint.
- `docs/MILESTONE_01.md` describes what has been implemented and what comes next.
- `docs/MILESTONE_01.md` and later milestone files describe what has been
implemented and what comes next.
+1 -1
View File
@@ -9,7 +9,7 @@
- OTP email delivery through MailHog.
- Focused regression tests for technical endpoints and core validation helpers.
- Local admin seed: `[email protected]` / `ChangeMe123!`, with forced password change flag.
- Multipart report photo upload endpoint storing files under `uploads/reports/`.
- Multipart report media upload endpoint storing files under `uploads/reports/`.
- PBKDF2-HMAC-SHA256 password hashes for credentials. Legacy SHA-256 hashes are intentionally rejected.
## To do next
+1 -2
View File
@@ -8,7 +8,7 @@
- Report ownership workflow with assigned operator and take endpoint.
- Valid report status transitions.
- Citizen report filters scoped to own reports.
- Report photo upload validation and metadata storage.
- Report media upload validation and metadata storage.
## To do next
- Add broader API tests once the frontend contracts stabilize.
@@ -16,4 +16,3 @@
- Add moderation flow for abusive reports/messages.
- Add open-data exports and statistics refinements.
- Design CIE/SPID integration.