{ "swagger": "2.0", "info": { "description": "Read-only projections built from saga events (user registrations, event booking stats).", "title": "analytics-service API", "contact": {}, "version": "1.0" }, "basePath": "/api/v1", "paths": { "/analytics/events/{eventID}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Confirmed / cancelled booking counts for one event, projected from booking-outcome saga events.", "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Event booking stats", "parameters": [ { "type": "string", "description": "event UUID", "name": "eventID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.EventStatsResponse" } }, "400": { "description": "eventID is not a UUID", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "401": { "description": "invalid or missing bearer token", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "403": { "description": "caller is not listed in ANALYTICS_ADMIN_USER_IDS", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "404": { "description": "no stats for this event", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "500": { "description": "internal server error", "schema": { "$ref": "#/definitions/http.ErrorResponse" } } } } }, "/analytics/users/{userID}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "The registration record projected from the UserCreated event user-service published.", "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "User registration projection", "parameters": [ { "type": "string", "description": "user UUID", "name": "userID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.UserRegistrationResponse" } }, "400": { "description": "userID is not a UUID", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "401": { "description": "invalid or missing bearer token", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "403": { "description": "caller is not listed in ANALYTICS_ADMIN_USER_IDS", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "404": { "description": "no registration for this user", "schema": { "$ref": "#/definitions/http.ErrorResponse" } }, "500": { "description": "internal server error", "schema": { "$ref": "#/definitions/http.ErrorResponse" } } } } } }, "definitions": { "http.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "http.EventStatsResponse": { "type": "object", "properties": { "cancelled": { "type": "integer" }, "confirmed": { "type": "integer" }, "event_id": { "type": "string" } } }, "http.UserRegistrationResponse": { "type": "object", "properties": { "email": { "type": "string" }, "recorded_at": { "type": "string" }, "registered_at": { "type": "string" }, "user_id": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }