feat: add canOperateReports and canFlagReportContent functions for report management

This commit is contained in:
gabdevele
2026-06-14 21:49:53 +02:00 Unverified
parent ca09e7b6c8
commit cb922baa46
7 changed files with 38 additions and 20 deletions
+4 -3
View File
@@ -32,13 +32,14 @@ Authorization: Bearer <token>
- `GET /reports/{id}/intervention-summary`: operator-facing report summary with
citizen contact data, media and latest messages.
- `PATCH /reports/{id}/status`: update status.
- `POST /reports/{id}/take`: operator/admin takes an open report.
- `POST /reports/{id}/take`: assigned-queue operator takes an open report.
- `POST /reports/{id}/messages`: write a report message.
- `GET /reports/{id}/messages`: list report messages.
- `POST /reports/{id}/messages/{message_id}/flags`: flag a message for moderation.
- `POST /reports/{id}/messages/{message_id}/flags`: assigned operator flags a
report message for moderation.
- `POST /reports/{id}/assignments`: assign a team.
- `POST /reports/{id}/feedback`: add citizen feedback.
- `POST /reports/{id}/flags`: flag a report for moderation.
- `POST /reports/{id}/flags`: assigned operator flags a report for moderation.
- `POST /reports/{id}/media`: upload up to five multipart media files. Supported
types are JPEG, PNG, WebP, MP4, WebM and QuickTime.
+3 -2
View File
@@ -8,7 +8,8 @@ assign and resolve interventions while preserving history and basic analytics.
- `citizen`: registers, requests OTP login, creates reports, follows own reports,
sends messages and leaves feedback after resolution.
- `operator`: views reports, takes open reports, assigns teams, updates managed
reports and messages citizens.
reports, messages citizens and flags abusive/fake citizen content on managed
reports.
- `admin`: manages users, roles, reference data, teams, areas and all reports.
The system admin seed must change password before using protected operational
@@ -25,7 +26,7 @@ or administrative APIs.
Valid milestone 2 transitions:
- `OPEN -> UNDER_REVIEW` when an operator/admin takes the report.
- `OPEN -> UNDER_REVIEW` when an operator takes the report.
- `UNDER_REVIEW -> ASSIGNED` when a team is assigned.
- `ASSIGNED -> IN_PROGRESS`.
- `IN_PROGRESS -> RESOLVED`.
+3 -3
View File
@@ -3056,7 +3056,7 @@
},
"/api/v1/reports/{id}/flags": {
"post": {
"description": "Creates a moderation flag for a report.",
"description": "Creates a moderation flag for a report by assigned operator only.",
"operationId": "ReportController.flagReport",
"parameters": [
{
@@ -3313,7 +3313,7 @@
},
"/api/v1/reports/{id}/messages/{message_id}/flags": {
"post": {
"description": "Creates a moderation flag for a report message.",
"description": "Creates a moderation flag for a report message by assigned operator only.",
"operationId": "ReportController.flagMessage",
"parameters": [
{
@@ -3436,7 +3436,7 @@
},
"/api/v1/reports/{id}/take": {
"post": {
"description": "Assigns an open report to the current operator.",
"description": "Assigns an open report to current non-admin operator.",
"operationId": "ReportController.takeReport",
"parameters": [
{