153 lines
3.9 KiB
YAML
153 lines
3.9 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: Novias del Gato API - Moderator (Backoffice)
|
|
description: |
|
|
Backoffice API contract for administrators and cultural moderators.
|
|
Enables tracking and resolving disputed location reports.
|
|
version: 1.0.0
|
|
servers:
|
|
- url: https://api.gatos.cali.gov.co/v1
|
|
description: Production Server
|
|
paths:
|
|
/reports:
|
|
get:
|
|
summary: List Crowdsourced Reports
|
|
description: Retrieve reports/tickets submitted by users, filterable by status for verification.
|
|
operationId: listReports
|
|
security:
|
|
- BearerAuth: []
|
|
parameters:
|
|
- name: status
|
|
in: query
|
|
required: false
|
|
schema:
|
|
type: string
|
|
enum: [pending, approved, rejected]
|
|
- name: sculpture_id
|
|
in: query
|
|
required: false
|
|
schema:
|
|
type: string
|
|
format: uuid
|
|
responses:
|
|
'200':
|
|
description: Array of reports
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Ticket'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
'403':
|
|
$ref: '#/components/responses/Forbidden'
|
|
|
|
/reports/{id}/verify:
|
|
put:
|
|
summary: Resolve Location Ticket
|
|
description: Manually accept or reject a user report. Approving a report updates the location oracle and recalculates user trust scores.
|
|
operationId: verifyReport
|
|
security:
|
|
- BearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: uuid
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
enum: [approved, rejected]
|
|
notes:
|
|
type: string
|
|
maxLength: 300
|
|
description: Review notes explaining the resolution.
|
|
responses:
|
|
'200':
|
|
description: Ticket resolved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Ticket'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
'403':
|
|
$ref: '#/components/responses/Forbidden'
|
|
'404':
|
|
description: Ticket not found.
|
|
|
|
components:
|
|
securitySchemes:
|
|
BearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
|
|
responses:
|
|
Unauthorized:
|
|
description: Authentication token missing or expired.
|
|
Forbidden:
|
|
description: Insufficient permissions for this action.
|
|
|
|
schemas:
|
|
Ticket:
|
|
type: object
|
|
required:
|
|
- id
|
|
- reporter_id
|
|
- sculpture_id
|
|
- latitude
|
|
- longitude
|
|
- reported_status
|
|
- status
|
|
- created_at
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
reporter_id:
|
|
type: string
|
|
format: uuid
|
|
sculpture_id:
|
|
type: string
|
|
format: uuid
|
|
latitude:
|
|
type: number
|
|
format: float
|
|
longitude:
|
|
type: number
|
|
format: float
|
|
reported_status:
|
|
type: string
|
|
enum: [moved, missing, on-site]
|
|
photo_url:
|
|
type: string
|
|
format: uri
|
|
nullable: true
|
|
description:
|
|
type: string
|
|
status:
|
|
type: string
|
|
enum: [pending, approved, rejected]
|
|
created_at:
|
|
type: string
|
|
format: date-time
|
|
resolved_at:
|
|
type: string
|
|
format: date-time
|
|
nullable: true
|
|
notes:
|
|
type: string
|
|
nullable: true
|