From e9c657e2ed5ca52b3637a9887115f1f6fb0f0040 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Wed, 28 Oct 2026 23:11:18 +0300 Subject: [PATCH] Complete Swagger documentation and validate API contracts --- cmd/main.go | 7 +- docs/api-audiences.md | 17 + docs/docs.go | 9202 ++++++++++++++++- docs/swagger.json | 9202 ++++++++++++++++- docs/swagger.yaml | 6243 ++++++++++- internal/domain/user.go | 6 +- internal/web_server/api_docs.go | 8 +- internal/web_server/api_docs_test.go | 12 +- internal/web_server/handlers/activity_logs.go | 7 + internal/web_server/handlers/admin.go | 31 +- internal/web_server/handlers/admin_export.go | 30 + .../handlers/admin_subscription_handler.go | 8 +- .../handlers/admin_user_detail_handler.go | 8 +- .../web_server/handlers/analytics_handler.go | 3 + internal/web_server/handlers/arifpay.go | 25 + internal/web_server/handlers/auth_handler.go | 25 + internal/web_server/handlers/chapa.go | 11 + internal/web_server/handlers/chapa_direct.go | 6 + .../web_server/handlers/email_template.go | 24 + .../handlers/exam_prep_assessment_handler.go | 40 +- .../exam_prep_catalog_course_handler.go | 32 + .../handlers/exam_prep_lesson_handler.go | 56 + .../handlers/exam_prep_module_handler.go | 55 + .../handlers/exam_prep_practice_handler.go | 89 + .../handlers/exam_prep_unit_handler.go | 45 + internal/web_server/handlers/faq.go | 16 + internal/web_server/handlers/field_option.go | 21 + internal/web_server/handlers/file_handler.go | 47 + .../web_server/handlers/issue_reporting.go | 27 +- .../handlers/lms_persona_handler.go | 36 + .../handlers/lms_progress_handler.go | 7 +- .../handlers/mobile_app_version_handler.go | 20 +- internal/web_server/handlers/mongoLogger.go | 3 + .../handlers/notification_handler.go | 212 +- .../web_server/handlers/payments_admin.go | 11 + .../handlers/practice_full_update_handler.go | 8 + .../handlers/question_type_builder.go | 52 + internal/web_server/handlers/questions.go | 73 + internal/web_server/handlers/ratings.go | 18 + internal/web_server/handlers/rbac_handler.go | 40 +- .../web_server/handlers/referal_handlers.go | 124 +- .../web_server/handlers/settings_handler.go | 37 +- .../handlers/subscription_checkout_link.go | 4 + internal/web_server/handlers/subscriptions.go | 49 +- .../handlers/swagger_admin_shared.go | 69 + .../handlers/swagger_referral_models.go | 68 + internal/web_server/handlers/team_handler.go | 25 +- .../handlers/team_invitation_handler.go | 17 + internal/web_server/handlers/user.go | 54 +- .../handlers/video_engagement_handler.go | 3 + internal/web_server/handlers/vimeo.go | 33 +- internal/web_server/swagger_contract_test.go | 333 + makefile | 4 + 53 files changed, 25747 insertions(+), 856 deletions(-) create mode 100644 internal/web_server/handlers/swagger_admin_shared.go create mode 100644 internal/web_server/handlers/swagger_referral_models.go create mode 100644 internal/web_server/swagger_contract_test.go diff --git a/cmd/main.go b/cmd/main.go index 54c6c1b4..9aef91d5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -62,13 +62,8 @@ import ( // @title Rezina API // @version 1.0.1 -// @description This is server for Rezina. -// @termsOfService http://swagger.io/terms/ +// @description Rezina LMS API. Admin panel endpoints use /api/v1/admin; customer web and mobile endpoints retain /api/v1. Use the audience-specific Swagger pages to browse each API. For protected endpoints, enter Bearer followed by a space and the access token in Authorize. // @contact.name API Support -// @contact.url http://www.swagger.io/support -// @contact.email support@swagger.io -// @license.name Apache 2.0 -// @license.url http://www.apache.org/licenses/LICENSE-2.0.html // @SecurityDefinitions.apiKey Bearer // @in header // @name Authorization diff --git a/docs/api-audiences.md b/docs/api-audiences.md index 8259de2b..e3a3b888 100644 --- a/docs/api-audiences.md +++ b/docs/api-audiences.md @@ -72,3 +72,20 @@ endpoints are not exposed. Run `go test ./...` in the backend and `npm run build` in the admin and checkout repositories. Notification SQL isolation can be checked with `node db/tests/notification-audiences.test.cjs`, using the scratch PGlite setup and `REFERRAL_TEST_PACKAGE_JSON` described in `referral-system.md`. + +## Swagger maintenance + +Run `make swagger` (or `swag init -g cmd/main.go`) after changing handler annotations. Commit +`docs/docs.go`, `docs/swagger.json`, and `docs/swagger.yaml` together. Documentation-only operations in +`swagger_admin_shared.go` distinguish staff-only reads from public customer operations that share a handler; +they are not registered as runtime handlers. Referral request and response models include decimal-string +amounts, percentage limits, nullable reversals, and pagination bounds. + +Run `go test ./internal/web_server -run 'TestSwagger|TestGeneratedSwagger|TestAudienceSpecifications'` +to check every registered API method/path, path parameters, request-body coverage, authorization, +WebSocket query-token authentication, referenced schemas, and generated artifact consistency. +The admin and customer Swagger pages prune unrelated paths and models. Their Authorize dialogs expect +`Bearer `; WebSockets instead use the documented `token` query parameter. +Authentication/authorization middleware may return plain-text errors, while application handlers also +return the JSON error shapes documented for their operations. Payment webhook authentication uses the +provider signature headers, not a customer Bearer token. diff --git a/docs/docs.go b/docs/docs.go index f8048f80..1c1547b5 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -9,15 +9,8 @@ const docTemplate = `{ "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", - "termsOfService": "http://swagger.io/terms/", "contact": { - "name": "API Support", - "url": "http://www.swagger.io/support", - "email": "support@swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + "name": "API Support" }, "version": "{{.Version}}" }, @@ -26,6 +19,11 @@ const docTemplate = `{ "paths": { "/api/v1/admin/activity-logs": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a filtered, paginated list of activity logs", "produces": [ "application/json" @@ -84,6 +82,12 @@ const docTemplate = `{ "description": "Offset", "name": "offset", "in": "query" + }, + { + "type": "string", + "description": "Search", + "name": "search", + "in": "query" } ], "responses": { @@ -99,6 +103,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -110,18 +126,54 @@ const docTemplate = `{ }, "/api/v1/admin/activity-logs/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "activity-logs" ], "summary": "Export activity logs as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/activity-logs/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single activity log entry by its ID", "produces": [ "application/json" @@ -152,6 +204,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -163,6 +227,11 @@ const docTemplate = `{ }, "/api/v1/admin/admins": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get all Admins", "consumes": [ "application/json" @@ -171,7 +240,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Get all Admins", "parameters": [ @@ -186,6 +255,30 @@ const docTemplate = `{ "description": "Page size", "name": "page_size", "in": "query" + }, + { + "type": "string", + "description": "Query", + "name": "query", + "in": "query" + }, + { + "type": "string", + "description": "Created before", + "name": "created_before", + "in": "query" + }, + { + "type": "string", + "description": "Created after", + "name": "created_after", + "in": "query" + }, + { + "type": "integer", + "description": "Company id", + "name": "company_id", + "in": "query" } ], "responses": { @@ -207,6 +300,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -216,6 +315,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Create Admin", "consumes": [ "application/json" @@ -224,7 +328,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Create Admin", "parameters": [ @@ -257,6 +361,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -281,7 +391,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Bulk deactivate accounts by role (SUPER_ADMIN or ADMIN platform users only)", "parameters": [ @@ -314,6 +424,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -350,7 +466,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Bulk reactivate accounts by role (SUPER_ADMIN or ADMIN platform users only)", "parameters": [ @@ -383,6 +499,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -406,6 +528,11 @@ const docTemplate = `{ }, "/api/v1/admin/admins/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get a single admin by id", "consumes": [ "application/json" @@ -414,7 +541,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Get admin by id", "parameters": [ @@ -445,6 +572,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -454,6 +587,11 @@ const docTemplate = `{ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Update Admin", "consumes": [ "application/json" @@ -462,7 +600,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Update Admin", "parameters": [ @@ -474,6 +612,14 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/handlers.updateAdminReq" } + }, + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true } ], "responses": { @@ -495,6 +641,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -506,6 +658,11 @@ const docTemplate = `{ }, "/api/v1/admin/analytics/dashboard": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Platform analytics with optional date filters in Africa/Addis_Ababa (EAT): all-time (default), year, year+month, or custom from/to range. When year is set, payments.revenue_monthly returns Jan–Dec SUCCESS revenue totals (EAT) per currency for that calendar year. Optional payment_method filters payment/revenue metrics (exact or METHOD:% variants). Daily series remains in revenue_last_30_days (see date_filter.series_*). Courses section counts LMS + exam_prep inventory.", "produces": [ "application/json" @@ -559,6 +716,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -621,6 +790,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -669,6 +850,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -714,6 +907,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -775,6 +980,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -824,6 +1041,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -882,6 +1111,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -934,6 +1169,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -950,11 +1191,59 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "RegisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Register Device Token", + "parameters": [ + { + "description": "Device token and platform", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.RegisterDeviceToken.Request" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/devices/unregister": { @@ -964,15 +1253,68 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "UnregisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Unregister Device Token", + "parameters": [ + { + "description": "Device token to unregister", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.UnregisterDeviceToken.Request" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/email-templates": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns email templates for admin management", "produces": [ "application/json" @@ -1020,6 +1362,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -1029,6 +1383,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new custom email template", "consumes": [ "application/json" @@ -1064,6 +1423,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -1075,6 +1446,11 @@ const docTemplate = `{ }, "/api/v1/admin/email-templates/slug/{slug}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns one email template by slug regardless of status", "produces": [ "application/json" @@ -1105,6 +1481,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1122,6 +1510,11 @@ const docTemplate = `{ }, "/api/v1/admin/email-templates/slug/{slug}/preview": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Renders an email template with sample variables without sending", "consumes": [ "application/json" @@ -1164,6 +1557,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1181,6 +1586,11 @@ const docTemplate = `{ }, "/api/v1/admin/email-templates/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns one email template regardless of status", "produces": [ "application/json" @@ -1211,6 +1621,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1226,6 +1648,11 @@ const docTemplate = `{ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates an existing email template", "consumes": [ "application/json" @@ -1268,6 +1695,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1283,6 +1722,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a custom email template", "produces": [ "application/json" @@ -1313,6 +1757,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1330,6 +1786,11 @@ const docTemplate = `{ }, "/api/v1/admin/email-templates/{id}/preview": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Renders an email template with sample variables without sending", "consumes": [ "application/json" @@ -1372,6 +1833,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1394,11 +1867,39 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "ListExamPrepAssessments", - "responses": {} + "tags": [ + "exam-prep" + ], + "summary": "List Exam Prep Assessments", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } }, "post": { "security": [ @@ -1406,11 +1907,53 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "consumes": [ + "application/json" ], - "summary": "LinkExamPrepAssessment", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "exam-prep" + ], + "summary": "Link Exam Prep Assessment", + "parameters": [ + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.LinkExamPrepAssessmentInput" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/exam-prep/assessments/{questionSetId}/parents/{parentKind}/{parentId}": { @@ -1420,15 +1963,85 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "UnlinkExamPrepAssessment", - "responses": {} + "tags": [ + "exam-prep" + ], + "summary": "Unlink Exam Prep Assessment", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Parent id", + "name": "parentId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Parent kind", + "name": "parentKind", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Question set id", + "name": "questionSetId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/catalog-courses": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -1458,10 +2071,33 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Top-level exam track (DET, IELTS, …) in schema exam_prep — separate from LMS programs/courses", "consumes": [ "application/json" @@ -1496,12 +2132,35 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/catalog-courses/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -1529,12 +2188,44 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1560,9 +2251,48 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1585,11 +2315,50 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/units": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1623,10 +2392,45 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Unit under a catalog course (e.g. chapter title). Optional sort_order assigns position within that catalog course (siblings at or after that index are shifted); omit to append after the current highest sort_order in the catalog course.", "consumes": [ "application/json" @@ -1662,12 +2466,50 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/units/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1690,11 +2532,53 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/catalog-courses/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -1717,10 +2601,45 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -1755,10 +2674,48 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1778,35 +2735,250 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/lessons/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep lesson by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Update exam-prep lesson", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdateExamPrepLessonInput" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Delete exam-prep lesson", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/lessons/{lessonId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1832,34 +3004,250 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/modules/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep module by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Update exam-prep module", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdateExamPrepModuleInput" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Delete exam-prep module", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/modules/{moduleId}/lessons": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1887,9 +3275,54 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1912,20 +3345,132 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/modules/{moduleId}/lessons/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Reorder lessons within an exam-prep unit module", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Module id", + "name": "moduleId", + "in": "path", + "required": true + }, + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.ReorderIDsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1950,9 +3495,48 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1968,11 +3552,50 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1986,9 +3609,54 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2011,9 +3679,54 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2027,11 +3740,53 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices/{id}/full": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns exam-prep practice metadata, linked question set settings, and all questions in the set.", "produces": [ "application/json" @@ -2062,15 +3817,38 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates exam-prep practice metadata, linked question set settings, and syncs questions in one request.", "consumes": [ "application/json" @@ -2113,17 +3891,43 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/practices/{id}/parents": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2146,11 +3950,56 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices/{id}/parents/{parentKind}/{parentId}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2178,11 +4027,56 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2196,9 +4090,54 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2221,9 +4160,54 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2237,11 +4221,56 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{unitId}/modules": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2253,11 +4282,71 @@ const docTemplate = `{ "name": "unitId", "in": "path", "required": true + }, + { + "type": "integer", + "default": 20, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2280,11 +4369,56 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{unitId}/modules/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2307,11 +4441,56 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{unitId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2337,9 +4516,48 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2362,11 +4580,47 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/faqs": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns FAQs for admin management with status/category filtering", "produces": [ "application/json" @@ -2414,6 +4668,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -2423,6 +4689,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new FAQ item", "consumes": [ "application/json" @@ -2458,6 +4729,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -2469,6 +4752,11 @@ const docTemplate = `{ }, "/api/v1/admin/faqs/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns one FAQ regardless of status", "produces": [ "application/json" @@ -2499,6 +4787,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -2514,6 +4814,11 @@ const docTemplate = `{ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates an existing FAQ item", "consumes": [ "application/json" @@ -2556,6 +4861,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -2571,6 +4888,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes an FAQ item", "produces": [ "application/json" @@ -2601,6 +4923,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -2618,6 +4952,11 @@ const docTemplate = `{ }, "/api/v1/admin/field-options": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -2657,10 +4996,27 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -2688,12 +5044,35 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/field-options/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -2716,10 +5095,33 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -2754,10 +5156,33 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -2780,15 +5205,53 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/audio": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -2808,12 +5271,47 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/complete-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Call after PUT upload to upload_url. Returns the same file metadata shape as POST /files/upload.", "consumes": [ "application/json" @@ -2842,12 +5340,53 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/presign-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a short-lived PUT URL and object key. Upload the file with HTTP PUT to upload_url using the same Content-Type, then call POST /files/complete-upload.", "consumes": [ "application/json" @@ -2876,12 +5415,47 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/refresh-url": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -2909,15 +5483,53 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -2944,12 +5556,50 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/url": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -2969,6 +5619,36 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -3009,6 +5689,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3068,6 +5760,18 @@ const docTemplate = `{ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3140,6 +5844,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3198,6 +5914,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -3242,6 +5970,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3300,6 +6040,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3311,6 +6063,11 @@ const docTemplate = `{ }, "/api/v1/admin/logs": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Fetches application logs from MongoDB with pagination, level filtering, and search", "produces": [ "application/json" @@ -3360,6 +6117,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Staff account and logs.list permission required", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal server error", "schema": { @@ -3376,11 +6145,62 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "GetUserNotification", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Get User Notification", + "parameters": [ + { + "type": "integer", + "default": 10, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } }, "delete": { "security": [ @@ -3388,11 +6208,39 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "DeleteUserNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Delete User Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/all": { @@ -3402,15 +6250,106 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "GetAllNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Get All Notifications", + "parameters": [ + { + "type": "integer", + "default": 10, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "Page", + "name": "page", + "in": "query" + }, + { + "type": "string", + "description": "Channel", + "name": "channel", + "in": "query" + }, + { + "type": "string", + "description": "Type", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "User id", + "name": "user_id", + "in": "query" + }, + { + "type": "boolean", + "description": "Is read", + "name": "is_read", + "in": "query" + }, + { + "type": "string", + "description": "After", + "name": "after", + "in": "query" + }, + { + "type": "string", + "description": "Before", + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/notifications/bulk-email": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an email to specified user IDs, users of a platform role, team member IDs, team members of a team_role, or direct email addresses with optional image attachment. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "multipart/form-data" @@ -3422,6 +6361,80 @@ const docTemplate = `{ "notifications" ], "summary": "Send bulk email", + "parameters": [ + { + "type": "string", + "description": "Saved template slug; otherwise subject and message or html are required", + "name": "email_template_slug", + "in": "formData" + }, + { + "type": "string", + "description": "JSON object of template variables", + "name": "template_variables", + "in": "formData" + }, + { + "type": "string", + "description": "Subject, required when no template is selected", + "name": "subject", + "in": "formData" + }, + { + "type": "string", + "description": "Plain-text body, required without a template unless html is supplied", + "name": "message", + "in": "formData" + }, + { + "type": "string", + "description": "HTML body alternative to message", + "name": "html", + "in": "formData" + }, + { + "type": "file", + "description": "Optional attachment", + "name": "file", + "in": "formData" + }, + { + "type": "string", + "description": "Comma-separated direct email addresses", + "name": "emails", + "in": "formData" + }, + { + "type": "string", + "description": "Comma-separated customer IDs", + "name": "user_ids", + "in": "formData" + }, + { + "type": "string", + "description": "Customer role used to select recipients", + "name": "role", + "in": "formData" + }, + { + "type": "string", + "description": "Comma-separated team-member IDs", + "name": "team_member_ids", + "in": "formData" + }, + { + "type": "string", + "description": "Team role used to select recipients", + "name": "team_role", + "in": "formData" + }, + { + "type": "string", + "description": "Optional future delivery time in RFC3339 format", + "name": "scheduled_at", + "in": "formData" + } + ], "responses": { "200": { "description": "OK", @@ -3429,12 +6442,30 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3446,6 +6477,11 @@ const docTemplate = `{ }, "/api/v1/admin/notifications/bulk-in-app": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates in-app notifications for specified platform user IDs, users matching a platform role, team member IDs, or team members matching a team_role. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" @@ -3512,12 +6548,30 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3529,6 +6583,11 @@ const docTemplate = `{ }, "/api/v1/admin/notifications/bulk-push": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends a push notification to specified user IDs or all users matching a role. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" @@ -3582,12 +6641,30 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3599,6 +6676,11 @@ const docTemplate = `{ }, "/api/v1/admin/notifications/bulk-sms": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an SMS to specified user IDs, all users of a role, or direct phone numbers. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" @@ -3652,12 +6734,30 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3674,15 +6774,68 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "consumes": [ + "application/json" ], - "summary": "CreateAndSendNotification", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "notifications" + ], + "summary": "Create And Send Notification", + "parameters": [ + { + "description": "Notification recipient and delivery settings", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.CreateAndSendNotification.Request" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/handlers.NotificationDispatchResponse" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/notifications/delete-in-app": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes in-app notifications by ID for the authenticated user. Non-matching IDs are ignored.", "consumes": [ "application/json" @@ -3718,6 +6871,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3734,11 +6899,39 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Read", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/mark-all-unread": { @@ -3748,15 +6941,48 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Unread", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/scheduled": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated scheduled notifications with optional status, channel, and date filters", "produces": [ "application/json" @@ -3818,6 +7044,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3829,6 +7067,11 @@ const docTemplate = `{ }, "/api/v1/admin/notifications/scheduled/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single scheduled notification by its ID", "produces": [ "application/json" @@ -3859,6 +7102,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3870,6 +7125,11 @@ const docTemplate = `{ }, "/api/v1/admin/notifications/scheduled/{id}/cancel": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Cancels a scheduled notification if it is still pending or processing", "produces": [ "application/json" @@ -3900,6 +7160,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3911,6 +7183,11 @@ const docTemplate = `{ }, "/api/v1/admin/notifications/send-email": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an email to a single email address with optional image attachment", "consumes": [ "multipart/form-data" @@ -3922,6 +7199,51 @@ const docTemplate = `{ "notifications" ], "summary": "Send single email", + "parameters": [ + { + "type": "string", + "description": "Saved template slug; otherwise subject and message or html are required", + "name": "email_template_slug", + "in": "formData" + }, + { + "type": "string", + "description": "JSON object of template variables", + "name": "template_variables", + "in": "formData" + }, + { + "type": "string", + "description": "Subject, required when no template is selected", + "name": "subject", + "in": "formData" + }, + { + "type": "string", + "description": "Plain-text body, required without a template unless html is supplied", + "name": "message", + "in": "formData" + }, + { + "type": "string", + "description": "HTML body alternative to message", + "name": "html", + "in": "formData" + }, + { + "type": "file", + "description": "Optional attachment", + "name": "file", + "in": "formData" + }, + { + "type": "string", + "description": "Recipient email address", + "name": "recipient", + "in": "formData", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -3935,6 +7257,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3946,6 +7280,11 @@ const docTemplate = `{ }, "/api/v1/admin/notifications/test-push": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends a test push notification to all registered devices of the current user", "consumes": [ "application/json" @@ -3995,6 +7334,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4011,15 +7356,48 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "CountUnreadNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Count Unread Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/notifications/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single in-app notification. Users may only fetch their own notifications unless they have list-all access.", "produces": [ "application/json" @@ -4050,6 +7428,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -4071,6 +7455,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes one in-app notification owned by the authenticated user.", "produces": [ "application/json" @@ -4101,6 +7490,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -4123,11 +7524,55 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Read", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/{id}/unread": { @@ -4137,15 +7582,64 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Unread", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/payments": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated payments across Chapa and ArifPay with optional filters", "produces": [ "application/json" @@ -4272,24 +7766,78 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/payments/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "payments" ], "summary": "Export payments as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/payments/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns any payment record by ID without learner ownership restriction", "produces": [ "application/json" @@ -4305,6 +7853,21 @@ const docTemplate = `{ "name": "id", "in": "path", "required": true + }, + { + "type": "integer", + "default": 20, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" } ], "responses": { @@ -4314,17 +7877,49 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/personas": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4350,12 +7945,51 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4377,12 +8011,44 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/personas/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4396,9 +8062,54 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4421,9 +8132,54 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4437,11 +8193,47 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/question-sets": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a paginated list of question sets filtered by type", "produces": [ "application/json" @@ -4486,6 +8278,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4495,6 +8299,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new question set (practice, assessment, quiz, exam, or survey)", "consumes": [ "application/json" @@ -4530,6 +8339,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4541,6 +8362,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/by-owner": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns question sets for a specific owner (e.g., sub-course)", "produces": [ "application/json" @@ -4578,6 +8404,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4589,6 +8427,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a question set with question count", "produces": [ "application/json" @@ -4619,6 +8462,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -4628,6 +8483,11 @@ const docTemplate = `{ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a question set's properties", "consumes": [ "application/json" @@ -4670,6 +8530,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4679,6 +8557,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Archives a question set (soft delete)", "produces": [ "application/json" @@ -4709,6 +8592,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4720,6 +8615,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/{setId}/personas": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all users assigned as personas to a question set (practice)", "produces": [ "application/json" @@ -4750,6 +8650,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4759,6 +8671,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Links a user as a persona to a question set (practice)", "consumes": [ "application/json" @@ -4801,6 +8718,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4812,6 +8741,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/{setId}/personas/{userId}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Unlinks a user as persona from a question set (practice)", "produces": [ "application/json" @@ -4849,6 +8783,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4860,6 +8806,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/{setId}/question-types": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns distinct question type definitions (key, display_name, counts) for non-archived questions in the set. Legacy stored question_type values (e.g. AUDIO) are resolved to builder definitions when possible.", "produces": [ "application/json" @@ -4890,6 +8841,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -4907,6 +8870,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/{setId}/questions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all questions in a question set with contextual shared stimulus data for linked LMS and exam-prep practices", "produces": [ "application/json" @@ -4937,6 +8905,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4946,6 +8932,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Links a question to a question set. Omit display_order to append after the current max; the assigned value is returned in the response.", "consumes": [ "application/json" @@ -4988,6 +8979,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4999,6 +9002,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/{setId}/questions/{questionId}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Unlinks a question from a question set", "produces": [ "application/json" @@ -5036,6 +9044,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5047,6 +9067,11 @@ const docTemplate = `{ }, "/api/v1/admin/question-sets/{setId}/questions/{questionId}/order": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates the display order of a question in a set", "consumes": [ "application/json" @@ -5096,6 +9121,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5107,6 +9144,11 @@ const docTemplate = `{ }, "/api/v1/admin/questions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a paginated list of questions with optional filters", "produces": [ "application/json" @@ -5162,6 +9204,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5171,6 +9225,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new question with options (for MCQ/TRUE_FALSE) or short answers (for SHORT_ANSWER). DYNAMIC questions must not send question_text; use dynamic_payload stimulus instead. Legacy types require question_text.", "consumes": [ "application/json" @@ -5206,6 +9265,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5217,6 +9288,11 @@ const docTemplate = `{ }, "/api/v1/admin/questions/component-catalog": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Valid stimulus and response component kind codes for dynamic question-type definitions", "produces": [ "application/json" @@ -5231,12 +9307,29 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/questions/search": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Search questions by text", "produces": [ "application/json" @@ -5281,6 +9374,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5292,6 +9397,11 @@ const docTemplate = `{ }, "/api/v1/admin/questions/type-definition-groups": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5327,10 +9437,39 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -5358,12 +9497,35 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/questions/type-definition-groups/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5387,15 +9549,44 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -5430,10 +9621,39 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5456,12 +9676,41 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/questions/type-definitions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5511,6 +9760,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5520,6 +9787,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Stores a reusable dynamic question-type definition for future question construction. Only runtime-mappable definitions are persisted.", "consumes": [ "application/json" @@ -5555,6 +9827,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5566,6 +9856,11 @@ const docTemplate = `{ }, "/api/v1/admin/questions/type-definitions/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5595,6 +9890,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -5604,6 +9911,11 @@ const docTemplate = `{ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a reusable dynamic question-type definition. Updated definitions must remain runtime-mappable.", "consumes": [ "application/json" @@ -5646,6 +9958,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5655,6 +9985,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5684,6 +10019,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5695,6 +10042,11 @@ const docTemplate = `{ }, "/api/v1/admin/questions/type-definitions/{id}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns LMS and exam-prep practices whose linked question set contains at least one non-archived question matching the definition (by question_type_definition_id or legacy question_type).", "produces": [ "application/json" @@ -5739,17 +10091,40 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/questions/validate-question-type-definition": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Validates selected stimulus and response component kinds for temporary question-type definitions (component-level validation only)", "consumes": [ "application/json" @@ -5784,12 +10159,29 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/questions/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a question with its options/short answers", "produces": [ "application/json" @@ -5820,15 +10212,38 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a question and optionally replaces its options/short answers. Supports question_type_definition_id for dynamic builder-linked questions.", "consumes": [ "application/json" @@ -5871,6 +10286,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5880,6 +10313,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Archives a question (soft delete)", "produces": [ "application/json" @@ -5910,6 +10348,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5921,6 +10371,11 @@ const docTemplate = `{ }, "/api/v1/admin/ratings": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated ratings for a specific target", "produces": [ "application/json" @@ -5970,6 +10425,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5981,6 +10448,11 @@ const docTemplate = `{ }, "/api/v1/admin/ratings/summary": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the total count and average stars for a specific target", "produces": [ "application/json" @@ -6018,6 +10490,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6029,6 +10513,11 @@ const docTemplate = `{ }, "/api/v1/admin/ratings/{id}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a rating by ID for the current user", "produces": [ "application/json" @@ -6059,6 +10548,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6108,6 +10609,18 @@ const docTemplate = `{ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6157,6 +10670,18 @@ const docTemplate = `{ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6191,6 +10716,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6251,6 +10788,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6312,6 +10861,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6373,6 +10934,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -6435,6 +11008,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6482,6 +11067,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6546,6 +11143,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6602,6 +11211,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6618,11 +11239,52 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "description": "Returns the saved referral commission percentage. Restricted to ADMIN and SUPER_ADMIN. The initial percentage is 0, which disables new credits.", + "produces": [ + "application/json" ], - "summary": "GetReferralSettings", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get Referral Settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralSettingsData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } }, "put": { "security": [ @@ -6630,15 +11292,81 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "description": "Sets the percentage credited on a referred learner's first successful positive subscription payment. Accepts 0 through 100 with at most two decimal places. Zero disables new credits. Changes affect future conversions only; existing credits retain their rate. Restricted to ADMIN and SUPER_ADMIN; changes are audited.", + "consumes": [ + "application/json" ], - "summary": "UpdateReferralSettings", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "referrals" + ], + "summary": "Update Referral Settings", + "parameters": [ + { + "description": "Commission percentage configuration", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.updateReferralSettingsReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralSettingsData" + } + } + } + ] + } + }, + "400": { + "description": "Missing or invalid commission_percent; use 0 through 100 with at most two decimal places", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/sendSMS": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an SMS message to a single phone number using AfroMessage", "consumes": [ "application/json" @@ -6674,6 +11402,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6690,11 +11430,39 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "GetGlobalSettingList", - "responses": {} + "tags": [ + "settings" + ], + "summary": "Get Global Setting List", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } }, "put": { "security": [ @@ -6702,11 +11470,59 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "consumes": [ + "application/json" ], - "summary": "UpdateGlobalSettingList", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "settings" + ], + "summary": "Update Global Setting List", + "parameters": [ + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.SaveSettingListReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/settings/{key}": { @@ -6716,15 +11532,57 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "GetGlobalSettingByKey", - "responses": {} + "tags": [ + "settings" + ], + "summary": "Get Global Setting By Key", + "parameters": [ + { + "type": "string", + "description": "Key", + "name": "key", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/subscription-plans": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns subscription plans. Optional category filter: EDUCATION.", "produces": [ "application/json" @@ -6760,6 +11618,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6769,6 +11639,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new subscription plan (admin only)", "consumes": [ "application/json" @@ -6804,6 +11679,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "409": { + "description": "Resource conflict", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6815,6 +11708,11 @@ const docTemplate = `{ }, "/api/v1/admin/subscription-plans/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single subscription plan by ID", "produces": [ "application/json" @@ -6839,6 +11737,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -6848,6 +11758,11 @@ const docTemplate = `{ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a subscription plan (admin only)", "consumes": [ "application/json" @@ -6890,6 +11805,30 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "409": { + "description": "Resource conflict", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6899,6 +11838,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a subscription plan (admin only)", "produces": [ "application/json" @@ -6923,6 +11867,36 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "409": { + "description": "Resource conflict", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6934,14 +11908,45 @@ const docTemplate = `{ }, "/api/v1/admin/subscriptions/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "subscriptions" ], "summary": "Export user subscriptions as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/subscriptions/{id}/cancel": { @@ -6981,6 +11986,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -6998,6 +12015,11 @@ const docTemplate = `{ }, "/api/v1/admin/team/invitations": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Lists team member invitations with optional status filter", "produces": [ "application/json" @@ -7032,6 +12054,24 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } @@ -7066,6 +12106,12 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -7095,12 +12141,29 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/team/invitations/{id}/revoke": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Revokes the invitation and removes the pending team member if not yet accepted", "produces": [ "application/json" @@ -7124,6 +12187,24 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } @@ -7241,6 +12322,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7314,6 +12401,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7506,18 +12599,54 @@ const docTemplate = `{ }, "/api/v1/admin/team/members/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "team" ], "summary": "Export team members as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/team/members/invite": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a pending team member (email + team_role only) and sends an invitation email; profile is completed on accept", "consumes": [ "application/json" @@ -7553,6 +12682,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -7620,6 +12761,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7829,6 +12976,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7846,6 +12999,11 @@ const docTemplate = `{ }, "/api/v1/admin/team/members/{id}/resend-invite": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Revokes the current pending invite and sends a new invitation email", "produces": [ "application/json" @@ -7876,6 +13034,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -8016,6 +13186,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8254,6 +13430,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8265,6 +13453,11 @@ const docTemplate = `{ }, "/api/v1/admin/user/delete/{id}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Delete a user by their ID", "consumes": [ "application/json" @@ -8298,6 +13491,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8309,6 +13514,11 @@ const docTemplate = `{ }, "/api/v1/admin/user/search": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Search for user using name or phone", "consumes": [ "application/json" @@ -8344,6 +13554,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8355,6 +13577,11 @@ const docTemplate = `{ }, "/api/v1/admin/user/single/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get a single user by id", "consumes": [ "application/json" @@ -8394,6 +13621,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8405,6 +13638,11 @@ const docTemplate = `{ }, "/api/v1/admin/user/status": { "patch": { + "security": [ + { + "Bearer": [] + } + ], "description": "Activates, deactivates, or suspends a user account", "consumes": [ "application/json" @@ -8440,6 +13678,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8496,6 +13746,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8507,6 +13769,11 @@ const docTemplate = `{ }, "/api/v1/admin/users": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get users with optional filters. Each user includes subscription_status: ACTIVE, PENDING, or Unsubscribed.", "consumes": [ "application/json" @@ -8593,6 +13860,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8604,6 +13883,11 @@ const docTemplate = `{ }, "/api/v1/admin/users/deletion-requests": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns account deletion requests for admin panel tracking with filtering and pagination", "consumes": [ "application/json" @@ -8690,6 +13974,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8701,14 +13997,45 @@ const docTemplate = `{ }, "/api/v1/admin/users/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "user" ], "summary": "Export users as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/users/summary": { @@ -8748,6 +14075,18 @@ const docTemplate = `{ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8818,6 +14157,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -8882,6 +14233,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -8946,6 +14309,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -9016,6 +14391,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -9033,6 +14420,11 @@ const docTemplate = `{ }, "/api/v1/admin/vimeo/oembed": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Fetches oEmbed metadata for a Vimeo video URL", "consumes": [ "application/json" @@ -9078,6 +14470,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9089,6 +14493,11 @@ const docTemplate = `{ }, "/api/v1/admin/vimeo/sample": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Fetches a sample video from Vimeo and returns video details along with an embeddable iframe for client-side integration", "consumes": [ "application/json" @@ -9130,6 +14539,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9141,6 +14562,11 @@ const docTemplate = `{ }, "/api/v1/admin/vimeo/uploads/pull": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Initiates a pull upload where Vimeo fetches the video from a URL", "consumes": [ "application/json" @@ -9176,17 +14602,40 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/uploads/tus": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Initiates a TUS resumable upload and returns the upload link", "consumes": [ "application/json" @@ -9222,17 +14671,40 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/videos": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a paginated list of videos for the Vimeo API token (GET https://api.vimeo.com/me/videos)", "consumes": [ "application/json" @@ -9315,6 +14787,18 @@ const docTemplate = `{ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9332,6 +14816,11 @@ const docTemplate = `{ }, "/api/v1/admin/vimeo/videos/{video_id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Retrieves video details from Vimeo by video ID", "consumes": [ "application/json" @@ -9365,15 +14854,38 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a video from the Vimeo account", "consumes": [ "application/json" @@ -9395,8 +14907,11 @@ const docTemplate = `{ } ], "responses": { - "204": { - "description": "No Content" + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } }, "400": { "description": "Bad Request", @@ -9404,17 +14919,40 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/videos/{video_id}/embed": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Generates an embeddable player iframe for the video", "consumes": [ "application/json" @@ -9486,17 +15024,40 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/videos/{video_id}/status": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the current transcoding status of a video", "consumes": [ "application/json" @@ -9533,11 +15094,29 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -9545,9 +15124,9 @@ const docTemplate = `{ "/api/v1/admin/ws/connect": { "get": { "tags": [ - "client" + "ws" ], - "summary": "ConnectSocket", + "summary": "Connect Socket", "parameters": [ { "type": "string", @@ -9557,7 +15136,20 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "101": { + "description": "WebSocket protocol upgrade; subsequent messages are notification events", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/app/version/check": { @@ -9632,7 +15224,38 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/customer-login": { @@ -9678,6 +15301,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9689,6 +15318,9 @@ const docTemplate = `{ }, "/api/v1/auth/google/android": { "post": { + "produces": [ + "application/json" + ], "tags": [ "auth" ], @@ -9704,29 +15336,111 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/google/callback": { "get": { + "produces": [ + "application/json" + ], "tags": [ "auth" ], "summary": "Google login callback", - "responses": {} + "parameters": [ + { + "type": "string", + "description": "Code", + "name": "code", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/google/login": { "get": { + "produces": [ + "text/plain" + ], "tags": [ "auth" ], "summary": "Google login redirect", - "responses": {} + "responses": { + "302": { + "description": "Redirect to Google authorization URL; see Location header", + "schema": { + "type": "string" + } + }, + "503": { + "description": "Google OAuth is not configured", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/logout": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Logout user", "consumes": [ "application/json" @@ -9768,6 +15482,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9820,6 +15540,12 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9836,11 +15562,59 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "RegisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Register Device Token", + "parameters": [ + { + "description": "Device token and platform", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.RegisterDeviceToken.Request" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/devices/unregister": { @@ -9850,11 +15624,59 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "UnregisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Unregister Device Token", + "parameters": [ + { + "description": "Device token to unregister", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.UnregisterDeviceToken.Request" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/exam-prep/assessments": { @@ -9864,15 +15686,48 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "ListExamPrepAssessments", - "responses": {} + "tags": [ + "exam-prep" + ], + "summary": "List Exam Prep Assessments", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/exam-prep/catalog-courses": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -9902,12 +15757,38 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/exam-prep/catalog-courses/{catalogCourseId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -9933,11 +15814,50 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/catalog-courses/{catalogCourseId}/units": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -9971,12 +15891,47 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/exam-prep/catalog-courses/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -9999,21 +15954,114 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/exam-prep/lessons/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep lesson by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/lessons/{lessonId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10039,20 +16087,114 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/modules/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep module by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/modules/{moduleId}/lessons": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10080,11 +16222,56 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10109,11 +16296,50 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/practices/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10127,11 +16353,53 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/practices/{practiceId}/questions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated questions for an exam-prep practice, including shared stimulus blocks and each question's effective dynamic payload", "produces": [ "application/json" @@ -10182,6 +16450,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -10199,6 +16479,11 @@ const docTemplate = `{ }, "/api/v1/exam-prep/progress-summary": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns progress for the catalog course → unit → module → lesson learning hierarchy.", "produces": [ "application/json" @@ -10214,6 +16499,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10225,7 +16522,15 @@ const docTemplate = `{ }, "/api/v1/exam-prep/progress/practices/{id}/complete": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Marks a practice question set as completed for the authenticated learner in its exam-prep parent scope", + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], @@ -10240,6 +16545,26 @@ const docTemplate = `{ "name": "id", "in": "path", "required": true + }, + { + "description": "Optional practice parent scope", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/domain.CompletePracticeInput" + } + }, + { + "type": "string", + "description": "Parent kind", + "name": "parent_kind", + "in": "query" + }, + { + "type": "integer", + "description": "Parent id", + "name": "parent_id", + "in": "query" } ], "responses": { @@ -10255,6 +16580,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -10278,6 +16609,14 @@ const docTemplate = `{ }, "/api/v1/exam-prep/units/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10291,11 +16630,56 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/units/{unitId}/modules": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10307,13 +16691,73 @@ const docTemplate = `{ "name": "unitId", "in": "path", "required": true + }, + { + "type": "integer", + "default": 20, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/units/{unitId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10339,11 +16783,47 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/videos/engagement/heartbeat": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Records playback position for analytics (completion, replay, and drop-off). Send periodic heartbeats while watching; set ended=true when the viewer leaves. A new session starts after 30 minutes of inactivity or when ended=true on the prior session.", "consumes": [ "application/json" @@ -10391,6 +16871,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -10402,6 +16888,12 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -10495,6 +16987,12 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -10557,9 +17055,17 @@ const docTemplate = `{ }, "/api/v1/files/audio": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -10579,12 +17085,47 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/complete-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Call after PUT upload to upload_url. Returns the same file metadata shape as POST /files/upload.", "consumes": [ "application/json" @@ -10613,12 +17154,53 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/presign-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a short-lived PUT URL and object key. Upload the file with HTTP PUT to upload_url using the same Content-Type, then call POST /files/complete-upload.", "consumes": [ "application/json" @@ -10647,12 +17229,47 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/refresh-url": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -10680,15 +17297,53 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -10715,12 +17370,50 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/url": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -10740,6 +17433,36 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -10804,6 +17527,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10863,6 +17592,18 @@ const docTemplate = `{ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10879,11 +17620,62 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "GetUserNotification", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Get User Notification", + "parameters": [ + { + "type": "integer", + "default": 10, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } }, "delete": { "security": [ @@ -10891,15 +17683,48 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "DeleteUserNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Delete User Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/delete-in-app": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes in-app notifications by ID for the authenticated user. Non-matching IDs are ignored.", "consumes": [ "application/json" @@ -10935,6 +17760,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10951,11 +17788,39 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Read", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/mark-all-unread": { @@ -10965,11 +17830,39 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Unread", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/unread": { @@ -10979,15 +17872,48 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "CountUnreadNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Count Unread Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/notifications/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single in-app notification. Users may only fetch their own notifications unless they have list-all access.", "produces": [ "application/json" @@ -11018,6 +17944,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -11039,6 +17971,11 @@ const docTemplate = `{ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes one in-app notification owned by the authenticated user.", "produces": [ "application/json" @@ -11069,6 +18006,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11091,11 +18040,55 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Read", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/{id}/unread": { @@ -11105,15 +18098,64 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Unread", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/payments": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the authenticated user's payment history", "produces": [ "application/json" @@ -11144,6 +18186,24 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -11176,6 +18236,12 @@ const docTemplate = `{ "description": "Fallback payment nonce", "name": "nonce", "in": "query" + }, + { + "type": "string", + "description": "Sessionid", + "name": "sessionID", + "in": "query" } ], "responses": { @@ -11184,6 +18250,12 @@ const docTemplate = `{ "schema": { "type": "string" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -11216,6 +18288,12 @@ const docTemplate = `{ "description": "Payment status", "name": "status", "in": "query" + }, + { + "type": "string", + "description": "Tx ref", + "name": "tx_ref", + "in": "query" } ], "responses": { @@ -11224,12 +18302,29 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/payments/chapa/direct": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Starts a Chapa Direct Charge (USSD push or OTP) for a subscription plan without hosted checkout redirect.", "consumes": [ "application/json" @@ -11265,6 +18360,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11276,6 +18383,11 @@ const docTemplate = `{ }, "/api/v1/payments/chapa/direct/authorize": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Completes OTP authorization for Chapa direct charge methods that require it.", "consumes": [ "application/json" @@ -11311,6 +18423,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11382,12 +18506,23 @@ const docTemplate = `{ "schema": { "type": "string" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/payments/direct": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a payment session and initiates direct payment (OTP-based)", "consumes": [ "application/json" @@ -11423,6 +18558,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11454,6 +18601,11 @@ const docTemplate = `{ }, "/api/v1/payments/direct/verify-otp": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Verifies the OTP sent for direct payment methods (Amole, HelloCash, etc.)", "consumes": [ "application/json" @@ -11489,6 +18641,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11520,6 +18684,11 @@ const docTemplate = `{ }, "/api/v1/payments/subscribe": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a payment session for a subscription plan", "consumes": [ "application/json" @@ -11555,6 +18724,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11566,6 +18747,11 @@ const docTemplate = `{ }, "/api/v1/payments/verify/{session_id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Checks the payment status with the payment provider", "produces": [ "application/json" @@ -11596,6 +18782,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11609,6 +18807,7 @@ const docTemplate = `{ "post": { "description": "Processes payment notifications from Chapa (charge.success, etc.)", "consumes": [ + "application/json", "application/json" ], "produces": [ @@ -11618,6 +18817,29 @@ const docTemplate = `{ "payments" ], "summary": "Handle Chapa webhook", + "parameters": [ + { + "description": "Exact signed Chapa webhook payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.ChapaWebhookPayload" + } + }, + { + "type": "string", + "description": "Webhook HMAC signature. Alternatively send chapa-signature; one of these headers is required.", + "name": "x-chapa-signature", + "in": "header" + }, + { + "type": "string", + "description": "Alternative signature header", + "name": "chapa-signature", + "in": "header" + } + ], "responses": { "200": { "description": "OK", @@ -11630,12 +18852,29 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/payments/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns details of a specific payment", "produces": [ "application/json" @@ -11660,6 +18899,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11671,6 +18928,11 @@ const docTemplate = `{ }, "/api/v1/payments/{id}/cancel": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Cancels a payment that is still pending", "produces": [ "application/json" @@ -11700,12 +18962,32 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/personas": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -11731,11 +19013,50 @@ const docTemplate = `{ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/personas/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -11749,14 +19070,59 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/questions/audio-answer": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "questions" ], @@ -11790,12 +19156,47 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/ratings": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated ratings for a specific target", "produces": [ "application/json" @@ -11845,6 +19246,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11854,6 +19267,11 @@ const docTemplate = `{ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Submit a rating for an app, course, or sub-course", "consumes": [ "application/json" @@ -11889,6 +19307,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11900,6 +19330,11 @@ const docTemplate = `{ }, "/api/v1/ratings/me": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the current user's rating for a specific target", "produces": [ "application/json" @@ -11937,6 +19372,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11954,6 +19401,11 @@ const docTemplate = `{ }, "/api/v1/ratings/me/all": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all ratings submitted by the current user", "produces": [ "application/json" @@ -11969,6 +19421,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11980,6 +19444,11 @@ const docTemplate = `{ }, "/api/v1/ratings/summary": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the total count and average stars for a specific target", "produces": [ "application/json" @@ -12017,6 +19486,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12028,6 +19509,11 @@ const docTemplate = `{ }, "/api/v1/ratings/{id}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a rating by ID for the current user", "produces": [ "application/json" @@ -12058,6 +19544,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12074,11 +19572,77 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns only the authenticated learner's referral history and conversion flags. Referred learners' names, emails, and phone numbers are not exposed.", + "produces": [ + "application/json" ], - "summary": "ListMyReferrals", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "List My Referrals", + "parameters": [ + { + "maximum": 100, + "minimum": 1, + "type": "integer", + "default": 20, + "description": "Page size", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Number of entries to skip", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralHistoryData" + } + } + } + ] + } + }, + "400": { + "description": "Invalid pagination", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/apply": { @@ -12088,11 +19652,60 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "description": "Attributes the authenticated learner to one referrer. Apply within seven days of account creation and before any successful positive payment. Codes are case-insensitive and surrounding whitespace is ignored. Self referral, reassignment, inactive referrers, and invalid codes are rejected.", + "consumes": [ + "application/json" ], - "summary": "ApplyReferralCode", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "referrals" + ], + "summary": "Apply Referral Code", + "parameters": [ + { + "description": "Referral share code", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.applyReferralReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request or ineligible referral", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/code": { @@ -12102,18 +19715,105 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns the authenticated learner's stable share code, creating it when necessary. Codes are case-insensitive.", + "produces": [ + "application/json" ], - "summary": "GetReferralCode", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get Referral Code", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralCodeData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } }, "post": { - "tags": [ - "client" + "security": [ + { + "Bearer": [] + } ], - "summary": "CreateReferralCode", - "responses": {} + "description": "Creates or returns the authenticated learner's stable share code. Requires an active STUDENT or OPEN_LEARNER account; a subscription is not required.", + "produces": [ + "application/json" + ], + "tags": [ + "referrals" + ], + "summary": "Create Referral Code", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralCodeData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/me": { @@ -12123,11 +19823,52 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns the learner's code, current commission percentage, referral/conversion counts, and commission-wallet balances by currency.", + "produces": [ + "application/json" ], - "summary": "GetMyReferrals", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get My Referrals", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralOverviewData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/wallet": { @@ -12137,11 +19878,77 @@ const docTemplate = `{ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns wallet balances separately by currency and a paginated commission ledger. Decimal amounts and percentages are strings. Only the first successful positive subscription payment earns a commission; duplicate callbacks and renewals do not. Reversed credits are excluded from balances. This endpoint does not initiate cash payouts.", + "produces": [ + "application/json" ], - "summary": "GetReferralWallet", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get Referral Wallet", + "parameters": [ + { + "maximum": 100, + "minimum": 1, + "type": "integer", + "default": 20, + "description": "Page size", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Number of entries to skip", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralWalletData" + } + } + } + ] + } + }, + "400": { + "description": "Invalid pagination", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/subscription-plans": { @@ -12157,7 +19964,8 @@ const docTemplate = `{ "parameters": [ { "type": "boolean", - "description": "Return only active plans (default true)", + "default": true, + "description": "Customer requests always return active plans; false is honored only by the admin endpoint", "name": "active_only", "in": "query" }, @@ -12216,6 +20024,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "404": { "description": "Not Found", "schema": { @@ -12227,6 +20041,11 @@ const docTemplate = `{ }, "/api/v1/subscriptions": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new subscription for the authenticated user. For regular users, use /payments/subscribe instead.", "consumes": [ "application/json" @@ -12263,6 +20082,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12274,6 +20105,11 @@ const docTemplate = `{ }, "/api/v1/subscriptions/checkout": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Initiates payment for a subscription plan. Returns payment URL for checkout.", "consumes": [ "application/json" @@ -12309,6 +20145,24 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "409": { "description": "User already has active subscription", "schema": { @@ -12326,6 +20180,11 @@ const docTemplate = `{ }, "/api/v1/subscriptions/history": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the authenticated user's subscription history", "produces": [ "application/json" @@ -12356,12 +20215,35 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/subscriptions/me": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all active subscriptions for the authenticated user (one per plan category)", "produces": [ "application/json" @@ -12376,12 +20258,35 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/subscriptions/request-checkout-link": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends the standalone web checkout URL to the learner by email or SMS (registration channel). Intended when mobile clients show a subscription-required state.", "consumes": [ "application/json" @@ -12416,6 +20321,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "409": { "description": "Conflict", "schema": { @@ -12428,6 +20345,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "503": { "description": "Service Unavailable", "schema": { @@ -12439,6 +20362,11 @@ const docTemplate = `{ }, "/api/v1/subscriptions/status": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns whether the authenticated user has an active subscription", "produces": [ "application/json" @@ -12453,12 +20381,35 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/subscriptions/{id}/auto-renew": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Enables or disables auto-renewal for a subscription", "consumes": [ "application/json" @@ -12495,6 +20446,30 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12506,6 +20481,11 @@ const docTemplate = `{ }, "/api/v1/subscriptions/{id}/cancel": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Cancels the user's subscription", "produces": [ "application/json" @@ -12530,6 +20510,30 @@ const docTemplate = `{ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12541,6 +20545,11 @@ const docTemplate = `{ }, "/api/v1/user": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates user profile information (partial updates supported)", "consumes": [ "application/json" @@ -12553,13 +20562,6 @@ const docTemplate = `{ ], "summary": "Update user profile", "parameters": [ - { - "type": "integer", - "description": "User ID", - "name": "user_id", - "in": "path", - "required": true - }, { "description": "Update user payload", "name": "body", @@ -12583,6 +20585,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -12646,6 +20660,11 @@ const docTemplate = `{ }, "/api/v1/user/knowledge-level": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates the authenticated learner's self-reported knowledge level.", "consumes": [ "application/json" @@ -12687,6 +20706,12 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -12790,7 +20815,7 @@ const docTemplate = `{ }, "/api/v1/user/register": { "post": { - "description": "Register user", + "description": "Registers a learner with email or phone and password. The server assigns the learner role and selects the OTP medium from the contact method. An optional referral_code attributes the new account atomically; invalid or ineligible codes reject registration.", "consumes": [ "application/json" ], @@ -13049,6 +21074,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -13151,6 +21188,18 @@ const docTemplate = `{ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -13162,6 +21211,11 @@ const docTemplate = `{ }, "/api/v1/user/{user_id}/is-profile-completed": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the profile completion status and percentage for the specified user", "consumes": [ "application/json" @@ -13195,6 +21249,18 @@ const docTemplate = `{ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -13226,8 +21292,8 @@ const docTemplate = `{ "parameters": [ { "type": "string", - "description": "User ID", - "name": "user_id", + "description": "User name", + "name": "user_name", "in": "path", "required": true } @@ -13312,6 +21378,12 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -13364,6 +21436,12 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -13371,9 +21449,9 @@ const docTemplate = `{ "/api/v1/ws/connect": { "get": { "tags": [ - "client" + "ws" ], - "summary": "ConnectSocket", + "summary": "Connect Socket", "parameters": [ { "type": "string", @@ -13383,7 +21461,72 @@ const docTemplate = `{ "required": true } ], - "responses": {} + "responses": { + "101": { + "description": "WebSocket protocol upgrade; subsequent messages are notification events", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "type": "string" + } + } + } + } + }, + "/payment/success": { + "get": { + "description": "Displays the Rezina success page after Chapa redirects the learner to return_url", + "produces": [ + "text/html" + ], + "tags": [ + "payments" + ], + "summary": "Chapa payment success page", + "parameters": [ + { + "type": "string", + "description": "Chapa transaction reference (tx_ref)", + "name": "trx_ref", + "in": "query" + }, + { + "type": "string", + "description": "Chapa transaction reference", + "name": "tx_ref", + "in": "query" + }, + { + "type": "string", + "description": "Chapa reference ID", + "name": "ref_id", + "in": "query" + }, + { + "type": "string", + "description": "Payment status from Chapa redirect", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "HTML success page", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } } }, @@ -14415,6 +22558,49 @@ const docTemplate = `{ } } }, + "domain.ChapaWebhookPayload": { + "type": "object", + "properties": { + "amount": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "event": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tx_ref": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "domain.CompletePracticeInput": { + "type": "object", + "properties": { + "parent_id": { + "type": "integer" + }, + "parent_kind": { + "type": "string" + } + } + }, "domain.CreateCourseInput": { "type": "object", "required": [ @@ -14997,6 +23183,21 @@ const docTemplate = `{ } } }, + "domain.DeliveryChannel": { + "type": "string", + "enum": [ + "email", + "sms", + "push", + "in_app" + ], + "x-enum-varnames": [ + "DeliveryChannelEmail", + "DeliveryChannelSMS", + "DeliveryChannelPush", + "DeliveryChannelInApp" + ] + }, "domain.DynamicElementDefinition": { "type": "object", "properties": { @@ -15405,6 +23606,31 @@ const docTemplate = `{ } } }, + "domain.LinkExamPrepAssessmentInput": { + "type": "object", + "required": [ + "parent_id", + "parent_kind", + "question_set_id" + ], + "properties": { + "parent_id": { + "type": "integer" + }, + "parent_kind": { + "type": "string", + "enum": [ + "CATALOG_COURSE", + "UNIT", + "MODULE", + "LESSON" + ] + }, + "question_set_id": { + "type": "integer" + } + } + }, "domain.LogEntry": { "type": "object", "properties": { @@ -15469,15 +23695,122 @@ const docTemplate = `{ } } }, - "domain.OtpMedium": { + "domain.NotificationDeliveryScheme": { "type": "string", "enum": [ - "email", - "sms" + "bulk", + "single" ], "x-enum-varnames": [ - "OtpMediumEmail", - "OtpMediumSms" + "NotificationDeliverySchemeBulk", + "NotificationDeliverySchemeSingle" + ] + }, + "domain.NotificationErrorSeverity": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical", + "fatal" + ], + "x-enum-varnames": [ + "NotificationErrorSeverityLow", + "NotificationErrorSeverityMedium", + "NotificationErrorSeverityHigh", + "NotificationErrorSeverityCritical", + "NotificationErrorSeverityFatal" + ] + }, + "domain.NotificationLevel": { + "type": "string", + "enum": [ + "info", + "error", + "warning", + "success" + ], + "x-enum-varnames": [ + "NotificationLevelInfo", + "NotificationLevelError", + "NotificationLevelWarning", + "NotificationLevelSuccess" + ] + }, + "domain.NotificationPayload": { + "type": "object", + "properties": { + "headline": { + "type": "string" + }, + "message": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "domain.NotificationRecieverSide": { + "type": "string", + "enum": [ + "admin", + "customer", + "cashier", + "branch_manager", + "team_member" + ], + "x-enum-varnames": [ + "NotificationRecieverSideAdmin", + "NotificationRecieverSideCustomer", + "NotificationRecieverSideCashier", + "NotificationRecieverSideBranchManager", + "NotificationRecieverSideTeamMember" + ] + }, + "domain.NotificationType": { + "type": "string", + "enum": [ + "knowledge_level_update", + "payment_verified", + "subscription_activated", + "course_created", + "sub_course_created", + "video_added", + "issue_status_updated", + "issue_created", + "admin_created", + "team_member_created", + "user_deleted", + "system_alert", + "user_welcome", + "module_completed", + "course_completed", + "program_completed", + "subscription_expiring" + ], + "x-enum-varnames": [ + "NOTIFICATION_TYPE_KNOWLEDGE_LEVEL_UPDATE", + "NOTIFICATION_TYPE_PAYMENT_VERIFIED", + "NOTIFICATION_TYPE_SUBSCRIPTION_ACTIVATED", + "NOTIFICATION_TYPE_COURSE_CREATED", + "NOTIFICATION_TYPE_SUB_COURSE_CREATED", + "NOTIFICATION_TYPE_VIDEO_ADDED", + "NOTIFICATION_TYPE_ISSUE_STATUS_UPDATED", + "NOTIFICATION_TYPE_ISSUE_CREATED", + "NOTIFICATION_TYPE_ADMIN_CREATED", + "NOTIFICATION_TYPE_TEAM_MEMBER_CREATED", + "NOTIFICATION_TYPE_USER_DELETED", + "NOTIFICATION_TYPE_SYSTEM_ALERT", + "NOTIFICATION_TYPE_USER_WELCOME", + "NOTIFICATION_TYPE_MODULE_COMPLETED", + "NOTIFICATION_TYPE_COURSE_COMPLETED", + "NOTIFICATION_TYPE_PROGRAM_COMPLETED", + "NOTIFICATION_TYPE_SUBSCRIPTION_EXPIRING" ] }, "domain.Pagination": { @@ -15615,9 +23948,6 @@ const docTemplate = `{ "email": { "type": "string" }, - "otp_medium": { - "$ref": "#/definitions/domain.OtpMedium" - }, "password": { "type": "string" }, @@ -15625,10 +23955,8 @@ const docTemplate = `{ "type": "string" }, "referral_code": { - "type": "string" - }, - "role": { - "type": "string" + "type": "string", + "example": "ABCDEF0123456789" } } }, @@ -15743,6 +24071,77 @@ const docTemplate = `{ } } }, + "domain.SaveSettingListReq": { + "type": "object", + "properties": { + "amount_for_bet_referral": { + "type": "number" + }, + "bet_amount_limit": { + "type": "number" + }, + "bet_duplicate_limit": { + "type": "integer" + }, + "cashback_amount_cap": { + "type": "number" + }, + "cashback_percentage": { + "type": "number" + }, + "daily_ticket_limit": { + "type": "integer" + }, + "default_max_referrals": { + "type": "integer" + }, + "default_winning_limit": { + "type": "integer" + }, + "max_number_of_outcomes": { + "type": "integer" + }, + "max_unsettled_bets": { + "type": "integer" + }, + "minimum_bet_amount": { + "type": "number" + }, + "referral_reward_amount": { + "type": "number" + }, + "send_email_on_bet_finish": { + "type": "boolean" + }, + "send_sms_on_bet_finish": { + "type": "boolean" + }, + "sms_provider": { + "type": "string" + }, + "total_winning_limit": { + "type": "number" + }, + "total_winning_notify": { + "type": "number" + }, + "welcome_bonus_active": { + "type": "boolean" + }, + "welcome_bonus_cap": { + "type": "number" + }, + "welcome_bonus_count": { + "type": "integer" + }, + "welcome_bonus_expiry": { + "type": "integer" + }, + "welcome_bonus_multiplier": { + "type": "number" + } + } + }, "domain.SetRolePermissionsReq": { "type": "object", "required": [ @@ -16004,6 +24403,82 @@ const docTemplate = `{ } } }, + "domain.UpdateExamPrepLessonInput": { + "type": "object", + "properties": { + "access_tier": { + "type": "string", + "enum": [ + "FREE", + "free", + "PREMIUM", + "premium" + ] + }, + "description": { + "type": "string" + }, + "publish_status": { + "type": "string", + "enum": [ + "DRAFT", + "draft", + "PUBLISHED", + "published" + ] + }, + "sort_order": { + "type": "integer" + }, + "thumbnail": { + "type": "string" + }, + "title": { + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "domain.UpdateExamPrepModuleInput": { + "type": "object", + "properties": { + "access_tier": { + "type": "string", + "enum": [ + "FREE", + "free", + "PREMIUM", + "premium" + ] + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "name": { + "type": "string" + }, + "publish_status": { + "type": "string", + "enum": [ + "DRAFT", + "draft", + "PUBLISHED", + "published" + ] + }, + "sort_order": { + "type": "integer" + }, + "thumbnail": { + "type": "string" + } + } + }, "domain.UpdateExamPrepPracticeInput": { "type": "object", "properties": { @@ -16918,6 +25393,9 @@ const docTemplate = `{ } } }, + "handlers.CreateAndSendNotification.Request": { + "type": "object" + }, "handlers.CreatePullUploadRequest": { "type": "object", "required": [ @@ -16972,6 +25450,194 @@ const docTemplate = `{ } } }, + "handlers.NotificationDispatchResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "notification_id": { + "type": "string" + }, + "notification_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "recipient_count": { + "type": "integer" + } + } + }, + "handlers.ReferralCodeData": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "example": "ABCDEF0123456789" + } + } + }, + "handlers.ReferralCommissionItem": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "51.25" + }, + "commission_percent": { + "type": "string", + "example": "10.25" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2026-10-28T09:00:00Z" + }, + "currency": { + "type": "string", + "example": "ETB" + }, + "id": { + "type": "integer", + "example": 7 + }, + "payment_id": { + "type": "integer", + "example": 42 + }, + "reversed_at": { + "description": "Null until the qualifying payment leaves SUCCESS; reversed credits no longer contribute to the balance.", + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "handlers.ReferralHistoryData": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralHistoryItem" + } + }, + "limit": { + "type": "integer", + "example": 20 + }, + "offset": { + "type": "integer", + "example": 0 + } + } + }, + "handlers.ReferralHistoryItem": { + "type": "object", + "properties": { + "converted": { + "type": "boolean", + "example": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2026-10-28T09:00:00Z" + }, + "id": { + "type": "integer", + "example": 14 + } + } + }, + "handlers.ReferralOverviewData": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "example": "ABCDEF0123456789" + }, + "commission_percent": { + "type": "string", + "example": "10.25" + }, + "converted_referrals": { + "type": "integer", + "example": 3 + }, + "total_referrals": { + "type": "integer", + "example": 12 + }, + "wallet": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralWalletBalance" + } + } + } + }, + "handlers.ReferralSettingsData": { + "type": "object", + "properties": { + "commission_percent": { + "type": "string", + "example": "10.25" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2026-10-28T09:00:00Z" + } + } + }, + "handlers.ReferralWalletBalance": { + "type": "object", + "properties": { + "balance": { + "description": "Decimal string; balances are not combined across currencies.", + "type": "string", + "example": "125.50" + }, + "currency": { + "type": "string", + "example": "ETB" + } + } + }, + "handlers.ReferralWalletData": { + "type": "object", + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralWalletBalance" + } + }, + "limit": { + "type": "integer", + "example": 20 + }, + "offset": { + "type": "integer", + "example": 0 + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralCommissionItem" + } + } + } + }, "handlers.RegisterCodeReq": { "type": "object", "properties": { @@ -16985,6 +25651,26 @@ const docTemplate = `{ } } }, + "handlers.RegisterDeviceToken.Request": { + "type": "object", + "required": [ + "device_token", + "platform" + ], + "properties": { + "device_token": { + "type": "string" + }, + "platform": { + "type": "string", + "enum": [ + "android", + "ios", + "web" + ] + } + } + }, "handlers.ResetCodeReq": { "type": "object", "properties": { @@ -17052,6 +25738,17 @@ const docTemplate = `{ } } }, + "handlers.UnregisterDeviceToken.Request": { + "type": "object", + "required": [ + "device_token" + ], + "properties": { + "device_token": { + "type": "string" + } + } + }, "handlers.VimeoEmbedResponse": { "type": "object", "properties": { @@ -17210,6 +25907,18 @@ const docTemplate = `{ } } }, + "handlers.applyReferralReq": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "example": "ABCDEF0123456789" + } + } + }, "handlers.authorizeChapaDirectPaymentReq": { "type": "object", "required": [ @@ -18256,6 +26965,21 @@ const docTemplate = `{ "handlers.updateQuestionTypeDefinitionReq": { "type": "object" }, + "handlers.updateReferralSettingsReq": { + "type": "object", + "required": [ + "commission_percent" + ], + "properties": { + "commission_percent": { + "description": "Percentage of the first successful positive subscription payment, with at most two decimal places. Zero disables new commissions.", + "type": "number", + "maximum": 100, + "minimum": 0, + "example": 10.25 + } + } + }, "handlers.validateQuestionTypeDefinitionReq": { "type": "object", "properties": { @@ -18394,7 +27118,7 @@ var SwaggerInfo = &swag.Spec{ BasePath: "", Schemes: []string{}, Title: "Rezina API", - Description: "This is server for Rezina.", + Description: "Rezina LMS API. Admin panel endpoints use /api/v1/admin; customer web and mobile endpoints retain /api/v1. Use the audience-specific Swagger pages to browse each API. For protected endpoints, enter Bearer followed by a space and the access token in Authorize.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", diff --git a/docs/swagger.json b/docs/swagger.json index d43daf1a..fb58748e 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1,23 +1,21 @@ { "swagger": "2.0", "info": { - "description": "This is server for Rezina.", + "description": "Rezina LMS API. Admin panel endpoints use /api/v1/admin; customer web and mobile endpoints retain /api/v1. Use the audience-specific Swagger pages to browse each API. For protected endpoints, enter Bearer followed by a space and the access token in Authorize.", "title": "Rezina API", - "termsOfService": "http://swagger.io/terms/", "contact": { - "name": "API Support", - "url": "http://www.swagger.io/support", - "email": "support@swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + "name": "API Support" }, "version": "1.0.1" }, "paths": { "/api/v1/admin/activity-logs": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a filtered, paginated list of activity logs", "produces": [ "application/json" @@ -76,6 +74,12 @@ "description": "Offset", "name": "offset", "in": "query" + }, + { + "type": "string", + "description": "Search", + "name": "search", + "in": "query" } ], "responses": { @@ -91,6 +95,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -102,18 +118,54 @@ }, "/api/v1/admin/activity-logs/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "activity-logs" ], "summary": "Export activity logs as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/activity-logs/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single activity log entry by its ID", "produces": [ "application/json" @@ -144,6 +196,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -155,6 +219,11 @@ }, "/api/v1/admin/admins": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get all Admins", "consumes": [ "application/json" @@ -163,7 +232,7 @@ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Get all Admins", "parameters": [ @@ -178,6 +247,30 @@ "description": "Page size", "name": "page_size", "in": "query" + }, + { + "type": "string", + "description": "Query", + "name": "query", + "in": "query" + }, + { + "type": "string", + "description": "Created before", + "name": "created_before", + "in": "query" + }, + { + "type": "string", + "description": "Created after", + "name": "created_after", + "in": "query" + }, + { + "type": "integer", + "description": "Company id", + "name": "company_id", + "in": "query" } ], "responses": { @@ -199,6 +292,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -208,6 +307,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Create Admin", "consumes": [ "application/json" @@ -216,7 +320,7 @@ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Create Admin", "parameters": [ @@ -249,6 +353,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -273,7 +383,7 @@ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Bulk deactivate accounts by role (SUPER_ADMIN or ADMIN platform users only)", "parameters": [ @@ -306,6 +416,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -342,7 +458,7 @@ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Bulk reactivate accounts by role (SUPER_ADMIN or ADMIN platform users only)", "parameters": [ @@ -375,6 +491,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -398,6 +520,11 @@ }, "/api/v1/admin/admins/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get a single admin by id", "consumes": [ "application/json" @@ -406,7 +533,7 @@ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Get admin by id", "parameters": [ @@ -437,6 +564,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -446,6 +579,11 @@ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Update Admin", "consumes": [ "application/json" @@ -454,7 +592,7 @@ "application/json" ], "tags": [ - "admin" + "admins" ], "summary": "Update Admin", "parameters": [ @@ -466,6 +604,14 @@ "schema": { "$ref": "#/definitions/handlers.updateAdminReq" } + }, + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true } ], "responses": { @@ -487,6 +633,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -498,6 +650,11 @@ }, "/api/v1/admin/analytics/dashboard": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Platform analytics with optional date filters in Africa/Addis_Ababa (EAT): all-time (default), year, year+month, or custom from/to range. When year is set, payments.revenue_monthly returns Jan–Dec SUCCESS revenue totals (EAT) per currency for that calendar year. Optional payment_method filters payment/revenue metrics (exact or METHOD:% variants). Daily series remains in revenue_last_30_days (see date_filter.series_*). Courses section counts LMS + exam_prep inventory.", "produces": [ "application/json" @@ -551,6 +708,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -613,6 +782,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -661,6 +842,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -706,6 +899,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -767,6 +972,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -816,6 +1033,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -874,6 +1103,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -926,6 +1161,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -942,11 +1183,59 @@ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "RegisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Register Device Token", + "parameters": [ + { + "description": "Device token and platform", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.RegisterDeviceToken.Request" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/devices/unregister": { @@ -956,15 +1245,68 @@ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "UnregisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Unregister Device Token", + "parameters": [ + { + "description": "Device token to unregister", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.UnregisterDeviceToken.Request" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/email-templates": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns email templates for admin management", "produces": [ "application/json" @@ -1012,6 +1354,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -1021,6 +1375,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new custom email template", "consumes": [ "application/json" @@ -1056,6 +1415,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -1067,6 +1438,11 @@ }, "/api/v1/admin/email-templates/slug/{slug}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns one email template by slug regardless of status", "produces": [ "application/json" @@ -1097,6 +1473,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1114,6 +1502,11 @@ }, "/api/v1/admin/email-templates/slug/{slug}/preview": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Renders an email template with sample variables without sending", "consumes": [ "application/json" @@ -1156,6 +1549,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1173,6 +1578,11 @@ }, "/api/v1/admin/email-templates/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns one email template regardless of status", "produces": [ "application/json" @@ -1203,6 +1613,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1218,6 +1640,11 @@ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates an existing email template", "consumes": [ "application/json" @@ -1260,6 +1687,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1275,6 +1714,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a custom email template", "produces": [ "application/json" @@ -1305,6 +1749,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1322,6 +1778,11 @@ }, "/api/v1/admin/email-templates/{id}/preview": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Renders an email template with sample variables without sending", "consumes": [ "application/json" @@ -1364,6 +1825,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -1386,11 +1859,39 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "ListExamPrepAssessments", - "responses": {} + "tags": [ + "exam-prep" + ], + "summary": "List Exam Prep Assessments", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } }, "post": { "security": [ @@ -1398,11 +1899,53 @@ "Bearer": [] } ], - "tags": [ - "admin" + "consumes": [ + "application/json" ], - "summary": "LinkExamPrepAssessment", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "exam-prep" + ], + "summary": "Link Exam Prep Assessment", + "parameters": [ + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.LinkExamPrepAssessmentInput" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/exam-prep/assessments/{questionSetId}/parents/{parentKind}/{parentId}": { @@ -1412,15 +1955,85 @@ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "UnlinkExamPrepAssessment", - "responses": {} + "tags": [ + "exam-prep" + ], + "summary": "Unlink Exam Prep Assessment", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Parent id", + "name": "parentId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Parent kind", + "name": "parentKind", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Question set id", + "name": "questionSetId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/catalog-courses": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -1450,10 +2063,33 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Top-level exam track (DET, IELTS, …) in schema exam_prep — separate from LMS programs/courses", "consumes": [ "application/json" @@ -1488,12 +2124,35 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/catalog-courses/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -1521,12 +2180,44 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1552,9 +2243,48 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1577,11 +2307,50 @@ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/units": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1615,10 +2384,45 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Unit under a catalog course (e.g. chapter title). Optional sort_order assigns position within that catalog course (siblings at or after that index are shifted); omit to append after the current highest sort_order in the catalog course.", "consumes": [ "application/json" @@ -1654,12 +2458,50 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/units/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1682,11 +2524,53 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/catalog-courses/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -1709,10 +2593,45 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -1747,10 +2666,48 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1770,35 +2727,250 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/lessons/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep lesson by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Update exam-prep lesson", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdateExamPrepLessonInput" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Delete exam-prep lesson", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/lessons/{lessonId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1824,34 +2996,250 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/modules/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep module by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Update exam-prep module", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdateExamPrepModuleInput" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Delete exam-prep module", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/modules/{moduleId}/lessons": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1879,9 +3267,54 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1904,20 +3337,132 @@ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/modules/{moduleId}/lessons/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Reorder lessons within an exam-prep unit module", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Module id", + "name": "moduleId", + "in": "path", + "required": true + }, + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.ReorderIDsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1942,9 +3487,48 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1960,11 +3544,50 @@ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -1978,9 +3601,54 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2003,9 +3671,54 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2019,11 +3732,53 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices/{id}/full": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns exam-prep practice metadata, linked question set settings, and all questions in the set.", "produces": [ "application/json" @@ -2054,15 +3809,38 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates exam-prep practice metadata, linked question set settings, and syncs questions in one request.", "consumes": [ "application/json" @@ -2105,17 +3883,43 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/exam-prep/practices/{id}/parents": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2138,11 +3942,56 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/practices/{id}/parents/{parentKind}/{parentId}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2170,11 +4019,56 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2188,9 +4082,54 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2213,9 +4152,54 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2229,11 +4213,56 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{unitId}/modules": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2245,11 +4274,71 @@ "name": "unitId", "in": "path", "required": true + }, + { + "type": "integer", + "default": 20, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2272,11 +4361,56 @@ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{unitId}/modules/reorder": { "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2299,11 +4433,56 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/exam-prep/units/{unitId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2329,9 +4508,48 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -2354,11 +4572,47 @@ } } ], - "responses": {} + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/faqs": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns FAQs for admin management with status/category filtering", "produces": [ "application/json" @@ -2406,6 +4660,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -2415,6 +4681,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new FAQ item", "consumes": [ "application/json" @@ -2450,6 +4721,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -2461,6 +4744,11 @@ }, "/api/v1/admin/faqs/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns one FAQ regardless of status", "produces": [ "application/json" @@ -2491,6 +4779,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -2506,6 +4806,11 @@ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates an existing FAQ item", "consumes": [ "application/json" @@ -2548,6 +4853,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -2563,6 +4880,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes an FAQ item", "produces": [ "application/json" @@ -2593,6 +4915,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -2610,6 +4944,11 @@ }, "/api/v1/admin/field-options": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -2649,10 +4988,27 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -2680,12 +5036,35 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/field-options/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -2708,10 +5087,33 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -2746,10 +5148,33 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -2772,15 +5197,53 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/audio": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -2800,12 +5263,47 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/complete-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Call after PUT upload to upload_url. Returns the same file metadata shape as POST /files/upload.", "consumes": [ "application/json" @@ -2834,12 +5332,53 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/presign-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a short-lived PUT URL and object key. Upload the file with HTTP PUT to upload_url using the same Content-Type, then call POST /files/complete-upload.", "consumes": [ "application/json" @@ -2868,12 +5407,47 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/refresh-url": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -2901,15 +5475,53 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -2936,12 +5548,50 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/files/url": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -2961,6 +5611,36 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -3001,6 +5681,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3060,6 +5752,18 @@ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3132,6 +5836,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3190,6 +5906,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -3234,6 +5962,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3292,6 +6032,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3303,6 +6055,11 @@ }, "/api/v1/admin/logs": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Fetches application logs from MongoDB with pagination, level filtering, and search", "produces": [ "application/json" @@ -3352,6 +6109,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Staff account and logs.list permission required", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal server error", "schema": { @@ -3368,11 +6137,62 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "GetUserNotification", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Get User Notification", + "parameters": [ + { + "type": "integer", + "default": 10, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } }, "delete": { "security": [ @@ -3380,11 +6200,39 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "DeleteUserNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Delete User Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/all": { @@ -3394,15 +6242,106 @@ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "GetAllNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Get All Notifications", + "parameters": [ + { + "type": "integer", + "default": 10, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "Page", + "name": "page", + "in": "query" + }, + { + "type": "string", + "description": "Channel", + "name": "channel", + "in": "query" + }, + { + "type": "string", + "description": "Type", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "User id", + "name": "user_id", + "in": "query" + }, + { + "type": "boolean", + "description": "Is read", + "name": "is_read", + "in": "query" + }, + { + "type": "string", + "description": "After", + "name": "after", + "in": "query" + }, + { + "type": "string", + "description": "Before", + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/notifications/bulk-email": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an email to specified user IDs, users of a platform role, team member IDs, team members of a team_role, or direct email addresses with optional image attachment. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "multipart/form-data" @@ -3414,6 +6353,80 @@ "notifications" ], "summary": "Send bulk email", + "parameters": [ + { + "type": "string", + "description": "Saved template slug; otherwise subject and message or html are required", + "name": "email_template_slug", + "in": "formData" + }, + { + "type": "string", + "description": "JSON object of template variables", + "name": "template_variables", + "in": "formData" + }, + { + "type": "string", + "description": "Subject, required when no template is selected", + "name": "subject", + "in": "formData" + }, + { + "type": "string", + "description": "Plain-text body, required without a template unless html is supplied", + "name": "message", + "in": "formData" + }, + { + "type": "string", + "description": "HTML body alternative to message", + "name": "html", + "in": "formData" + }, + { + "type": "file", + "description": "Optional attachment", + "name": "file", + "in": "formData" + }, + { + "type": "string", + "description": "Comma-separated direct email addresses", + "name": "emails", + "in": "formData" + }, + { + "type": "string", + "description": "Comma-separated customer IDs", + "name": "user_ids", + "in": "formData" + }, + { + "type": "string", + "description": "Customer role used to select recipients", + "name": "role", + "in": "formData" + }, + { + "type": "string", + "description": "Comma-separated team-member IDs", + "name": "team_member_ids", + "in": "formData" + }, + { + "type": "string", + "description": "Team role used to select recipients", + "name": "team_role", + "in": "formData" + }, + { + "type": "string", + "description": "Optional future delivery time in RFC3339 format", + "name": "scheduled_at", + "in": "formData" + } + ], "responses": { "200": { "description": "OK", @@ -3421,12 +6434,30 @@ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3438,6 +6469,11 @@ }, "/api/v1/admin/notifications/bulk-in-app": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates in-app notifications for specified platform user IDs, users matching a platform role, team member IDs, or team members matching a team_role. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" @@ -3504,12 +6540,30 @@ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3521,6 +6575,11 @@ }, "/api/v1/admin/notifications/bulk-push": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends a push notification to specified user IDs or all users matching a role. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" @@ -3574,12 +6633,30 @@ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3591,6 +6668,11 @@ }, "/api/v1/admin/notifications/bulk-sms": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an SMS to specified user IDs, all users of a role, or direct phone numbers. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" @@ -3644,12 +6726,30 @@ "$ref": "#/definitions/domain.Response" } }, + "201": { + "description": "Scheduled notification created when scheduled_at is provided", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3666,15 +6766,68 @@ "Bearer": [] } ], - "tags": [ - "admin" + "consumes": [ + "application/json" ], - "summary": "CreateAndSendNotification", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "notifications" + ], + "summary": "Create And Send Notification", + "parameters": [ + { + "description": "Notification recipient and delivery settings", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.CreateAndSendNotification.Request" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/handlers.NotificationDispatchResponse" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/notifications/delete-in-app": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes in-app notifications by ID for the authenticated user. Non-matching IDs are ignored.", "consumes": [ "application/json" @@ -3710,6 +6863,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3726,11 +6891,39 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Read", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/mark-all-unread": { @@ -3740,15 +6933,48 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Unread", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/scheduled": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated scheduled notifications with optional status, channel, and date filters", "produces": [ "application/json" @@ -3810,6 +7036,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3821,6 +7059,11 @@ }, "/api/v1/admin/notifications/scheduled/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single scheduled notification by its ID", "produces": [ "application/json" @@ -3851,6 +7094,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3862,6 +7117,11 @@ }, "/api/v1/admin/notifications/scheduled/{id}/cancel": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Cancels a scheduled notification if it is still pending or processing", "produces": [ "application/json" @@ -3892,6 +7152,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3903,6 +7175,11 @@ }, "/api/v1/admin/notifications/send-email": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an email to a single email address with optional image attachment", "consumes": [ "multipart/form-data" @@ -3914,6 +7191,51 @@ "notifications" ], "summary": "Send single email", + "parameters": [ + { + "type": "string", + "description": "Saved template slug; otherwise subject and message or html are required", + "name": "email_template_slug", + "in": "formData" + }, + { + "type": "string", + "description": "JSON object of template variables", + "name": "template_variables", + "in": "formData" + }, + { + "type": "string", + "description": "Subject, required when no template is selected", + "name": "subject", + "in": "formData" + }, + { + "type": "string", + "description": "Plain-text body, required without a template unless html is supplied", + "name": "message", + "in": "formData" + }, + { + "type": "string", + "description": "HTML body alternative to message", + "name": "html", + "in": "formData" + }, + { + "type": "file", + "description": "Optional attachment", + "name": "file", + "in": "formData" + }, + { + "type": "string", + "description": "Recipient email address", + "name": "recipient", + "in": "formData", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -3927,6 +7249,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -3938,6 +7272,11 @@ }, "/api/v1/admin/notifications/test-push": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends a test push notification to all registered devices of the current user", "consumes": [ "application/json" @@ -3987,6 +7326,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4003,15 +7348,48 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "CountUnreadNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Count Unread Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/notifications/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single in-app notification. Users may only fetch their own notifications unless they have list-all access.", "produces": [ "application/json" @@ -4042,6 +7420,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -4063,6 +7447,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes one in-app notification owned by the authenticated user.", "produces": [ "application/json" @@ -4093,6 +7482,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -4115,11 +7516,55 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Read", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/notifications/{id}/unread": { @@ -4129,15 +7574,64 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Unread", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/payments": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated payments across Chapa and ArifPay with optional filters", "produces": [ "application/json" @@ -4264,24 +7758,78 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/payments/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "payments" ], "summary": "Export payments as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/payments/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns any payment record by ID without learner ownership restriction", "produces": [ "application/json" @@ -4297,6 +7845,21 @@ "name": "id", "in": "path", "required": true + }, + { + "type": "integer", + "default": 20, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" } ], "responses": { @@ -4306,17 +7869,49 @@ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/personas": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4342,12 +7937,51 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4369,12 +8003,44 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/personas/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4388,9 +8054,54 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "put": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4413,9 +8124,54 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -4429,11 +8185,47 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/question-sets": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a paginated list of question sets filtered by type", "produces": [ "application/json" @@ -4478,6 +8270,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4487,6 +8291,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new question set (practice, assessment, quiz, exam, or survey)", "consumes": [ "application/json" @@ -4522,6 +8331,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4533,6 +8354,11 @@ }, "/api/v1/admin/question-sets/by-owner": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns question sets for a specific owner (e.g., sub-course)", "produces": [ "application/json" @@ -4570,6 +8396,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4581,6 +8419,11 @@ }, "/api/v1/admin/question-sets/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a question set with question count", "produces": [ "application/json" @@ -4611,6 +8454,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -4620,6 +8475,11 @@ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a question set's properties", "consumes": [ "application/json" @@ -4662,6 +8522,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4671,6 +8549,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Archives a question set (soft delete)", "produces": [ "application/json" @@ -4701,6 +8584,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4712,6 +8607,11 @@ }, "/api/v1/admin/question-sets/{setId}/personas": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all users assigned as personas to a question set (practice)", "produces": [ "application/json" @@ -4742,6 +8642,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4751,6 +8663,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Links a user as a persona to a question set (practice)", "consumes": [ "application/json" @@ -4793,6 +8710,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4804,6 +8733,11 @@ }, "/api/v1/admin/question-sets/{setId}/personas/{userId}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Unlinks a user as persona from a question set (practice)", "produces": [ "application/json" @@ -4841,6 +8775,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4852,6 +8798,11 @@ }, "/api/v1/admin/question-sets/{setId}/question-types": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns distinct question type definitions (key, display_name, counts) for non-archived questions in the set. Legacy stored question_type values (e.g. AUDIO) are resolved to builder definitions when possible.", "produces": [ "application/json" @@ -4882,6 +8833,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -4899,6 +8862,11 @@ }, "/api/v1/admin/question-sets/{setId}/questions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all questions in a question set with contextual shared stimulus data for linked LMS and exam-prep practices", "produces": [ "application/json" @@ -4929,6 +8897,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4938,6 +8924,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Links a question to a question set. Omit display_order to append after the current max; the assigned value is returned in the response.", "consumes": [ "application/json" @@ -4980,6 +8971,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -4991,6 +8994,11 @@ }, "/api/v1/admin/question-sets/{setId}/questions/{questionId}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Unlinks a question from a question set", "produces": [ "application/json" @@ -5028,6 +9036,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5039,6 +9059,11 @@ }, "/api/v1/admin/question-sets/{setId}/questions/{questionId}/order": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates the display order of a question in a set", "consumes": [ "application/json" @@ -5088,6 +9113,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5099,6 +9136,11 @@ }, "/api/v1/admin/questions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a paginated list of questions with optional filters", "produces": [ "application/json" @@ -5154,6 +9196,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5163,6 +9217,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new question with options (for MCQ/TRUE_FALSE) or short answers (for SHORT_ANSWER). DYNAMIC questions must not send question_text; use dynamic_payload stimulus instead. Legacy types require question_text.", "consumes": [ "application/json" @@ -5198,6 +9257,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5209,6 +9280,11 @@ }, "/api/v1/admin/questions/component-catalog": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Valid stimulus and response component kind codes for dynamic question-type definitions", "produces": [ "application/json" @@ -5223,12 +9299,29 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/questions/search": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Search questions by text", "produces": [ "application/json" @@ -5273,6 +9366,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5284,6 +9389,11 @@ }, "/api/v1/admin/questions/type-definition-groups": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5319,10 +9429,39 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -5350,12 +9489,35 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/questions/type-definition-groups/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5379,15 +9541,44 @@ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -5422,10 +9613,39 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5448,12 +9668,41 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/questions/type-definitions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5503,6 +9752,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5512,6 +9779,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Stores a reusable dynamic question-type definition for future question construction. Only runtime-mappable definitions are persisted.", "consumes": [ "application/json" @@ -5547,6 +9819,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5558,6 +9848,11 @@ }, "/api/v1/admin/questions/type-definitions/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5587,6 +9882,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -5596,6 +9903,11 @@ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a reusable dynamic question-type definition. Updated definitions must remain runtime-mappable.", "consumes": [ "application/json" @@ -5638,6 +9950,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5647,6 +9977,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -5676,6 +10011,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5687,6 +10034,11 @@ }, "/api/v1/admin/questions/type-definitions/{id}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns LMS and exam-prep practices whose linked question set contains at least one non-archived question matching the definition (by question_type_definition_id or legacy question_type).", "produces": [ "application/json" @@ -5731,17 +10083,40 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/questions/validate-question-type-definition": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Validates selected stimulus and response component kinds for temporary question-type definitions (component-level validation only)", "consumes": [ "application/json" @@ -5776,12 +10151,29 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/admin/questions/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a question with its options/short answers", "produces": [ "application/json" @@ -5812,15 +10204,38 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a question and optionally replaces its options/short answers. Supports question_type_definition_id for dynamic builder-linked questions.", "consumes": [ "application/json" @@ -5863,6 +10278,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5872,6 +10305,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Archives a question (soft delete)", "produces": [ "application/json" @@ -5902,6 +10340,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5913,6 +10363,11 @@ }, "/api/v1/admin/ratings": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated ratings for a specific target", "produces": [ "application/json" @@ -5962,6 +10417,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -5973,6 +10440,11 @@ }, "/api/v1/admin/ratings/summary": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the total count and average stars for a specific target", "produces": [ "application/json" @@ -6010,6 +10482,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6021,6 +10505,11 @@ }, "/api/v1/admin/ratings/{id}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a rating by ID for the current user", "produces": [ "application/json" @@ -6051,6 +10540,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6100,6 +10601,18 @@ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6149,6 +10662,18 @@ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6183,6 +10708,18 @@ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6243,6 +10780,18 @@ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6304,6 +10853,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6365,6 +10926,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -6427,6 +11000,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6474,6 +11059,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6538,6 +11135,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6594,6 +11203,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6610,11 +11231,52 @@ "Bearer": [] } ], - "tags": [ - "admin" + "description": "Returns the saved referral commission percentage. Restricted to ADMIN and SUPER_ADMIN. The initial percentage is 0, which disables new credits.", + "produces": [ + "application/json" ], - "summary": "GetReferralSettings", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get Referral Settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralSettingsData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } }, "put": { "security": [ @@ -6622,15 +11284,81 @@ "Bearer": [] } ], - "tags": [ - "admin" + "description": "Sets the percentage credited on a referred learner's first successful positive subscription payment. Accepts 0 through 100 with at most two decimal places. Zero disables new credits. Changes affect future conversions only; existing credits retain their rate. Restricted to ADMIN and SUPER_ADMIN; changes are audited.", + "consumes": [ + "application/json" ], - "summary": "UpdateReferralSettings", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "referrals" + ], + "summary": "Update Referral Settings", + "parameters": [ + { + "description": "Commission percentage configuration", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.updateReferralSettingsReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralSettingsData" + } + } + } + ] + } + }, + "400": { + "description": "Missing or invalid commission_percent; use 0 through 100 with at most two decimal places", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/sendSMS": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends an SMS message to a single phone number using AfroMessage", "consumes": [ "application/json" @@ -6666,6 +11394,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6682,11 +11422,39 @@ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "GetGlobalSettingList", - "responses": {} + "tags": [ + "settings" + ], + "summary": "Get Global Setting List", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } }, "put": { "security": [ @@ -6694,11 +11462,59 @@ "Bearer": [] } ], - "tags": [ - "admin" + "consumes": [ + "application/json" ], - "summary": "UpdateGlobalSettingList", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "settings" + ], + "summary": "Update Global Setting List", + "parameters": [ + { + "description": "Request payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.SaveSettingListReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/settings/{key}": { @@ -6708,15 +11524,57 @@ "Bearer": [] } ], - "tags": [ - "admin" + "produces": [ + "application/json" ], - "summary": "GetGlobalSettingByKey", - "responses": {} + "tags": [ + "settings" + ], + "summary": "Get Global Setting By Key", + "parameters": [ + { + "type": "string", + "description": "Key", + "name": "key", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/subscription-plans": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns subscription plans. Optional category filter: EDUCATION.", "produces": [ "application/json" @@ -6752,6 +11610,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6761,6 +11631,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new subscription plan (admin only)", "consumes": [ "application/json" @@ -6796,6 +11671,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "409": { + "description": "Resource conflict", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6807,6 +11700,11 @@ }, "/api/v1/admin/subscription-plans/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single subscription plan by ID", "produces": [ "application/json" @@ -6831,6 +11729,18 @@ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -6840,6 +11750,11 @@ } }, "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates a subscription plan (admin only)", "consumes": [ "application/json" @@ -6882,6 +11797,30 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "409": { + "description": "Resource conflict", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6891,6 +11830,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a subscription plan (admin only)", "produces": [ "application/json" @@ -6915,6 +11859,36 @@ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "409": { + "description": "Resource conflict", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -6926,14 +11900,45 @@ }, "/api/v1/admin/subscriptions/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "subscriptions" ], "summary": "Export user subscriptions as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/subscriptions/{id}/cancel": { @@ -6973,6 +11978,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -6990,6 +12007,11 @@ }, "/api/v1/admin/team/invitations": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Lists team member invitations with optional status filter", "produces": [ "application/json" @@ -7024,6 +12046,24 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } @@ -7058,6 +12098,12 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -7087,12 +12133,29 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/team/invitations/{id}/revoke": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Revokes the invitation and removes the pending team member if not yet accepted", "produces": [ "application/json" @@ -7116,6 +12179,24 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } @@ -7233,6 +12314,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7306,6 +12393,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7498,18 +12591,54 @@ }, "/api/v1/admin/team/members/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "team" ], "summary": "Export team members as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/admin/team/members/invite": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a pending team member (email + team_role only) and sends an invitation email; profile is completed on accept", "consumes": [ "application/json" @@ -7545,6 +12674,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -7612,6 +12753,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7821,6 +12968,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -7838,6 +12991,11 @@ }, "/api/v1/admin/team/members/{id}/resend-invite": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Revokes the current pending invite and sends a new invitation email", "produces": [ "application/json" @@ -7868,6 +13026,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -8008,6 +13178,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8246,6 +13422,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8257,6 +13445,11 @@ }, "/api/v1/admin/user/delete/{id}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Delete a user by their ID", "consumes": [ "application/json" @@ -8290,6 +13483,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8301,6 +13506,11 @@ }, "/api/v1/admin/user/search": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Search for user using name or phone", "consumes": [ "application/json" @@ -8336,6 +13546,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8347,6 +13569,11 @@ }, "/api/v1/admin/user/single/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get a single user by id", "consumes": [ "application/json" @@ -8386,6 +13613,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8397,6 +13630,11 @@ }, "/api/v1/admin/user/status": { "patch": { + "security": [ + { + "Bearer": [] + } + ], "description": "Activates, deactivates, or suspends a user account", "consumes": [ "application/json" @@ -8432,6 +13670,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8488,6 +13738,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8499,6 +13761,11 @@ }, "/api/v1/admin/users": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Get users with optional filters. Each user includes subscription_status: ACTIVE, PENDING, or Unsubscribed.", "consumes": [ "application/json" @@ -8585,6 +13852,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8596,6 +13875,11 @@ }, "/api/v1/admin/users/deletion-requests": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns account deletion requests for admin panel tracking with filtering and pagination", "consumes": [ "application/json" @@ -8682,6 +13966,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8693,14 +13989,45 @@ }, "/api/v1/admin/users/export": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ + "text/csv", "text/csv" ], "tags": [ "user" ], "summary": "Export users as CSV (admin)", - "responses": {} + "responses": { + "200": { + "description": "CSV export; filename is supplied in Content-Disposition", + "schema": { + "type": "file" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/admin/users/summary": { @@ -8740,6 +14067,18 @@ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -8810,6 +14149,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -8874,6 +14225,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -8938,6 +14301,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -9008,6 +14383,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -9025,6 +14412,11 @@ }, "/api/v1/admin/vimeo/oembed": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Fetches oEmbed metadata for a Vimeo video URL", "consumes": [ "application/json" @@ -9070,6 +14462,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9081,6 +14485,11 @@ }, "/api/v1/admin/vimeo/sample": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Fetches a sample video from Vimeo and returns video details along with an embeddable iframe for client-side integration", "consumes": [ "application/json" @@ -9122,6 +14531,18 @@ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9133,6 +14554,11 @@ }, "/api/v1/admin/vimeo/uploads/pull": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Initiates a pull upload where Vimeo fetches the video from a URL", "consumes": [ "application/json" @@ -9168,17 +14594,40 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/uploads/tus": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Initiates a TUS resumable upload and returns the upload link", "consumes": [ "application/json" @@ -9214,17 +14663,40 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/videos": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a paginated list of videos for the Vimeo API token (GET https://api.vimeo.com/me/videos)", "consumes": [ "application/json" @@ -9307,6 +14779,18 @@ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9324,6 +14808,11 @@ }, "/api/v1/admin/vimeo/videos/{video_id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Retrieves video details from Vimeo by video ID", "consumes": [ "application/json" @@ -9357,15 +14846,38 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a video from the Vimeo account", "consumes": [ "application/json" @@ -9387,8 +14899,11 @@ } ], "responses": { - "204": { - "description": "No Content" + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } }, "400": { "description": "Bad Request", @@ -9396,17 +14911,40 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/videos/{video_id}/embed": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Generates an embeddable player iframe for the video", "consumes": [ "application/json" @@ -9478,17 +15016,40 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/admin/vimeo/videos/{video_id}/status": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the current transcoding status of a video", "consumes": [ "application/json" @@ -9525,11 +15086,29 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -9537,9 +15116,9 @@ "/api/v1/admin/ws/connect": { "get": { "tags": [ - "client" + "ws" ], - "summary": "ConnectSocket", + "summary": "Connect Socket", "parameters": [ { "type": "string", @@ -9549,7 +15128,20 @@ "required": true } ], - "responses": {} + "responses": { + "101": { + "description": "WebSocket protocol upgrade; subsequent messages are notification events", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/app/version/check": { @@ -9624,7 +15216,38 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/customer-login": { @@ -9670,6 +15293,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9681,6 +15310,9 @@ }, "/api/v1/auth/google/android": { "post": { + "produces": [ + "application/json" + ], "tags": [ "auth" ], @@ -9696,29 +15328,111 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/google/callback": { "get": { + "produces": [ + "application/json" + ], "tags": [ "auth" ], "summary": "Google login callback", - "responses": {} + "parameters": [ + { + "type": "string", + "description": "Code", + "name": "code", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/google/login": { "get": { + "produces": [ + "text/plain" + ], "tags": [ "auth" ], "summary": "Google login redirect", - "responses": {} + "responses": { + "302": { + "description": "Redirect to Google authorization URL; see Location header", + "schema": { + "type": "string" + } + }, + "503": { + "description": "Google OAuth is not configured", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/auth/logout": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Logout user", "consumes": [ "application/json" @@ -9760,6 +15474,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9812,6 +15532,12 @@ "$ref": "#/definitions/response.APIResponse" } }, + "403": { + "description": "Access denied", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -9828,11 +15554,59 @@ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "RegisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Register Device Token", + "parameters": [ + { + "description": "Device token and platform", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.RegisterDeviceToken.Request" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/devices/unregister": { @@ -9842,11 +15616,59 @@ "Bearer": [] } ], - "tags": [ - "client" + "consumes": [ + "application/json" ], - "summary": "UnregisterDeviceToken", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Unregister Device Token", + "parameters": [ + { + "description": "Device token to unregister", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.UnregisterDeviceToken.Request" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/exam-prep/assessments": { @@ -9856,15 +15678,48 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "ListExamPrepAssessments", - "responses": {} + "tags": [ + "exam-prep" + ], + "summary": "List Exam Prep Assessments", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/exam-prep/catalog-courses": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -9894,12 +15749,38 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/exam-prep/catalog-courses/{catalogCourseId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -9925,11 +15806,50 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/catalog-courses/{catalogCourseId}/units": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -9963,12 +15883,47 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/exam-prep/catalog-courses/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "produces": [ "application/json" ], @@ -9991,21 +15946,114 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/exam-prep/lessons/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep lesson by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/lessons/{lessonId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10031,20 +16079,114 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/modules/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], "summary": "Get exam-prep module by ID", - "responses": {} + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/modules/{moduleId}/lessons": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10072,11 +16214,56 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10101,11 +16288,50 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/practices/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10119,11 +16345,53 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/practices/{practiceId}/questions": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated questions for an exam-prep practice, including shared stimulus blocks and each question's effective dynamic payload", "produces": [ "application/json" @@ -10174,6 +16442,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -10191,6 +16471,11 @@ }, "/api/v1/exam-prep/progress-summary": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns progress for the catalog course → unit → module → lesson learning hierarchy.", "produces": [ "application/json" @@ -10206,6 +16491,18 @@ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10217,7 +16514,15 @@ }, "/api/v1/exam-prep/progress/practices/{id}/complete": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Marks a practice question set as completed for the authenticated learner in its exam-prep parent scope", + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], @@ -10232,6 +16537,26 @@ "name": "id", "in": "path", "required": true + }, + { + "description": "Optional practice parent scope", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/domain.CompletePracticeInput" + } + }, + { + "type": "string", + "description": "Parent kind", + "name": "parent_kind", + "in": "query" + }, + { + "type": "integer", + "description": "Parent id", + "name": "parent_id", + "in": "query" } ], "responses": { @@ -10247,6 +16572,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -10270,6 +16601,14 @@ }, "/api/v1/exam-prep/units/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10283,11 +16622,56 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/units/{unitId}/modules": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10299,13 +16683,73 @@ "name": "unitId", "in": "path", "required": true + }, + { + "type": "integer", + "default": 20, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/units/{unitId}/practices": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "exam-prep" ], @@ -10331,11 +16775,47 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/exam-prep/videos/engagement/heartbeat": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Records playback position for analytics (completion, replay, and drop-off). Send periodic heartbeats while watching; set ended=true when the viewer leaves. A new session starts after 30 minutes of inactivity or when ended=true on the prior session.", "consumes": [ "application/json" @@ -10383,6 +16863,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -10394,6 +16880,12 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -10487,6 +16979,12 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -10549,9 +17047,17 @@ }, "/api/v1/files/audio": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -10571,12 +17077,47 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/complete-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Call after PUT upload to upload_url. Returns the same file metadata shape as POST /files/upload.", "consumes": [ "application/json" @@ -10605,12 +17146,53 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/presign-upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a short-lived PUT URL and object key. Upload the file with HTTP PUT to upload_url using the same Content-Type, then call POST /files/complete-upload.", "consumes": [ "application/json" @@ -10639,12 +17221,47 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/refresh-url": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "application/json" ], @@ -10672,15 +17289,53 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/upload": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -10707,12 +17362,50 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/files/url": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "files" ], @@ -10732,6 +17425,36 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -10796,6 +17519,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10855,6 +17584,18 @@ ] } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10871,11 +17612,62 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "GetUserNotification", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Get User Notification", + "parameters": [ + { + "type": "integer", + "default": 10, + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } }, "delete": { "security": [ @@ -10883,15 +17675,48 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "DeleteUserNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Delete User Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/delete-in-app": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes in-app notifications by ID for the authenticated user. Non-matching IDs are ignored.", "consumes": [ "application/json" @@ -10927,6 +17752,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -10943,11 +17780,39 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Read", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/mark-all-unread": { @@ -10957,11 +17822,39 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkAllNotificationsAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark All Notifications As Unread", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/unread": { @@ -10971,15 +17864,48 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "CountUnreadNotifications", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Count Unread Notifications", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/notifications/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns a single in-app notification. Users may only fetch their own notifications unless they have list-all access.", "produces": [ "application/json" @@ -11010,6 +17936,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, "403": { "description": "Forbidden", "schema": { @@ -11031,6 +17963,11 @@ } }, "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes one in-app notification owned by the authenticated user.", "produces": [ "application/json" @@ -11061,6 +17998,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11083,11 +18032,55 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsRead", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Read", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/notifications/{id}/unread": { @@ -11097,15 +18090,64 @@ "Bearer": [] } ], - "tags": [ - "client" + "produces": [ + "application/json" ], - "summary": "MarkNotificationAsUnread", - "responses": {} + "tags": [ + "notifications" + ], + "summary": "Mark Notification As Unread", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/payments": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the authenticated user's payment history", "produces": [ "application/json" @@ -11136,6 +18178,24 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -11168,6 +18228,12 @@ "description": "Fallback payment nonce", "name": "nonce", "in": "query" + }, + { + "type": "string", + "description": "Sessionid", + "name": "sessionID", + "in": "query" } ], "responses": { @@ -11176,6 +18242,12 @@ "schema": { "type": "string" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -11208,6 +18280,12 @@ "description": "Payment status", "name": "status", "in": "query" + }, + { + "type": "string", + "description": "Tx ref", + "name": "tx_ref", + "in": "query" } ], "responses": { @@ -11216,12 +18294,29 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/payments/chapa/direct": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Starts a Chapa Direct Charge (USSD push or OTP) for a subscription plan without hosted checkout redirect.", "consumes": [ "application/json" @@ -11257,6 +18352,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11268,6 +18375,11 @@ }, "/api/v1/payments/chapa/direct/authorize": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Completes OTP authorization for Chapa direct charge methods that require it.", "consumes": [ "application/json" @@ -11303,6 +18415,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11374,12 +18498,23 @@ "schema": { "type": "string" } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/payments/direct": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a payment session and initiates direct payment (OTP-based)", "consumes": [ "application/json" @@ -11415,6 +18550,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11446,6 +18593,11 @@ }, "/api/v1/payments/direct/verify-otp": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Verifies the OTP sent for direct payment methods (Amole, HelloCash, etc.)", "consumes": [ "application/json" @@ -11481,6 +18633,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11512,6 +18676,11 @@ }, "/api/v1/payments/subscribe": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a payment session for a subscription plan", "consumes": [ "application/json" @@ -11547,6 +18716,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11558,6 +18739,11 @@ }, "/api/v1/payments/verify/{session_id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Checks the payment status with the payment provider", "produces": [ "application/json" @@ -11588,6 +18774,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11601,6 +18799,7 @@ "post": { "description": "Processes payment notifications from Chapa (charge.success, etc.)", "consumes": [ + "application/json", "application/json" ], "produces": [ @@ -11610,6 +18809,29 @@ "payments" ], "summary": "Handle Chapa webhook", + "parameters": [ + { + "description": "Exact signed Chapa webhook payload", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.ChapaWebhookPayload" + } + }, + { + "type": "string", + "description": "Webhook HMAC signature. Alternatively send chapa-signature; one of these headers is required.", + "name": "x-chapa-signature", + "in": "header" + }, + { + "type": "string", + "description": "Alternative signature header", + "name": "chapa-signature", + "in": "header" + } + ], "responses": { "200": { "description": "OK", @@ -11622,12 +18844,29 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Authentication failed", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/payments/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns details of a specific payment", "produces": [ "application/json" @@ -11652,6 +18891,24 @@ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11663,6 +18920,11 @@ }, "/api/v1/payments/{id}/cancel": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Cancels a payment that is still pending", "produces": [ "application/json" @@ -11692,12 +18954,32 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } } } } }, "/api/v1/personas": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -11723,11 +19005,50 @@ "in": "query" } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/personas/{id}": { "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], "tags": [ "personas" ], @@ -11741,14 +19062,59 @@ "required": true } ], - "responses": {} + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } }, "/api/v1/questions/audio-answer": { "post": { + "security": [ + { + "Bearer": [] + } + ], "consumes": [ "multipart/form-data" ], + "produces": [ + "application/json" + ], "tags": [ "questions" ], @@ -11782,12 +19148,47 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/ratings": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns paginated ratings for a specific target", "produces": [ "application/json" @@ -11837,6 +19238,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11846,6 +19259,11 @@ } }, "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Submit a rating for an app, course, or sub-course", "consumes": [ "application/json" @@ -11881,6 +19299,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11892,6 +19322,11 @@ }, "/api/v1/ratings/me": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the current user's rating for a specific target", "produces": [ "application/json" @@ -11929,6 +19364,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -11946,6 +19393,11 @@ }, "/api/v1/ratings/me/all": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all ratings submitted by the current user", "produces": [ "application/json" @@ -11961,6 +19413,18 @@ "$ref": "#/definitions/domain.Response" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -11972,6 +19436,11 @@ }, "/api/v1/ratings/summary": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the total count and average stars for a specific target", "produces": [ "application/json" @@ -12009,6 +19478,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12020,6 +19501,11 @@ }, "/api/v1/ratings/{id}": { "delete": { + "security": [ + { + "Bearer": [] + } + ], "description": "Deletes a rating by ID for the current user", "produces": [ "application/json" @@ -12050,6 +19536,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12066,11 +19564,77 @@ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns only the authenticated learner's referral history and conversion flags. Referred learners' names, emails, and phone numbers are not exposed.", + "produces": [ + "application/json" ], - "summary": "ListMyReferrals", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "List My Referrals", + "parameters": [ + { + "maximum": 100, + "minimum": 1, + "type": "integer", + "default": 20, + "description": "Page size", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Number of entries to skip", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralHistoryData" + } + } + } + ] + } + }, + "400": { + "description": "Invalid pagination", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/apply": { @@ -12080,11 +19644,60 @@ "Bearer": [] } ], - "tags": [ - "client" + "description": "Attributes the authenticated learner to one referrer. Apply within seven days of account creation and before any successful positive payment. Codes are case-insensitive and surrounding whitespace is ignored. Self referral, reassignment, inactive referrers, and invalid codes are rejected.", + "consumes": [ + "application/json" ], - "summary": "ApplyReferralCode", - "responses": {} + "produces": [ + "application/json" + ], + "tags": [ + "referrals" + ], + "summary": "Apply Referral Code", + "parameters": [ + { + "description": "Referral share code", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/handlers.applyReferralReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Response" + } + }, + "400": { + "description": "Invalid request or ineligible referral", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/code": { @@ -12094,18 +19707,105 @@ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns the authenticated learner's stable share code, creating it when necessary. Codes are case-insensitive.", + "produces": [ + "application/json" ], - "summary": "GetReferralCode", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get Referral Code", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralCodeData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } }, "post": { - "tags": [ - "client" + "security": [ + { + "Bearer": [] + } ], - "summary": "CreateReferralCode", - "responses": {} + "description": "Creates or returns the authenticated learner's stable share code. Requires an active STUDENT or OPEN_LEARNER account; a subscription is not required.", + "produces": [ + "application/json" + ], + "tags": [ + "referrals" + ], + "summary": "Create Referral Code", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralCodeData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/me": { @@ -12115,11 +19815,52 @@ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns the learner's code, current commission percentage, referral/conversion counts, and commission-wallet balances by currency.", + "produces": [ + "application/json" ], - "summary": "GetMyReferrals", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get My Referrals", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralOverviewData" + } + } + } + ] + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/referrals/wallet": { @@ -12129,11 +19870,77 @@ "Bearer": [] } ], - "tags": [ - "client" + "description": "Returns wallet balances separately by currency and a paginated commission ledger. Decimal amounts and percentages are strings. Only the first successful positive subscription payment earns a commission; duplicate callbacks and renewals do not. Reversed credits are excluded from balances. This endpoint does not initiate cash payouts.", + "produces": [ + "application/json" ], - "summary": "GetReferralWallet", - "responses": {} + "tags": [ + "referrals" + ], + "summary": "Get Referral Wallet", + "parameters": [ + { + "maximum": 100, + "minimum": 1, + "type": "integer", + "default": 20, + "description": "Page size", + "name": "limit", + "in": "query" + }, + { + "minimum": 0, + "type": "integer", + "default": 0, + "description": "Number of entries to skip", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ReferralWalletData" + } + } + } + ] + } + }, + "400": { + "description": "Invalid pagination", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Unable to process referral request", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/subscription-plans": { @@ -12149,7 +19956,8 @@ "parameters": [ { "type": "boolean", - "description": "Return only active plans (default true)", + "default": true, + "description": "Customer requests always return active plans; false is honored only by the admin endpoint", "name": "active_only", "in": "query" }, @@ -12208,6 +20016,12 @@ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "404": { "description": "Not Found", "schema": { @@ -12219,6 +20033,11 @@ }, "/api/v1/subscriptions": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Creates a new subscription for the authenticated user. For regular users, use /payments/subscribe instead.", "consumes": [ "application/json" @@ -12255,6 +20074,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12266,6 +20097,11 @@ }, "/api/v1/subscriptions/checkout": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Initiates payment for a subscription plan. Returns payment URL for checkout.", "consumes": [ "application/json" @@ -12301,6 +20137,24 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "409": { "description": "User already has active subscription", "schema": { @@ -12318,6 +20172,11 @@ }, "/api/v1/subscriptions/history": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the authenticated user's subscription history", "produces": [ "application/json" @@ -12348,12 +20207,35 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/subscriptions/me": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns all active subscriptions for the authenticated user (one per plan category)", "produces": [ "application/json" @@ -12368,12 +20250,35 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/subscriptions/request-checkout-link": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Sends the standalone web checkout URL to the learner by email or SMS (registration channel). Intended when mobile clients show a subscription-required state.", "consumes": [ "application/json" @@ -12408,6 +20313,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "409": { "description": "Conflict", "schema": { @@ -12420,6 +20337,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "503": { "description": "Service Unavailable", "schema": { @@ -12431,6 +20354,11 @@ }, "/api/v1/subscriptions/status": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns whether the authenticated user has an active subscription", "produces": [ "application/json" @@ -12445,12 +20373,35 @@ "schema": { "$ref": "#/definitions/domain.Response" } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } }, "/api/v1/subscriptions/{id}/auto-renew": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Enables or disables auto-renewal for a subscription", "consumes": [ "application/json" @@ -12487,6 +20438,30 @@ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12498,6 +20473,11 @@ }, "/api/v1/subscriptions/{id}/cancel": { "post": { + "security": [ + { + "Bearer": [] + } + ], "description": "Cancels the user's subscription", "produces": [ "application/json" @@ -12522,6 +20502,30 @@ "$ref": "#/definitions/domain.Response" } }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -12533,6 +20537,11 @@ }, "/api/v1/user": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates user profile information (partial updates supported)", "consumes": [ "application/json" @@ -12545,13 +20554,6 @@ ], "summary": "Update user profile", "parameters": [ - { - "type": "integer", - "description": "User ID", - "name": "user_id", - "in": "path", - "required": true - }, { "description": "Update user payload", "name": "body", @@ -12575,6 +20577,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -12638,6 +20652,11 @@ }, "/api/v1/user/knowledge-level": { "put": { + "security": [ + { + "Bearer": [] + } + ], "description": "Updates the authenticated learner's self-reported knowledge level.", "consumes": [ "application/json" @@ -12679,6 +20698,12 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -12782,7 +20807,7 @@ }, "/api/v1/user/register": { "post": { - "description": "Register user", + "description": "Registers a learner with email or phone and password. The server assigns the learner role and selects the OTP medium from the contact method. An optional referral_code attributes the new account atomically; invalid or ineligible codes reject registration.", "consumes": [ "application/json" ], @@ -13041,6 +21066,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -13143,6 +21180,18 @@ "$ref": "#/definitions/response.APIResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -13154,6 +21203,11 @@ }, "/api/v1/user/{user_id}/is-profile-completed": { "get": { + "security": [ + { + "Bearer": [] + } + ], "description": "Returns the profile completion status and percentage for the specified user", "consumes": [ "application/json" @@ -13187,6 +21241,18 @@ "$ref": "#/definitions/domain.ErrorResponse" } }, + "401": { + "description": "Missing, invalid, or expired Bearer token", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Account audience, status, permission, or subscription does not allow this operation", + "schema": { + "type": "string" + } + }, "404": { "description": "Not Found", "schema": { @@ -13218,8 +21284,8 @@ "parameters": [ { "type": "string", - "description": "User ID", - "name": "user_id", + "description": "User name", + "name": "user_name", "in": "path", "required": true } @@ -13304,6 +21370,12 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -13356,6 +21428,12 @@ "schema": { "$ref": "#/definitions/domain.ErrorResponse" } + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } } } } @@ -13363,9 +21441,9 @@ "/api/v1/ws/connect": { "get": { "tags": [ - "client" + "ws" ], - "summary": "ConnectSocket", + "summary": "Connect Socket", "parameters": [ { "type": "string", @@ -13375,7 +21453,72 @@ "required": true } ], - "responses": {} + "responses": { + "101": { + "description": "WebSocket protocol upgrade; subsequent messages are notification events", + "schema": { + "type": "string" + } + }, + "401": { + "description": "Authentication failed", + "schema": { + "type": "string" + } + } + } + } + }, + "/payment/success": { + "get": { + "description": "Displays the Rezina success page after Chapa redirects the learner to return_url", + "produces": [ + "text/html" + ], + "tags": [ + "payments" + ], + "summary": "Chapa payment success page", + "parameters": [ + { + "type": "string", + "description": "Chapa transaction reference (tx_ref)", + "name": "trx_ref", + "in": "query" + }, + { + "type": "string", + "description": "Chapa transaction reference", + "name": "tx_ref", + "in": "query" + }, + { + "type": "string", + "description": "Chapa reference ID", + "name": "ref_id", + "in": "query" + }, + { + "type": "string", + "description": "Payment status from Chapa redirect", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "HTML success page", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } } } }, @@ -14407,6 +22550,49 @@ } } }, + "domain.ChapaWebhookPayload": { + "type": "object", + "properties": { + "amount": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "event": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tx_ref": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "domain.CompletePracticeInput": { + "type": "object", + "properties": { + "parent_id": { + "type": "integer" + }, + "parent_kind": { + "type": "string" + } + } + }, "domain.CreateCourseInput": { "type": "object", "required": [ @@ -14989,6 +23175,21 @@ } } }, + "domain.DeliveryChannel": { + "type": "string", + "enum": [ + "email", + "sms", + "push", + "in_app" + ], + "x-enum-varnames": [ + "DeliveryChannelEmail", + "DeliveryChannelSMS", + "DeliveryChannelPush", + "DeliveryChannelInApp" + ] + }, "domain.DynamicElementDefinition": { "type": "object", "properties": { @@ -15397,6 +23598,31 @@ } } }, + "domain.LinkExamPrepAssessmentInput": { + "type": "object", + "required": [ + "parent_id", + "parent_kind", + "question_set_id" + ], + "properties": { + "parent_id": { + "type": "integer" + }, + "parent_kind": { + "type": "string", + "enum": [ + "CATALOG_COURSE", + "UNIT", + "MODULE", + "LESSON" + ] + }, + "question_set_id": { + "type": "integer" + } + } + }, "domain.LogEntry": { "type": "object", "properties": { @@ -15461,15 +23687,122 @@ } } }, - "domain.OtpMedium": { + "domain.NotificationDeliveryScheme": { "type": "string", "enum": [ - "email", - "sms" + "bulk", + "single" ], "x-enum-varnames": [ - "OtpMediumEmail", - "OtpMediumSms" + "NotificationDeliverySchemeBulk", + "NotificationDeliverySchemeSingle" + ] + }, + "domain.NotificationErrorSeverity": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical", + "fatal" + ], + "x-enum-varnames": [ + "NotificationErrorSeverityLow", + "NotificationErrorSeverityMedium", + "NotificationErrorSeverityHigh", + "NotificationErrorSeverityCritical", + "NotificationErrorSeverityFatal" + ] + }, + "domain.NotificationLevel": { + "type": "string", + "enum": [ + "info", + "error", + "warning", + "success" + ], + "x-enum-varnames": [ + "NotificationLevelInfo", + "NotificationLevelError", + "NotificationLevelWarning", + "NotificationLevelSuccess" + ] + }, + "domain.NotificationPayload": { + "type": "object", + "properties": { + "headline": { + "type": "string" + }, + "message": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "domain.NotificationRecieverSide": { + "type": "string", + "enum": [ + "admin", + "customer", + "cashier", + "branch_manager", + "team_member" + ], + "x-enum-varnames": [ + "NotificationRecieverSideAdmin", + "NotificationRecieverSideCustomer", + "NotificationRecieverSideCashier", + "NotificationRecieverSideBranchManager", + "NotificationRecieverSideTeamMember" + ] + }, + "domain.NotificationType": { + "type": "string", + "enum": [ + "knowledge_level_update", + "payment_verified", + "subscription_activated", + "course_created", + "sub_course_created", + "video_added", + "issue_status_updated", + "issue_created", + "admin_created", + "team_member_created", + "user_deleted", + "system_alert", + "user_welcome", + "module_completed", + "course_completed", + "program_completed", + "subscription_expiring" + ], + "x-enum-varnames": [ + "NOTIFICATION_TYPE_KNOWLEDGE_LEVEL_UPDATE", + "NOTIFICATION_TYPE_PAYMENT_VERIFIED", + "NOTIFICATION_TYPE_SUBSCRIPTION_ACTIVATED", + "NOTIFICATION_TYPE_COURSE_CREATED", + "NOTIFICATION_TYPE_SUB_COURSE_CREATED", + "NOTIFICATION_TYPE_VIDEO_ADDED", + "NOTIFICATION_TYPE_ISSUE_STATUS_UPDATED", + "NOTIFICATION_TYPE_ISSUE_CREATED", + "NOTIFICATION_TYPE_ADMIN_CREATED", + "NOTIFICATION_TYPE_TEAM_MEMBER_CREATED", + "NOTIFICATION_TYPE_USER_DELETED", + "NOTIFICATION_TYPE_SYSTEM_ALERT", + "NOTIFICATION_TYPE_USER_WELCOME", + "NOTIFICATION_TYPE_MODULE_COMPLETED", + "NOTIFICATION_TYPE_COURSE_COMPLETED", + "NOTIFICATION_TYPE_PROGRAM_COMPLETED", + "NOTIFICATION_TYPE_SUBSCRIPTION_EXPIRING" ] }, "domain.Pagination": { @@ -15607,9 +23940,6 @@ "email": { "type": "string" }, - "otp_medium": { - "$ref": "#/definitions/domain.OtpMedium" - }, "password": { "type": "string" }, @@ -15617,10 +23947,8 @@ "type": "string" }, "referral_code": { - "type": "string" - }, - "role": { - "type": "string" + "type": "string", + "example": "ABCDEF0123456789" } } }, @@ -15735,6 +24063,77 @@ } } }, + "domain.SaveSettingListReq": { + "type": "object", + "properties": { + "amount_for_bet_referral": { + "type": "number" + }, + "bet_amount_limit": { + "type": "number" + }, + "bet_duplicate_limit": { + "type": "integer" + }, + "cashback_amount_cap": { + "type": "number" + }, + "cashback_percentage": { + "type": "number" + }, + "daily_ticket_limit": { + "type": "integer" + }, + "default_max_referrals": { + "type": "integer" + }, + "default_winning_limit": { + "type": "integer" + }, + "max_number_of_outcomes": { + "type": "integer" + }, + "max_unsettled_bets": { + "type": "integer" + }, + "minimum_bet_amount": { + "type": "number" + }, + "referral_reward_amount": { + "type": "number" + }, + "send_email_on_bet_finish": { + "type": "boolean" + }, + "send_sms_on_bet_finish": { + "type": "boolean" + }, + "sms_provider": { + "type": "string" + }, + "total_winning_limit": { + "type": "number" + }, + "total_winning_notify": { + "type": "number" + }, + "welcome_bonus_active": { + "type": "boolean" + }, + "welcome_bonus_cap": { + "type": "number" + }, + "welcome_bonus_count": { + "type": "integer" + }, + "welcome_bonus_expiry": { + "type": "integer" + }, + "welcome_bonus_multiplier": { + "type": "number" + } + } + }, "domain.SetRolePermissionsReq": { "type": "object", "required": [ @@ -15996,6 +24395,82 @@ } } }, + "domain.UpdateExamPrepLessonInput": { + "type": "object", + "properties": { + "access_tier": { + "type": "string", + "enum": [ + "FREE", + "free", + "PREMIUM", + "premium" + ] + }, + "description": { + "type": "string" + }, + "publish_status": { + "type": "string", + "enum": [ + "DRAFT", + "draft", + "PUBLISHED", + "published" + ] + }, + "sort_order": { + "type": "integer" + }, + "thumbnail": { + "type": "string" + }, + "title": { + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "domain.UpdateExamPrepModuleInput": { + "type": "object", + "properties": { + "access_tier": { + "type": "string", + "enum": [ + "FREE", + "free", + "PREMIUM", + "premium" + ] + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "name": { + "type": "string" + }, + "publish_status": { + "type": "string", + "enum": [ + "DRAFT", + "draft", + "PUBLISHED", + "published" + ] + }, + "sort_order": { + "type": "integer" + }, + "thumbnail": { + "type": "string" + } + } + }, "domain.UpdateExamPrepPracticeInput": { "type": "object", "properties": { @@ -16910,6 +25385,9 @@ } } }, + "handlers.CreateAndSendNotification.Request": { + "type": "object" + }, "handlers.CreatePullUploadRequest": { "type": "object", "required": [ @@ -16964,6 +25442,194 @@ } } }, + "handlers.NotificationDispatchResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "notification_id": { + "type": "string" + }, + "notification_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "recipient_count": { + "type": "integer" + } + } + }, + "handlers.ReferralCodeData": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "example": "ABCDEF0123456789" + } + } + }, + "handlers.ReferralCommissionItem": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "51.25" + }, + "commission_percent": { + "type": "string", + "example": "10.25" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2026-10-28T09:00:00Z" + }, + "currency": { + "type": "string", + "example": "ETB" + }, + "id": { + "type": "integer", + "example": 7 + }, + "payment_id": { + "type": "integer", + "example": 42 + }, + "reversed_at": { + "description": "Null until the qualifying payment leaves SUCCESS; reversed credits no longer contribute to the balance.", + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "handlers.ReferralHistoryData": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralHistoryItem" + } + }, + "limit": { + "type": "integer", + "example": 20 + }, + "offset": { + "type": "integer", + "example": 0 + } + } + }, + "handlers.ReferralHistoryItem": { + "type": "object", + "properties": { + "converted": { + "type": "boolean", + "example": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2026-10-28T09:00:00Z" + }, + "id": { + "type": "integer", + "example": 14 + } + } + }, + "handlers.ReferralOverviewData": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "example": "ABCDEF0123456789" + }, + "commission_percent": { + "type": "string", + "example": "10.25" + }, + "converted_referrals": { + "type": "integer", + "example": 3 + }, + "total_referrals": { + "type": "integer", + "example": 12 + }, + "wallet": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralWalletBalance" + } + } + } + }, + "handlers.ReferralSettingsData": { + "type": "object", + "properties": { + "commission_percent": { + "type": "string", + "example": "10.25" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2026-10-28T09:00:00Z" + } + } + }, + "handlers.ReferralWalletBalance": { + "type": "object", + "properties": { + "balance": { + "description": "Decimal string; balances are not combined across currencies.", + "type": "string", + "example": "125.50" + }, + "currency": { + "type": "string", + "example": "ETB" + } + } + }, + "handlers.ReferralWalletData": { + "type": "object", + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralWalletBalance" + } + }, + "limit": { + "type": "integer", + "example": 20 + }, + "offset": { + "type": "integer", + "example": 0 + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ReferralCommissionItem" + } + } + } + }, "handlers.RegisterCodeReq": { "type": "object", "properties": { @@ -16977,6 +25643,26 @@ } } }, + "handlers.RegisterDeviceToken.Request": { + "type": "object", + "required": [ + "device_token", + "platform" + ], + "properties": { + "device_token": { + "type": "string" + }, + "platform": { + "type": "string", + "enum": [ + "android", + "ios", + "web" + ] + } + } + }, "handlers.ResetCodeReq": { "type": "object", "properties": { @@ -17044,6 +25730,17 @@ } } }, + "handlers.UnregisterDeviceToken.Request": { + "type": "object", + "required": [ + "device_token" + ], + "properties": { + "device_token": { + "type": "string" + } + } + }, "handlers.VimeoEmbedResponse": { "type": "object", "properties": { @@ -17202,6 +25899,18 @@ } } }, + "handlers.applyReferralReq": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "example": "ABCDEF0123456789" + } + } + }, "handlers.authorizeChapaDirectPaymentReq": { "type": "object", "required": [ @@ -18248,6 +26957,21 @@ "handlers.updateQuestionTypeDefinitionReq": { "type": "object" }, + "handlers.updateReferralSettingsReq": { + "type": "object", + "required": [ + "commission_percent" + ], + "properties": { + "commission_percent": { + "description": "Percentage of the first successful positive subscription payment, with at most two decimal places. Zero disables new commissions.", + "type": "number", + "maximum": 100, + "minimum": 0, + "example": 10.25 + } + } + }, "handlers.validateQuestionTypeDefinitionReq": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d9104715..b5245b7d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -681,6 +681,34 @@ definitions: exclude_team_member_id: type: integer type: object + domain.ChapaWebhookPayload: + properties: + amount: + type: string + currency: + type: string + event: + type: string + mode: + type: string + payment_method: + type: string + reference: + type: string + status: + type: string + tx_ref: + type: string + type: + type: string + type: object + domain.CompletePracticeInput: + properties: + parent_id: + type: integer + parent_kind: + type: string + type: object domain.CreateCourseInput: properties: access_tier: @@ -1110,6 +1138,18 @@ definitions: - password - team_role type: object + domain.DeliveryChannel: + enum: + - email + - sms + - push + - in_app + type: string + x-enum-varnames: + - DeliveryChannelEmail + - DeliveryChannelSMS + - DeliveryChannelPush + - DeliveryChannelInApp domain.DynamicElementDefinition: properties: config: @@ -1381,6 +1421,24 @@ definitions: total_count: type: integer type: object + domain.LinkExamPrepAssessmentInput: + properties: + parent_id: + type: integer + parent_kind: + enum: + - CATALOG_COURSE + - UNIT + - MODULE + - LESSON + type: string + question_set_id: + type: integer + required: + - parent_id + - parent_kind + - question_set_id + type: object domain.LogEntry: properties: caller: @@ -1423,14 +1481,103 @@ definitions: phone_number: type: string type: object - domain.OtpMedium: + domain.NotificationDeliveryScheme: enum: - - email - - sms + - bulk + - single type: string x-enum-varnames: - - OtpMediumEmail - - OtpMediumSms + - NotificationDeliverySchemeBulk + - NotificationDeliverySchemeSingle + domain.NotificationErrorSeverity: + enum: + - low + - medium + - high + - critical + - fatal + type: string + x-enum-varnames: + - NotificationErrorSeverityLow + - NotificationErrorSeverityMedium + - NotificationErrorSeverityHigh + - NotificationErrorSeverityCritical + - NotificationErrorSeverityFatal + domain.NotificationLevel: + enum: + - info + - error + - warning + - success + type: string + x-enum-varnames: + - NotificationLevelInfo + - NotificationLevelError + - NotificationLevelWarning + - NotificationLevelSuccess + domain.NotificationPayload: + properties: + headline: + type: string + message: + type: string + tags: + items: + type: string + type: array + type: object + domain.NotificationRecieverSide: + enum: + - admin + - customer + - cashier + - branch_manager + - team_member + type: string + x-enum-varnames: + - NotificationRecieverSideAdmin + - NotificationRecieverSideCustomer + - NotificationRecieverSideCashier + - NotificationRecieverSideBranchManager + - NotificationRecieverSideTeamMember + domain.NotificationType: + enum: + - knowledge_level_update + - payment_verified + - subscription_activated + - course_created + - sub_course_created + - video_added + - issue_status_updated + - issue_created + - admin_created + - team_member_created + - user_deleted + - system_alert + - user_welcome + - module_completed + - course_completed + - program_completed + - subscription_expiring + type: string + x-enum-varnames: + - NOTIFICATION_TYPE_KNOWLEDGE_LEVEL_UPDATE + - NOTIFICATION_TYPE_PAYMENT_VERIFIED + - NOTIFICATION_TYPE_SUBSCRIPTION_ACTIVATED + - NOTIFICATION_TYPE_COURSE_CREATED + - NOTIFICATION_TYPE_SUB_COURSE_CREATED + - NOTIFICATION_TYPE_VIDEO_ADDED + - NOTIFICATION_TYPE_ISSUE_STATUS_UPDATED + - NOTIFICATION_TYPE_ISSUE_CREATED + - NOTIFICATION_TYPE_ADMIN_CREATED + - NOTIFICATION_TYPE_TEAM_MEMBER_CREATED + - NOTIFICATION_TYPE_USER_DELETED + - NOTIFICATION_TYPE_SYSTEM_ALERT + - NOTIFICATION_TYPE_USER_WELCOME + - NOTIFICATION_TYPE_MODULE_COMPLETED + - NOTIFICATION_TYPE_COURSE_COMPLETED + - NOTIFICATION_TYPE_PROGRAM_COMPLETED + - NOTIFICATION_TYPE_SUBSCRIPTION_EXPIRING domain.Pagination: properties: current_page: @@ -1520,15 +1667,12 @@ definitions: properties: email: type: string - otp_medium: - $ref: '#/definitions/domain.OtpMedium' password: type: string phone_number: type: string referral_code: - type: string - role: + example: ABCDEF0123456789 type: string type: object domain.ReorderIDsRequest: @@ -1608,6 +1752,53 @@ definitions: updated_at: type: string type: object + domain.SaveSettingListReq: + properties: + amount_for_bet_referral: + type: number + bet_amount_limit: + type: number + bet_duplicate_limit: + type: integer + cashback_amount_cap: + type: number + cashback_percentage: + type: number + daily_ticket_limit: + type: integer + default_max_referrals: + type: integer + default_winning_limit: + type: integer + max_number_of_outcomes: + type: integer + max_unsettled_bets: + type: integer + minimum_bet_amount: + type: number + referral_reward_amount: + type: number + send_email_on_bet_finish: + type: boolean + send_sms_on_bet_finish: + type: boolean + sms_provider: + type: string + total_winning_limit: + type: number + total_winning_notify: + type: number + welcome_bonus_active: + type: boolean + welcome_bonus_cap: + type: number + welcome_bonus_count: + type: integer + welcome_bonus_expiry: + type: integer + welcome_bonus_multiplier: + type: number + type: object domain.SetRolePermissionsReq: properties: permission_ids: @@ -1792,6 +1983,60 @@ definitions: thumbnail: type: string type: object + domain.UpdateExamPrepLessonInput: + properties: + access_tier: + enum: + - FREE + - free + - PREMIUM + - premium + type: string + description: + type: string + publish_status: + enum: + - DRAFT + - draft + - PUBLISHED + - published + type: string + sort_order: + type: integer + thumbnail: + type: string + title: + type: string + video_url: + type: string + type: object + domain.UpdateExamPrepModuleInput: + properties: + access_tier: + enum: + - FREE + - free + - PREMIUM + - premium + type: string + description: + type: string + icon: + type: string + name: + type: string + publish_status: + enum: + - DRAFT + - draft + - PUBLISHED + - published + type: string + sort_order: + type: integer + thumbnail: + type: string + type: object domain.UpdateExamPrepPracticeInput: properties: authoring_profile: @@ -2414,6 +2659,8 @@ definitions: example: "1234567890" type: string type: object + handlers.CreateAndSendNotification.Request: + type: object handlers.CreatePullUploadRequest: properties: description: @@ -2450,6 +2697,139 @@ definitions: role: type: string type: object + handlers.NotificationDispatchResponse: + properties: + message: + type: string + notification_id: + type: string + notification_ids: + items: + type: string + type: array + recipient_count: + type: integer + type: object + handlers.ReferralCodeData: + properties: + code: + example: ABCDEF0123456789 + type: string + required: + - code + type: object + handlers.ReferralCommissionItem: + properties: + amount: + example: "51.25" + type: string + commission_percent: + example: "10.25" + type: string + created_at: + example: "2026-10-28T09:00:00Z" + format: date-time + type: string + currency: + example: ETB + type: string + id: + example: 7 + type: integer + payment_id: + example: 42 + type: integer + reversed_at: + description: Null until the qualifying payment leaves SUCCESS; reversed credits + no longer contribute to the balance. + format: date-time + type: string + x-nullable: true + type: object + handlers.ReferralHistoryData: + properties: + items: + items: + $ref: '#/definitions/handlers.ReferralHistoryItem' + type: array + limit: + example: 20 + type: integer + offset: + example: 0 + type: integer + type: object + handlers.ReferralHistoryItem: + properties: + converted: + example: true + type: boolean + created_at: + example: "2026-10-28T09:00:00Z" + format: date-time + type: string + id: + example: 14 + type: integer + type: object + handlers.ReferralOverviewData: + properties: + code: + example: ABCDEF0123456789 + type: string + commission_percent: + example: "10.25" + type: string + converted_referrals: + example: 3 + type: integer + total_referrals: + example: 12 + type: integer + wallet: + items: + $ref: '#/definitions/handlers.ReferralWalletBalance' + type: array + required: + - code + type: object + handlers.ReferralSettingsData: + properties: + commission_percent: + example: "10.25" + type: string + updated_at: + example: "2026-10-28T09:00:00Z" + format: date-time + type: string + type: object + handlers.ReferralWalletBalance: + properties: + balance: + description: Decimal string; balances are not combined across currencies. + example: "125.50" + type: string + currency: + example: ETB + type: string + type: object + handlers.ReferralWalletData: + properties: + balances: + items: + $ref: '#/definitions/handlers.ReferralWalletBalance' + type: array + limit: + example: 20 + type: integer + offset: + example: 0 + type: integer + transactions: + items: + $ref: '#/definitions/handlers.ReferralCommissionItem' + type: array + type: object handlers.RegisterCodeReq: properties: email: @@ -2459,6 +2839,20 @@ definitions: example: "1234567890" type: string type: object + handlers.RegisterDeviceToken.Request: + properties: + device_token: + type: string + platform: + enum: + - android + - ios + - web + type: string + required: + - device_token + - platform + type: object handlers.ResetCodeReq: properties: email: @@ -2506,6 +2900,13 @@ definitions: - message - recipient type: object + handlers.UnregisterDeviceToken.Request: + properties: + device_token: + type: string + required: + - device_token + type: object handlers.VimeoEmbedResponse: properties: embed_html: @@ -2614,6 +3015,14 @@ definitions: required: - plan_id type: object + handlers.applyReferralReq: + properties: + code: + example: ABCDEF0123456789 + type: string + required: + - code + type: object handlers.authorizeChapaDirectPaymentReq: properties: otp: @@ -3317,6 +3726,18 @@ definitions: type: object handlers.updateQuestionTypeDefinitionReq: type: object + handlers.updateReferralSettingsReq: + properties: + commission_percent: + description: Percentage of the first successful positive subscription payment, + with at most two decimal places. Zero disables new commissions. + example: 10.25 + maximum: 100 + minimum: 0 + type: number + required: + - commission_percent + type: object handlers.validateQuestionTypeDefinitionReq: properties: response_component_kinds: @@ -3400,14 +3821,11 @@ definitions: type: object info: contact: - email: support@swagger.io name: API Support - url: http://www.swagger.io/support - description: This is server for Rezina. - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - termsOfService: http://swagger.io/terms/ + description: Rezina LMS API. Admin panel endpoints use /api/v1/admin; customer web + and mobile endpoints retain /api/v1. Use the audience-specific Swagger pages to + browse each API. For protected endpoints, enter Bearer followed by a space and + the access token in Authorize. title: Rezina API version: 1.0.1 paths: @@ -3449,6 +3867,10 @@ paths: in: query name: offset type: integer + - description: Search + in: query + name: search + type: string produces: - application/json responses: @@ -3460,10 +3882,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get activity logs tags: - activity-logs @@ -3487,10 +3920,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get activity log by ID tags: - activity-logs @@ -3498,7 +3942,27 @@ paths: get: produces: - text/csv - responses: {} + - text/csv + responses: + "200": + description: CSV export; filename is supplied in Content-Disposition + schema: + type: file + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Export activity logs as CSV (admin) tags: - activity-logs @@ -3516,6 +3980,22 @@ paths: in: query name: page_size type: integer + - description: Query + in: query + name: query + type: string + - description: Created before + in: query + name: created_before + type: string + - description: Created after + in: query + name: created_after + type: string + - description: Company id + in: query + name: company_id + type: integer produces: - application/json responses: @@ -3531,13 +4011,20 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Get all Admins tags: - - admin + - admins post: consumes: - application/json @@ -3564,13 +4051,20 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Create Admin tags: - - admin + - admins /api/v1/admin/admins/{id}: get: consumes: @@ -3597,13 +4091,20 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Get admin by id tags: - - admin + - admins put: consumes: - application/json @@ -3615,6 +4116,12 @@ paths: required: true schema: $ref: '#/definitions/handlers.updateAdminReq' + - description: Id + format: int64 + in: path + name: id + required: true + type: integer produces: - application/json responses: @@ -3630,13 +4137,20 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Update Admin tags: - - admin + - admins /api/v1/admin/admins/roles/{role}/bulk-deactivate: post: consumes: @@ -3671,6 +4185,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string "403": description: Forbidden schema: @@ -3688,7 +4206,7 @@ paths: summary: Bulk deactivate accounts by role (SUPER_ADMIN or ADMIN platform users only) tags: - - admin + - admins /api/v1/admin/admins/roles/{role}/bulk-reactivate: post: consumes: @@ -3723,6 +4241,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string "403": description: Forbidden schema: @@ -3740,7 +4262,7 @@ paths: summary: Bulk reactivate accounts by role (SUPER_ADMIN or ADMIN platform users only) tags: - - admin + - admins /api/v1/admin/analytics/dashboard: get: description: 'Platform analytics with optional date filters in Africa/Addis_Ababa @@ -3782,10 +4304,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Analytics dashboard tags: - analytics @@ -3819,6 +4352,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -3849,6 +4391,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -3877,6 +4428,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -3908,6 +4468,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -3947,6 +4516,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -3987,6 +4565,10 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Access denied + schema: + type: string "500": description: Internal Server Error schema: @@ -4021,6 +4603,10 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Access denied + schema: + type: string "500": description: Internal Server Error schema: @@ -4030,20 +4616,84 @@ paths: - auth /api/v1/admin/devices/register: post: - responses: {} + consumes: + - application/json + parameters: + - description: Device token and platform + in: body + name: body + required: true + schema: + $ref: '#/definitions/handlers.RegisterDeviceToken.Request' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: RegisterDeviceToken + summary: Register Device Token tags: - - client + - devices /api/v1/admin/devices/unregister: post: - responses: {} + consumes: + - application/json + parameters: + - description: Device token to unregister + in: body + name: body + required: true + schema: + $ref: '#/definitions/handlers.UnregisterDeviceToken.Request' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: UnregisterDeviceToken + summary: Unregister Device Token tags: - - client + - devices /api/v1/admin/email-templates: get: description: Returns email templates for admin management @@ -4075,10 +4725,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List email templates (admin) tags: - email-templates @@ -4104,10 +4765,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create email template tags: - email-templates @@ -4131,6 +4803,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -4139,6 +4820,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete email template tags: - email-templates @@ -4161,6 +4844,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -4169,6 +4861,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get email template by ID (admin) tags: - email-templates @@ -4199,6 +4893,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -4207,6 +4910,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update email template tags: - email-templates @@ -4238,6 +4943,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -4246,6 +4960,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Preview email template by ID tags: - email-templates @@ -4269,6 +4985,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -4277,6 +5002,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get email template by slug (admin) tags: - email-templates @@ -4308,6 +5035,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -4316,32 +5052,126 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Preview email template by slug tags: - email-templates /api/v1/admin/exam-prep/assessments: get: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string security: - Bearer: [] - summary: ListExamPrepAssessments + summary: List Exam Prep Assessments tags: - - client + - exam-prep post: - responses: {} + consumes: + - application/json + parameters: + - description: Request payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/domain.LinkExamPrepAssessmentInput' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string security: - Bearer: [] - summary: LinkExamPrepAssessment + summary: Link Exam Prep Assessment tags: - - admin + - exam-prep /api/v1/admin/exam-prep/assessments/{questionSetId}/parents/{parentKind}/{parentId}: delete: - responses: {} + parameters: + - description: Parent id + format: int64 + in: path + name: parentId + required: true + type: integer + - description: Parent kind + in: path + name: parentKind + required: true + type: string + - description: Question set id + format: int64 + in: path + name: questionSetId + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: UnlinkExamPrepAssessment + summary: Unlink Exam Prep Assessment tags: - - admin + - exam-prep /api/v1/admin/exam-prep/catalog-courses: get: parameters: @@ -4362,6 +5192,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep catalog courses tags: - exam-prep @@ -4388,6 +5233,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create exam-prep catalog course tags: - exam-prep @@ -4407,7 +5267,32 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices for a catalog course tags: - exam-prep @@ -4424,7 +5309,32 @@ paths: required: true schema: $ref: '#/definitions/domain.CreateExamPrepPracticeInput' - responses: {} + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create exam-prep practice under a catalog course tags: - exam-prep @@ -4446,11 +5356,36 @@ paths: in: query name: offset type: integer + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep units for a catalog course tags: - exam-prep @@ -4480,6 +5415,29 @@ paths: description: Created schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create exam-prep unit tags: - exam-prep @@ -4497,7 +5455,36 @@ paths: required: true schema: $ref: '#/definitions/domain.ReorderIDsRequest' - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Reorder units within a catalog course tags: - exam-prep @@ -4509,11 +5496,36 @@ paths: name: id required: true type: integer + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete exam-prep catalog course tags: - exam-prep @@ -4531,6 +5543,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep catalog course by ID tags: - exam-prep @@ -4556,6 +5591,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update exam-prep catalog course tags: - exam-prep @@ -4577,22 +5635,157 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Reorder all exam-prep catalog courses tags: - exam-prep /api/v1/admin/exam-prep/lessons/{id}: delete: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete exam-prep lesson tags: - exam-prep get: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep lesson by ID tags: - exam-prep put: - responses: {} + consumes: + - application/json + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + - description: Request payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/domain.UpdateExamPrepLessonInput' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update exam-prep lesson tags: - exam-prep @@ -4612,23 +5805,164 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices for a lesson tags: - exam-prep /api/v1/admin/exam-prep/modules/{id}: delete: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete exam-prep module tags: - exam-prep get: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep module by ID tags: - exam-prep put: - responses: {} + consumes: + - application/json + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + - description: Request payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/domain.UpdateExamPrepModuleInput' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update exam-prep module tags: - exam-prep @@ -4650,7 +5984,36 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep lessons for a unit module tags: - exam-prep @@ -4667,13 +6030,86 @@ paths: required: true schema: $ref: '#/definitions/domain.CreateExamPrepLessonInput' - responses: {} + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create exam-prep lesson (under a unit module) tags: - exam-prep /api/v1/admin/exam-prep/modules/{moduleId}/lessons/reorder: put: - responses: {} + consumes: + - application/json + parameters: + - description: Module id + format: int64 + in: path + name: moduleId + required: true + type: integer + - description: Request payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/domain.ReorderIDsRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Reorder lessons within an exam-prep unit module tags: - exam-prep @@ -4693,7 +6129,32 @@ paths: in: query name: unlinked_only type: boolean - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices globally tags: - exam-prep @@ -4705,7 +6166,32 @@ paths: required: true schema: $ref: '#/definitions/domain.CreateExamPrepPracticeInput' - responses: {} + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create exam-prep practice (optional parents; link later via PUT /exam-prep/practices/:id/parents) tags: - exam-prep @@ -4717,7 +6203,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete exam-prep practice tags: - exam-prep @@ -4728,7 +6243,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep practice by ID tags: - exam-prep @@ -4745,7 +6289,36 @@ paths: required: true schema: $ref: '#/definitions/domain.UpdateExamPrepPracticeInput' - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update exam-prep practice tags: - exam-prep @@ -4770,10 +6343,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep practice with question set and questions tags: - exam-prep @@ -4805,10 +6393,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Full update exam-prep practice with question set and questions tags: - exam-prep @@ -4826,7 +6429,36 @@ paths: required: true schema: $ref: '#/definitions/domain.UpdateExamPrepPracticeParentsInput' - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Replace exam-prep practice parent links tags: - exam-prep @@ -4848,7 +6480,36 @@ paths: name: parentId required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Unlink one exam-prep practice parent tags: - exam-prep @@ -4860,7 +6521,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete exam-prep unit tags: - exam-prep @@ -4871,7 +6561,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep unit by ID tags: - exam-prep @@ -4888,7 +6607,36 @@ paths: required: true schema: $ref: '#/definitions/domain.UpdateExamPrepUnitInput' - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update exam-prep unit tags: - exam-prep @@ -4900,7 +6648,47 @@ paths: name: unitId required: true type: integer - responses: {} + - default: 20 + description: Limit + in: query + name: limit + type: integer + - default: 0 + description: Offset + in: query + minimum: 0 + name: offset + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep modules for a unit tags: - exam-prep @@ -4917,7 +6705,36 @@ paths: required: true schema: $ref: '#/definitions/domain.CreateExamPrepModuleInput' - responses: {} + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create exam-prep module tags: - exam-prep @@ -4935,7 +6752,36 @@ paths: required: true schema: $ref: '#/definitions/domain.ReorderIDsRequest' - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Reorder modules within a unit tags: - exam-prep @@ -4955,7 +6801,32 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices for a unit tags: - exam-prep @@ -4972,7 +6843,32 @@ paths: required: true schema: $ref: '#/definitions/domain.CreateExamPrepPracticeInput' - responses: {} + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create exam-prep practice under a unit tags: - exam-prep @@ -5007,10 +6903,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List FAQs (admin) tags: - faqs @@ -5036,10 +6943,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create FAQ tags: - faqs @@ -5063,6 +6981,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -5071,6 +6998,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete FAQ tags: - faqs @@ -5093,6 +7022,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -5101,6 +7039,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get FAQ by ID (admin) tags: - faqs @@ -5131,6 +7071,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -5139,6 +7088,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update FAQ tags: - faqs @@ -5168,6 +7119,17 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: List field options (admin) tags: - field-options @@ -5188,6 +7150,21 @@ paths: description: Created schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Create field option (admin) tags: - field-options @@ -5206,6 +7183,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete field option (admin) tags: - field-options @@ -5223,6 +7223,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Get field option by ID (admin) tags: - field-options @@ -5248,6 +7263,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Update field option (admin) tags: - field-options @@ -5261,11 +7291,36 @@ paths: name: file required: true type: file + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Upload an audio file tags: - files @@ -5289,6 +7344,33 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Complete presigned MinIO upload tags: - files @@ -5312,6 +7394,29 @@ paths: description: Created schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create presigned MinIO upload URL tags: - files @@ -5333,6 +7438,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Refresh presigned URL for a file tags: - files @@ -5351,11 +7479,36 @@ paths: name: file required: true type: file + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Upload media file tags: - files @@ -5367,11 +7520,36 @@ paths: name: key required: true type: string + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get presigned URL for a file tags: - files @@ -5394,6 +7572,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -5429,6 +7616,15 @@ paths: data: $ref: '#/definitions/handlers.issueListRes' type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -5458,6 +7654,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -5491,6 +7696,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -5528,6 +7742,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -5572,6 +7795,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -5616,28 +7848,92 @@ paths: description: Invalid request parameters schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Staff account and logs.list permission required + schema: + type: string "500": description: Internal server error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Retrieve application logs with filtering and pagination tags: - Logs /api/v1/admin/notifications: delete: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: DeleteUserNotifications + summary: Delete User Notifications tags: - - client + - notifications get: - responses: {} + parameters: + - default: 10 + description: Limit + in: query + name: limit + type: integer + - default: 0 + description: Offset + in: query + minimum: 0 + name: offset + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: GetUserNotification + summary: Get User Notification tags: - - client + - notifications /api/v1/admin/notifications/{id}: delete: description: Deletes one in-app notification owned by the authenticated user. @@ -5658,6 +7954,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -5666,6 +7971,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a single in-app notification tags: - notifications @@ -5689,6 +7996,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string "403": description: Forbidden schema: @@ -5701,41 +8012,20 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get in-app notification by ID tags: - notifications /api/v1/admin/notifications/{id}/read: patch: - responses: {} - security: - - Bearer: [] - summary: MarkNotificationAsRead - tags: - - client - /api/v1/admin/notifications/{id}/unread: - patch: - responses: {} - security: - - Bearer: [] - summary: MarkNotificationAsUnread - tags: - - client - /api/v1/admin/notifications/all: - get: - responses: {} - security: - - Bearer: [] - summary: GetAllNotifications - tags: - - admin - /api/v1/admin/notifications/bulk-email: - post: - consumes: - - multipart/form-data - description: Sends an email to specified user IDs, users of a platform role, - team member IDs, team members of a team_role, or direct email addresses with - optional image attachment. Optionally schedule for later with scheduled_at - (RFC3339). + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer produces: - application/json responses: @@ -5743,14 +8033,220 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] + summary: Mark Notification As Read + tags: + - notifications + /api/v1/admin/notifications/{id}/unread: + patch: + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] + summary: Mark Notification As Unread + tags: + - notifications + /api/v1/admin/notifications/all: + get: + parameters: + - default: 10 + description: Limit + in: query + name: limit + type: integer + - default: 1 + description: Page + in: query + name: page + type: integer + - description: Channel + in: query + name: channel + type: string + - description: Type + in: query + name: type + type: string + - description: User id + in: query + name: user_id + type: integer + - description: Is read + in: query + name: is_read + type: boolean + - description: After + in: query + name: after + type: string + - description: Before + in: query + name: before + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string + security: + - Bearer: [] + summary: Get All Notifications + tags: + - notifications + /api/v1/admin/notifications/bulk-email: + post: + consumes: + - multipart/form-data + description: Sends an email to specified user IDs, users of a platform role, + team member IDs, team members of a team_role, or direct email addresses with + optional image attachment. Optionally schedule for later with scheduled_at + (RFC3339). + parameters: + - description: Saved template slug; otherwise subject and message or html are + required + in: formData + name: email_template_slug + type: string + - description: JSON object of template variables + in: formData + name: template_variables + type: string + - description: Subject, required when no template is selected + in: formData + name: subject + type: string + - description: Plain-text body, required without a template unless html is supplied + in: formData + name: message + type: string + - description: HTML body alternative to message + in: formData + name: html + type: string + - description: Optional attachment + in: formData + name: file + type: file + - description: Comma-separated direct email addresses + in: formData + name: emails + type: string + - description: Comma-separated customer IDs + in: formData + name: user_ids + type: string + - description: Customer role used to select recipients + in: formData + name: role + type: string + - description: Comma-separated team-member IDs + in: formData + name: team_member_ids + type: string + - description: Team role used to select recipients + in: formData + name: team_role + type: string + - description: Optional future delivery time in RFC3339 format + in: formData + name: scheduled_at + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "201": + description: Scheduled notification created when scheduled_at is provided + schema: + $ref: '#/definitions/domain.Response' "400": description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Send bulk email tags: - notifications @@ -5800,14 +8296,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "201": + description: Scheduled notification created when scheduled_at is provided + schema: + $ref: '#/definitions/domain.Response' "400": description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Send bulk in-app notification tags: - notifications @@ -5847,14 +8358,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "201": + description: Scheduled notification created when scheduled_at is provided + schema: + $ref: '#/definitions/domain.Response' "400": description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Send bulk push notification tags: - notifications @@ -5894,25 +8420,72 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "201": + description: Scheduled notification created when scheduled_at is provided + schema: + $ref: '#/definitions/domain.Response' "400": description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Send bulk SMS tags: - notifications /api/v1/admin/notifications/create: post: - responses: {} + consumes: + - application/json + parameters: + - description: Notification recipient and delivery settings + in: body + name: body + required: true + schema: + $ref: '#/definitions/handlers.CreateAndSendNotification.Request' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/handlers.NotificationDispatchResponse' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: CreateAndSendNotification + summary: Create And Send Notification tags: - - admin + - notifications /api/v1/admin/notifications/delete-in-app: post: consumes: @@ -5937,29 +8510,78 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete multiple in-app notifications tags: - notifications /api/v1/admin/notifications/mark-all-read: post: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: MarkAllNotificationsAsRead + summary: Mark All Notifications As Read tags: - - client + - notifications /api/v1/admin/notifications/mark-all-unread: post: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: MarkAllNotificationsAsUnread + summary: Mark All Notifications As Unread tags: - - client + - notifications /api/v1/admin/notifications/scheduled: get: description: Returns paginated scheduled notifications with optional status, @@ -6002,10 +8624,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List scheduled notifications tags: - notifications @@ -6029,10 +8662,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get scheduled notification tags: - notifications @@ -6056,10 +8700,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Cancel scheduled notification tags: - notifications @@ -6068,6 +8723,37 @@ paths: consumes: - multipart/form-data description: Sends an email to a single email address with optional image attachment + parameters: + - description: Saved template slug; otherwise subject and message or html are + required + in: formData + name: email_template_slug + type: string + - description: JSON object of template variables + in: formData + name: template_variables + type: string + - description: Subject, required when no template is selected + in: formData + name: subject + type: string + - description: Plain-text body, required without a template unless html is supplied + in: formData + name: message + type: string + - description: HTML body alternative to message + in: formData + name: html + type: string + - description: Optional attachment + in: formData + name: file + type: file + - description: Recipient email address + in: formData + name: recipient + required: true + type: string produces: - application/json responses: @@ -6079,10 +8765,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Send single email tags: - notifications @@ -6119,21 +8816,47 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Send test push notification tags: - notifications /api/v1/admin/notifications/unread: get: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: CountUnreadNotifications + summary: Count Unread Notifications tags: - - client + - notifications /api/v1/admin/payments: get: description: Returns paginated payments across Chapa and ArifPay with optional @@ -6221,6 +8944,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List all payments (admin) tags: - payments @@ -6233,6 +8971,17 @@ paths: name: id required: true type: integer + - default: 20 + description: Limit + in: query + name: limit + type: integer + - default: 0 + description: Offset + in: query + minimum: 0 + name: offset + type: integer produces: - application/json responses: @@ -6240,10 +8989,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get payment by ID (admin) tags: - payments @@ -6251,7 +9019,27 @@ paths: get: produces: - text/csv - responses: {} + - text/csv + responses: + "200": + description: CSV export; filename is supplied in Content-Disposition + schema: + type: file + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Export payments as CSV (admin) tags: - payments @@ -6271,7 +9059,32 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List LMS personas (catalog for practice assignment) tags: - personas @@ -6285,11 +9098,32 @@ paths: required: true schema: $ref: '#/definitions/domain.CreateLmsPersonaInput' + produces: + - application/json responses: "201": description: Created schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create LMS persona catalog entry tags: - personas @@ -6301,7 +9135,32 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete LMS persona (practices referencing it will have persona_id cleared) tags: - personas @@ -6312,7 +9171,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get LMS persona by ID tags: - personas @@ -6329,7 +9217,36 @@ paths: required: true schema: $ref: '#/definitions/domain.UpdateLmsPersonaInput' - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update LMS persona tags: - personas @@ -6363,10 +9280,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get question sets by type tags: - question-sets @@ -6393,10 +9321,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create a new question set tags: - question-sets @@ -6420,10 +9359,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a question set tags: - question-sets @@ -6446,10 +9396,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get question set by ID tags: - question-sets @@ -6480,10 +9441,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update a question set tags: - question-sets @@ -6507,10 +9483,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get user personas for a question set tags: - question-sets @@ -6541,10 +9528,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Add a user as persona to a question set tags: - question-sets @@ -6573,10 +9571,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Remove a user persona from a question set tags: - question-sets @@ -6602,6 +9611,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -6610,6 +9628,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List question types in a question set tags: - question-set-items @@ -6634,10 +9654,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get questions in set tags: - question-set-items @@ -6669,10 +9704,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Add question to set tags: - question-set-items @@ -6701,10 +9747,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Remove question from set tags: - question-set-items @@ -6741,10 +9798,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update question order in set tags: - question-set-items @@ -6773,10 +9841,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get question sets by owner tags: - question-sets @@ -6817,10 +9896,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List questions tags: - questions @@ -6848,10 +9938,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create a new question tags: - questions @@ -6875,10 +9976,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a question tags: - questions @@ -6901,10 +10013,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get question by ID tags: - questions @@ -6936,10 +10063,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update a question tags: - questions @@ -6954,6 +10096,17 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Question-type builder component catalog tags: - questions @@ -6987,10 +10140,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Search questions tags: - questions @@ -7018,6 +10182,25 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List question type definition groups tags: - questions @@ -7038,6 +10221,21 @@ paths: description: Created schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Create question type definition group tags: - questions @@ -7056,6 +10254,25 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete question type definition group tags: - questions @@ -7073,10 +10290,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get question type definition group with definitions tags: - questions @@ -7102,6 +10338,25 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update question type definition group tags: - questions @@ -7138,10 +10393,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List reusable question-type definitions tags: - questions @@ -7168,10 +10438,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create reusable question-type definition tags: - questions @@ -7194,10 +10479,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete reusable question-type definition tags: - questions @@ -7219,10 +10515,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get reusable question-type definition by id tags: - questions @@ -7254,10 +10561,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update reusable question-type definition tags: - questions @@ -7293,10 +10615,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List practices globally by question type definition tags: - questions @@ -7324,6 +10661,17 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Validate dynamic question-type definition tags: - questions @@ -7360,10 +10708,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get ratings for a target tags: - ratings @@ -7387,10 +10746,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a rating tags: - ratings @@ -7419,10 +10789,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get rating summary for a target tags: - ratings @@ -7445,6 +10826,15 @@ paths: $ref: '#/definitions/domain.Permission' type: array type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7473,6 +10863,15 @@ paths: type: string type: array type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7494,6 +10893,15 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7532,6 +10940,15 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7568,6 +10985,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7599,6 +11025,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7634,6 +11069,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -7674,6 +11118,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7712,6 +11165,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7748,6 +11210,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -7759,19 +11230,88 @@ paths: - rbac /api/v1/admin/referrals/settings: get: - responses: {} + description: Returns the saved referral commission percentage. Restricted to + ADMIN and SUPER_ADMIN. The initial percentage is 0, which disables new credits. + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ReferralSettingsData' + type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string security: - Bearer: [] - summary: GetReferralSettings + summary: Get Referral Settings tags: - - admin + - referrals put: - responses: {} + consumes: + - application/json + description: Sets the percentage credited on a referred learner's first successful + positive subscription payment. Accepts 0 through 100 with at most two decimal + places. Zero disables new credits. Changes affect future conversions only; + existing credits retain their rate. Restricted to ADMIN and SUPER_ADMIN; changes + are audited. + parameters: + - description: Commission percentage configuration + in: body + name: body + required: true + schema: + $ref: '#/definitions/handlers.updateReferralSettingsReq' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ReferralSettingsData' + type: object + "400": + description: Missing or invalid commission_percent; use 0 through 100 with + at most two decimal places + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string security: - Bearer: [] - summary: UpdateReferralSettings + summary: Update Referral Settings tags: - - admin + - referrals /api/v1/admin/sendSMS: post: consumes: @@ -7795,36 +11335,123 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Send single SMS via AfroMessage tags: - user /api/v1/admin/settings: get: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: GetGlobalSettingList + summary: Get Global Setting List tags: - - admin + - settings put: - responses: {} + consumes: + - application/json + parameters: + - description: Request payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/domain.SaveSettingListReq' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: UpdateGlobalSettingList + summary: Update Global Setting List tags: - - admin + - settings /api/v1/admin/settings/{key}: get: - responses: {} + parameters: + - description: Key + in: path + name: key + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string security: - Bearer: [] - summary: GetGlobalSettingByKey + summary: Get Global Setting By Key tags: - - admin + - settings /api/v1/admin/subscription-plans: get: description: 'Returns subscription plans. Optional category filter: EDUCATION.' @@ -7848,10 +11475,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List subscription plans tags: - subscriptions @@ -7877,10 +11515,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "409": + description: Resource conflict + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create a subscription plan tags: - subscriptions @@ -7900,10 +11553,33 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "409": + description: Resource conflict + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a subscription plan tags: - subscriptions @@ -7922,10 +11598,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get a subscription plan tags: - subscriptions @@ -7956,10 +11643,29 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "409": + description: Resource conflict + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update a subscription plan tags: - subscriptions @@ -7984,6 +11690,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -8001,7 +11716,27 @@ paths: get: produces: - text/csv - responses: {} + - text/csv + responses: + "200": + description: CSV export; filename is supplied in Content-Disposition + schema: + type: file + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Export user subscriptions as CSV (admin) tags: - subscriptions @@ -8028,6 +11763,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: List team invitations tags: - team @@ -8048,6 +11798,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Revoke a pending team invitation tags: - team @@ -8071,6 +11836,10 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Accept team invitation and complete account setup tags: - team @@ -8090,6 +11859,14 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Verify team invitation token tags: - team @@ -8157,6 +11934,11 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -8201,6 +11983,11 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -8395,6 +12182,11 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -8488,6 +12280,11 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -8521,10 +12318,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Resend team invitation tags: - team @@ -8581,7 +12389,27 @@ paths: get: produces: - text/csv - responses: {} + - text/csv + responses: + "200": + description: CSV export; filename is supplied in Content-Disposition + schema: + type: file + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Export team members as CSV (admin) tags: - team @@ -8609,10 +12437,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Invite a team member by email tags: - team @@ -8649,6 +12488,10 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Access denied + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: @@ -8812,6 +12655,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -8837,6 +12689,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -8868,10 +12729,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Delete user by ID tags: - user @@ -8898,10 +12770,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Search for user using name or phone tags: - user @@ -8931,10 +12814,17 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Get user by id tags: - user @@ -8961,10 +12851,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Update user status tags: - user @@ -9028,10 +12929,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Get all users tags: - user @@ -9069,6 +12981,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -9113,6 +13034,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -9152,6 +13082,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -9201,6 +13140,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -9272,10 +13220,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: List account deletion requests tags: - user @@ -9283,7 +13242,27 @@ paths: get: produces: - text/csv - responses: {} + - text/csv + responses: + "200": + description: CSV export; filename is supplied in Content-Disposition + schema: + type: file + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Export users as CSV (admin) tags: - user @@ -9304,6 +13283,15 @@ paths: data: $ref: '#/definitions/domain.UserSummary' type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -9343,10 +13331,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get oEmbed data for a Vimeo URL tags: - Vimeo @@ -9379,10 +13378,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get a sample Vimeo video with iframe embed tags: - Vimeo @@ -9409,10 +13419,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create a pull upload to Vimeo tags: - Vimeo @@ -9439,10 +13464,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create a TUS resumable upload to Vimeo tags: - Vimeo @@ -9500,6 +13540,15 @@ paths: metadata: $ref: '#/definitions/handlers.VimeoVideosListMetadata' type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -9508,6 +13557,8 @@ paths: description: Service Unavailable schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List videos stored in the Vimeo account tags: - Vimeo @@ -9525,16 +13576,33 @@ paths: produces: - application/json responses: - "204": - description: No Content + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' "400": description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a video from Vimeo tags: - Vimeo @@ -9559,10 +13627,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get video information from Vimeo tags: - Vimeo @@ -9614,10 +13697,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get embed code for a Vimeo video tags: - Vimeo @@ -9645,10 +13743,25 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get transcode status of a Vimeo video tags: - Vimeo @@ -9660,10 +13773,19 @@ paths: name: token required: true type: string - responses: {} - summary: ConnectSocket + responses: + "101": + description: WebSocket protocol upgrade; subsequent messages are notification + events + schema: + type: string + "401": + description: Authentication failed + schema: + type: string + summary: Connect Socket tags: - - client + - ws /api/v1/app/version/check: get: description: Public endpoint for mobile clients to determine if an app update @@ -9712,7 +13834,27 @@ paths: type: object produces: - application/json - responses: {} + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Authentication failed + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Login via Sign in with Apple identity token tags: - auth @@ -9743,6 +13885,10 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Access denied + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: @@ -9759,19 +13905,70 @@ paths: required: true schema: type: string - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Authentication failed + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Login via Google Android ID Token tags: - auth /api/v1/auth/google/callback: get: - responses: {} + parameters: + - description: Code + in: query + name: code + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Authentication failed + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Google login callback tags: - auth /api/v1/auth/google/login: get: - responses: {} + produces: + - text/plain + responses: + "302": + description: Redirect to Google authorization URL; see Location header + schema: + type: string + "503": + description: Google OAuth is not configured + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Google login redirect tags: - auth @@ -9802,10 +13999,17 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/response.APIResponse' + security: + - Bearer: [] summary: Logout user tags: - auth @@ -9836,6 +14040,10 @@ paths: description: Unauthorized schema: $ref: '#/definitions/response.APIResponse' + "403": + description: Access denied + schema: + type: string "500": description: Internal Server Error schema: @@ -9845,28 +14053,111 @@ paths: - auth /api/v1/devices/register: post: - responses: {} + consumes: + - application/json + parameters: + - description: Device token and platform + in: body + name: body + required: true + schema: + $ref: '#/definitions/handlers.RegisterDeviceToken.Request' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: RegisterDeviceToken + summary: Register Device Token tags: - - client + - devices /api/v1/devices/unregister: post: - responses: {} + consumes: + - application/json + parameters: + - description: Device token to unregister + in: body + name: body + required: true + schema: + $ref: '#/definitions/handlers.UnregisterDeviceToken.Request' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: UnregisterDeviceToken + summary: Unregister Device Token tags: - - client + - devices /api/v1/exam-prep/assessments: get: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string security: - Bearer: [] - summary: ListExamPrepAssessments + summary: List Exam Prep Assessments tags: - - client + - exam-prep /api/v1/exam-prep/catalog-courses: get: parameters: @@ -9887,6 +14178,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep catalog courses tags: - exam-prep @@ -9906,7 +14212,32 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices for a catalog course tags: - exam-prep @@ -9928,11 +14259,36 @@ paths: in: query name: offset type: integer + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep units for a catalog course tags: - exam-prep @@ -9951,12 +14307,71 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep catalog course by ID tags: - exam-prep /api/v1/exam-prep/lessons/{id}: get: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep lesson by ID tags: - exam-prep @@ -9976,13 +14391,74 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices for a lesson tags: - exam-prep /api/v1/exam-prep/modules/{id}: get: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep module by ID tags: - exam-prep @@ -10004,7 +14480,36 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep lessons for a unit module tags: - exam-prep @@ -10024,7 +14529,32 @@ paths: in: query name: unlinked_only type: boolean - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices globally tags: - exam-prep @@ -10036,7 +14566,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep practice by ID tags: - exam-prep @@ -10075,6 +14634,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -10083,6 +14651,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get questions by practice tags: - question-set-items @@ -10097,15 +14667,28 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get my learning progress summary tags: - exam-prep /api/v1/exam-prep/progress/practices/{id}/complete: post: + consumes: + - application/json description: Marks a practice question set as completed for the authenticated learner in its exam-prep parent scope parameters: @@ -10114,6 +14697,19 @@ paths: name: id required: true type: integer + - description: Optional practice parent scope + in: body + name: body + schema: + $ref: '#/definitions/domain.CompletePracticeInput' + - description: Parent kind + in: query + name: parent_kind + type: string + - description: Parent id + in: query + name: parent_id + type: integer produces: - application/json responses: @@ -10125,6 +14721,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string "403": description: Forbidden schema: @@ -10137,6 +14737,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Mark exam-prep practice as completed tags: - progression @@ -10148,7 +14750,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get exam-prep unit by ID tags: - exam-prep @@ -10160,7 +14791,47 @@ paths: name: unitId required: true type: integer - responses: {} + - default: 20 + description: Limit + in: query + name: limit + type: integer + - default: 0 + description: Offset + in: query + minimum: 0 + name: offset + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep modules for a unit tags: - exam-prep @@ -10180,7 +14851,32 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List exam-prep practices for a unit tags: - exam-prep @@ -10215,6 +14911,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string "403": description: Forbidden schema: @@ -10223,6 +14923,12 @@ paths: description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Report video playback progress tags: - videos @@ -10284,6 +14990,10 @@ paths: description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Get published FAQ by ID tags: - faqs @@ -10335,11 +15045,36 @@ paths: name: file required: true type: file + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Upload an audio file tags: - files @@ -10363,6 +15098,33 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Complete presigned MinIO upload tags: - files @@ -10386,6 +15148,29 @@ paths: description: Created schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Create presigned MinIO upload URL tags: - files @@ -10407,6 +15192,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Refresh presigned URL for a file tags: - files @@ -10425,11 +15233,36 @@ paths: name: file required: true type: file + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Upload media file tags: - files @@ -10441,11 +15274,36 @@ paths: name: key required: true type: string + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get presigned URL for a file tags: - files @@ -10481,6 +15339,11 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -10516,6 +15379,15 @@ paths: data: $ref: '#/definitions/handlers.issueListRes' type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -10527,19 +15399,73 @@ paths: - issues /api/v1/notifications: delete: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: DeleteUserNotifications + summary: Delete User Notifications tags: - - client + - notifications get: - responses: {} + parameters: + - default: 10 + description: Limit + in: query + name: limit + type: integer + - default: 0 + description: Offset + in: query + minimum: 0 + name: offset + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: GetUserNotification + summary: Get User Notification tags: - - client + - notifications /api/v1/notifications/{id}: delete: description: Deletes one in-app notification owned by the authenticated user. @@ -10560,6 +15486,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -10568,6 +15503,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a single in-app notification tags: - notifications @@ -10591,6 +15528,10 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string "403": description: Forbidden schema: @@ -10603,25 +15544,87 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get in-app notification by ID tags: - notifications /api/v1/notifications/{id}/read: patch: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: MarkNotificationAsRead + summary: Mark Notification As Read tags: - - client + - notifications /api/v1/notifications/{id}/unread: patch: - responses: {} + parameters: + - description: Id + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: MarkNotificationAsUnread + summary: Mark Notification As Unread tags: - - client + - notifications /api/v1/notifications/delete-in-app: post: consumes: @@ -10646,37 +15649,105 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete multiple in-app notifications tags: - notifications /api/v1/notifications/mark-all-read: post: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: MarkAllNotificationsAsRead + summary: Mark All Notifications As Read tags: - - client + - notifications /api/v1/notifications/mark-all-unread: post: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] - summary: MarkAllNotificationsAsUnread + summary: Mark All Notifications As Unread tags: - - client + - notifications /api/v1/notifications/unread: get: - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + type: string security: - Bearer: [] - summary: CountUnreadNotifications + summary: Count Unread Notifications tags: - - client + - notifications /api/v1/payments: get: description: Returns the authenticated user's payment history @@ -10698,6 +15769,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get payment history tags: - payments @@ -10717,10 +15803,25 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get payment details tags: - payments @@ -10744,6 +15845,17 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + security: + - Bearer: [] summary: Cancel a pending payment tags: - payments @@ -10764,6 +15876,10 @@ paths: in: query name: nonce type: string + - description: Sessionid + in: query + name: sessionID + type: string produces: - text/html responses: @@ -10771,6 +15887,10 @@ paths: description: HTML success page schema: type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: ArifPay payment success page tags: - payments @@ -10790,6 +15910,10 @@ paths: in: query name: status type: string + - description: Tx ref + in: query + name: tx_ref + type: string produces: - application/json responses: @@ -10797,6 +15921,14 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Chapa payment callback tags: - payments @@ -10824,10 +15956,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Initiate Chapa direct charge subscription payment tags: - payments @@ -10855,10 +15998,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Authorize Chapa direct charge with OTP tags: - payments @@ -10904,6 +16058,10 @@ paths: description: HTML success page schema: type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Chapa payment success page tags: - payments @@ -10930,10 +16088,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Initiate direct payment tags: - payments @@ -10974,10 +16143,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Verify OTP for direct payment tags: - payments @@ -11017,10 +16197,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Initiate subscription payment tags: - payments @@ -11044,10 +16235,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Verify payment status tags: - payments @@ -11055,7 +16257,24 @@ paths: post: consumes: - application/json + - application/json description: Processes payment notifications from Chapa (charge.success, etc.) + parameters: + - description: Exact signed Chapa webhook payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/domain.ChapaWebhookPayload' + - description: Webhook HMAC signature. Alternatively send chapa-signature; one + of these headers is required. + in: header + name: x-chapa-signature + type: string + - description: Alternative signature header + in: header + name: chapa-signature + type: string produces: - application/json responses: @@ -11067,6 +16286,14 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Authentication failed + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Handle Chapa webhook tags: - payments @@ -11086,7 +16313,32 @@ paths: in: query name: offset type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: List LMS personas (catalog for practice assignment) tags: - personas @@ -11098,7 +16350,36 @@ paths: name: id required: true type: integer - responses: {} + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get LMS persona by ID tags: - personas @@ -11122,11 +16403,36 @@ paths: name: file required: true type: file + produces: + - application/json responses: "200": description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Submit audio answer for a question tags: - questions @@ -11163,10 +16469,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get ratings for a target tags: - ratings @@ -11192,10 +16509,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Submit a rating tags: - ratings @@ -11219,10 +16547,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Delete a rating tags: - ratings @@ -11251,6 +16590,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -11259,6 +16607,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get my rating for a target tags: - ratings @@ -11272,10 +16622,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get all my ratings tags: - ratings @@ -11304,63 +16665,284 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get rating summary for a target tags: - ratings /api/v1/referrals: get: - responses: {} + description: Returns only the authenticated learner's referral history and conversion + flags. Referred learners' names, emails, and phone numbers are not exposed. + parameters: + - default: 20 + description: Page size + in: query + maximum: 100 + minimum: 1 + name: limit + type: integer + - default: 0 + description: Number of entries to skip + in: query + minimum: 0 + name: offset + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ReferralHistoryData' + type: object + "400": + description: Invalid pagination + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string security: - Bearer: [] - summary: ListMyReferrals + summary: List My Referrals tags: - - client + - referrals /api/v1/referrals/apply: post: - responses: {} + consumes: + - application/json + description: Attributes the authenticated learner to one referrer. Apply within + seven days of account creation and before any successful positive payment. + Codes are case-insensitive and surrounding whitespace is ignored. Self referral, + reassignment, inactive referrers, and invalid codes are rejected. + parameters: + - description: Referral share code + in: body + name: body + required: true + schema: + $ref: '#/definitions/handlers.applyReferralReq' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/domain.Response' + "400": + description: Invalid request or ineligible referral + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string security: - Bearer: [] - summary: ApplyReferralCode + summary: Apply Referral Code tags: - - client + - referrals /api/v1/referrals/code: get: - responses: {} + description: Returns the authenticated learner's stable share code, creating + it when necessary. Codes are case-insensitive. + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ReferralCodeData' + type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string security: - Bearer: [] - summary: GetReferralCode + summary: Get Referral Code tags: - - client + - referrals post: - responses: {} - summary: CreateReferralCode + description: Creates or returns the authenticated learner's stable share code. + Requires an active STUDENT or OPEN_LEARNER account; a subscription is not + required. + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ReferralCodeData' + type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string + security: + - Bearer: [] + summary: Create Referral Code tags: - - client + - referrals /api/v1/referrals/me: get: - responses: {} + description: Returns the learner's code, current commission percentage, referral/conversion + counts, and commission-wallet balances by currency. + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ReferralOverviewData' + type: object + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string security: - Bearer: [] - summary: GetMyReferrals + summary: Get My Referrals tags: - - client + - referrals /api/v1/referrals/wallet: get: - responses: {} + description: Returns wallet balances separately by currency and a paginated + commission ledger. Decimal amounts and percentages are strings. Only the first + successful positive subscription payment earns a commission; duplicate callbacks + and renewals do not. Reversed credits are excluded from balances. This endpoint + does not initiate cash payouts. + parameters: + - default: 20 + description: Page size + in: query + maximum: 100 + minimum: 1 + name: limit + type: integer + - default: 0 + description: Number of entries to skip + in: query + minimum: 0 + name: offset + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ReferralWalletData' + type: object + "400": + description: Invalid pagination + schema: + type: string + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Unable to process referral request + schema: + type: string security: - Bearer: [] - summary: GetReferralWallet + summary: Get Referral Wallet tags: - - client + - referrals /api/v1/subscription-plans: get: description: 'Returns subscription plans. Optional category filter: EDUCATION.' parameters: - - description: Return only active plans (default true) + - default: true + description: Customer requests always return active plans; false is honored + only by the admin endpoint in: query name: active_only type: boolean @@ -11402,6 +16984,10 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' "404": description: Not Found schema: @@ -11434,10 +17020,21 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Subscribe to a plan (Admin only - bypasses payment) tags: - subscriptions @@ -11465,10 +17062,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Set auto-renew tags: - subscriptions @@ -11488,10 +17104,29 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "400": + description: Invalid request + schema: + $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Cancel subscription tags: - subscriptions @@ -11519,6 +17154,19 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "404": + description: Resource not found + schema: + $ref: '#/definitions/domain.ErrorResponse' "409": description: User already has active subscription schema: @@ -11527,6 +17175,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Subscribe to a plan with payment tags: - subscriptions @@ -11551,6 +17201,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get subscription history tags: - subscriptions @@ -11565,6 +17230,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Get active subscriptions tags: - subscriptions @@ -11592,6 +17272,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "409": description: Conflict schema: @@ -11600,10 +17289,16 @@ paths: description: Too Many Requests schema: $ref: '#/definitions/domain.ErrorResponse' + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' "503": description: Service Unavailable schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Send web checkout link to learner tags: - subscriptions @@ -11617,6 +17312,21 @@ paths: description: OK schema: $ref: '#/definitions/domain.Response' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Check subscription status tags: - subscriptions @@ -11626,11 +17336,6 @@ paths: - application/json description: Updates user profile information (partial updates supported) parameters: - - description: User ID - in: path - name: user_id - required: true - type: integer - description: Update user payload in: body name: body @@ -11648,6 +17353,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -11656,6 +17370,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update user profile tags: - user @@ -11686,6 +17402,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -11718,6 +17443,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/domain.ErrorResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -11726,6 +17460,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Check if user profile is completed tags: - user @@ -11735,9 +17471,9 @@ paths: - application/json description: Returns whether the specified user has a status of "pending" parameters: - - description: User ID + - description: User name in: path - name: user_id + name: user_name required: true type: string produces: @@ -11819,6 +17555,11 @@ paths: description: Unauthorized schema: $ref: '#/definitions/domain.ErrorResponse' + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "404": description: Not Found schema: @@ -11827,6 +17568,8 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + security: + - Bearer: [] summary: Update user's knowledge level tags: - user @@ -11888,7 +17631,10 @@ paths: post: consumes: - application/json - description: Register user + description: Registers a learner with email or phone and password. The server + assigns the learner role and selects the OTP medium from the contact method. + An optional referral_code attributes the new account atomically; invalid or + ineligible codes reject registration. parameters: - description: Register user in: body @@ -12051,6 +17797,15 @@ paths: description: Bad Request schema: $ref: '#/definitions/response.APIResponse' + "401": + description: Missing, invalid, or expired Bearer token + schema: + type: string + "403": + description: Account audience, status, permission, or subscription does + not allow this operation + schema: + type: string "500": description: Internal Server Error schema: @@ -12124,6 +17879,10 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Get oEmbed data for a Vimeo URL tags: - Vimeo @@ -12160,6 +17919,10 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/domain.ErrorResponse' + "503": + description: Service unavailable + schema: + $ref: '#/definitions/domain.ErrorResponse' summary: Get a sample Vimeo video with iframe embed tags: - Vimeo @@ -12171,10 +17934,54 @@ paths: name: token required: true type: string - responses: {} - summary: ConnectSocket + responses: + "101": + description: WebSocket protocol upgrade; subsequent messages are notification + events + schema: + type: string + "401": + description: Authentication failed + schema: + type: string + summary: Connect Socket tags: - - client + - ws + /payment/success: + get: + description: Displays the Rezina success page after Chapa redirects the learner + to return_url + parameters: + - description: Chapa transaction reference (tx_ref) + in: query + name: trx_ref + type: string + - description: Chapa transaction reference + in: query + name: tx_ref + type: string + - description: Chapa reference ID + in: query + name: ref_id + type: string + - description: Payment status from Chapa redirect + in: query + name: status + type: string + produces: + - text/html + responses: + "200": + description: HTML success page + schema: + type: string + "500": + description: Internal server error + schema: + $ref: '#/definitions/domain.ErrorResponse' + summary: Chapa payment success page + tags: + - payments securityDefinitions: Bearer: in: header diff --git a/internal/domain/user.go b/internal/domain/user.go index 6e52a1e8..e47ca3cd 100644 --- a/internal/domain/user.go +++ b/internal/domain/user.go @@ -240,12 +240,12 @@ type AccountDeletionRequest struct { } type RegisterUserReq struct { - ReferralCode string `json:"referral_code"` + ReferralCode string `json:"referral_code" example:"ABCDEF0123456789"` Email string `json:"email"` PhoneNumber string `json:"phone_number"` Password string `json:"password"` - Role string `json:"role"` - OtpMedium OtpMedium `json:"otp_medium"` + Role string `json:"role" swaggerignore:"true"` + OtpMedium OtpMedium `json:"otp_medium" swaggerignore:"true"` } type CreateUserReq struct { diff --git a/internal/web_server/api_docs.go b/internal/web_server/api_docs.go index 16a16d8f..708f8b45 100644 --- a/internal/web_server/api_docs.go +++ b/internal/web_server/api_docs.go @@ -38,7 +38,13 @@ func audienceSpecification(audience string) fiber.Handler { } spec["paths"] = selected if info, ok := spec["info"].(map[string]any); ok { - info["title"] = "Rezina " + audience + " API" + if audience == "admin" { + info["title"] = "Rezina Admin API" + info["description"] = "Admin panel operations use /api/v1/admin. Sign in through /api/v1/admin/team/login, then enter Bearer followed by a space and the access token in Authorize. Protected endpoints require a staff account and the relevant RBAC permission. WebSockets use the token query parameter." + } else { + info["title"] = "Rezina Customer API" + info["description"] = "Customer web and mobile operations retain /api/v1; there is no /client prefix. Public registration, login, and discovery endpoints do not require authorization. For protected endpoints, enter Bearer followed by a space and a customer access token in Authorize. Premium learning content requires an active EDUCATION subscription unless the account has an existing exemption. WebSockets use the token query parameter." + } } definitions, _ := spec["definitions"].(map[string]any) used := map[string]any{} diff --git a/internal/web_server/api_docs_test.go b/internal/web_server/api_docs_test.go index 9bfc3332..8f0ddee9 100644 --- a/internal/web_server/api_docs_test.go +++ b/internal/web_server/api_docs_test.go @@ -18,16 +18,16 @@ func TestAudienceSpecifications(t *testing.T) { t.Fatal(err) } defer response.Body.Close() - var spec struct { - Paths map[string]any `json:"paths"` - } - if err := json.NewDecoder(response.Body).Decode(&spec); err != nil { + var document map[string]any + if err := json.NewDecoder(response.Body).Decode(&document); err != nil { t.Fatal(err) } - if len(spec.Paths) == 0 { + paths, _ := document["paths"].(map[string]any) + if len(paths) == 0 { t.Fatal("empty API specification") } - for path := range spec.Paths { + assertSwaggerReferences(t, document) + for path := range paths { if (audience == "admin" && !strings.HasPrefix(path, "/api/v1/admin/")) || (audience == "client" && (!strings.HasPrefix(path, "/api/v1/") || strings.HasPrefix(path, "/api/v1/admin/"))) { t.Errorf("foreign path %s", path) } diff --git a/internal/web_server/handlers/activity_logs.go b/internal/web_server/handlers/activity_logs.go index 397d9e74..3f3a432b 100644 --- a/internal/web_server/handlers/activity_logs.go +++ b/internal/web_server/handlers/activity_logs.go @@ -52,6 +52,10 @@ type activityLogListRes struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/activity-logs [get] +// @Security Bearer +// @Param search query string false "Search" +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetActivityLogs(c *fiber.Ctx) error { var filter domain.ActivityLogFilter @@ -165,6 +169,9 @@ func (h *Handler) GetActivityLogs(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/activity-logs/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetActivityLogByID(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) diff --git a/internal/web_server/handlers/admin.go b/internal/web_server/handlers/admin.go index f0682c01..6ba8fb02 100644 --- a/internal/web_server/handlers/admin.go +++ b/internal/web_server/handlers/admin.go @@ -28,7 +28,7 @@ type CreateAdminReq struct { // CreateAdmin godoc // @Summary Create Admin // @Description Create Admin -// @Tags admin +// @Tags admins // @Accept json // @Produce json // @Param manger body CreateAdminReq true "Create admin" @@ -37,6 +37,8 @@ type CreateAdminReq struct { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/admins [post] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateAdmin(c *fiber.Ctx) error { // var OrganizationID domain.ValidInt64 var req CreateAdminReq @@ -163,7 +165,7 @@ type AdminRes struct { // GetAllAdmins godoc // @Summary Get all Admins // @Description Get all Admins -// @Tags admin +// @Tags admins // @Accept json // @Produce json // @Param page query int false "Page number" @@ -173,6 +175,12 @@ type AdminRes struct { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/admins [get] +// @Security Bearer +// @Param query query string false "Query" +// @Param created_before query string false "Created before" +// @Param created_after query string false "Created after" +// @Param company_id query int false "Company id" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetAllAdmins(c *fiber.Ctx) error { searchQuery := c.Query("query") searchString := domain.ValidString{ @@ -280,7 +288,7 @@ func (h *Handler) GetAllAdmins(c *fiber.Ctx) error { // GetAdminByID godoc // @Summary Get admin by id // @Description Get a single admin by id -// @Tags admin +// @Tags admins // @Accept json // @Produce json // @Param id path int true "User ID" @@ -289,6 +297,8 @@ func (h *Handler) GetAllAdmins(c *fiber.Ctx) error { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/admins/{id} [get] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetAdminByID(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -334,7 +344,7 @@ type updateAdminReq struct { // UpdateAdmin godoc // @Summary Update Admin // @Description Update Admin -// @Tags admin +// @Tags admins // @Accept json // @Produce json // @Param admin body updateAdminReq true "Update Admin" @@ -343,6 +353,9 @@ type updateAdminReq struct { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/admins/{id} [put] +// @Security Bearer +// @Param id path int64 true "Id" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateAdmin(c *fiber.Ctx) error { var req updateAdminReq if err := c.BodyParser(&req); err != nil { @@ -424,10 +437,9 @@ func (h *Handler) bulkAccountsRoleFromPath(c *fiber.Ctx) (roleKey string, ok boo // BulkDeactivateAccountsByRole godoc // @Summary Bulk deactivate accounts by role (SUPER_ADMIN or ADMIN platform users only) // @Description Sets all platform users with the given users.role to DEACTIVATED (except the caller) and all team_members with the given team_role to inactive. Path :role may be a role key (e.g. INSTRUCTOR, ADMIN) or a decimal RBAC roles.id from GET /api/v1/rbac/roles (resolved to RoleRecord.name uppercased). SUPER_ADMIN cannot be bulk-deactivated. ADMIN platform users must use SUPER_ADMIN to bulk change other platform ADMIN users (team_members with team_role ADMIN under path ADMIN remain allowed). Empty body allowed; optionally pass exclude_team_member_id to skip one team_members row (e.g. yourself). -// @Tags admin +// @Tags admins // @Accept json // @Produce json -// @Security Bearer // @Param role path string true "Role key (INSTRUCTOR etc.) or RBAC roles.id (integer string)" // @Param body body domain.BulkAccountsByRoleRequest false "Optional exclusions" // @Success 200 {object} domain.Response @@ -436,6 +448,8 @@ func (h *Handler) bulkAccountsRoleFromPath(c *fiber.Ctx) (roleKey string, ok boo // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/admins/roles/{role}/bulk-deactivate [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" func (h *Handler) BulkDeactivateAccountsByRole(c *fiber.Ctx) error { callerRole, ok := c.Locals("role").(domain.Role) if !ok { @@ -548,10 +562,9 @@ func (h *Handler) BulkDeactivateAccountsByRole(c *fiber.Ctx) error { // BulkReactivateAccountsByRole godoc // @Summary Bulk reactivate accounts by role (SUPER_ADMIN or ADMIN platform users only) // @Description Sets all platform users with the given role from DEACTIVATED to ACTIVE (except the caller) and all team_members with the given team_role from inactive to active. Path :role may be a role key or decimal RBAC roles.id (see bulk-deactivate). Path role must correspond to valid platform users.role or team_members.team_role (after resolving id → name). SUPER_ADMIN cannot be bulk changed. ADMIN callers cannot bulk change other platform ADMIN users (team_members ADMIN under path ADMIN is allowed). Matches only users currently DEACTIVATED and team rows currently inactive. -// @Tags admin +// @Tags admins // @Accept json // @Produce json -// @Security Bearer // @Param role path string true "Role key (INSTRUCTOR etc.) or RBAC roles.id (integer string)" // @Param body body domain.BulkAccountsByRoleRequest false "Optional exclusions" // @Success 200 {object} domain.Response @@ -560,6 +573,8 @@ func (h *Handler) BulkDeactivateAccountsByRole(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/admins/roles/{role}/bulk-reactivate [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" func (h *Handler) BulkReactivateAccountsByRole(c *fiber.Ctx) error { callerRole, ok := c.Locals("role").(domain.Role) if !ok { diff --git a/internal/web_server/handlers/admin_export.go b/internal/web_server/handlers/admin_export.go index 7023eaec..8dd7fa93 100644 --- a/internal/web_server/handlers/admin_export.go +++ b/internal/web_server/handlers/admin_export.go @@ -107,6 +107,12 @@ func csvJSON(raw json.RawMessage) string { // @Tags payments // @Produce text/csv // @Router /api/v1/admin/payments/export [get] +// @Security Bearer +// @Produce text/csv +// @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) ExportAdminPaymentsCSV(c *fiber.Ctx) error { filter, err := paymentListFilterFields(c) if err != nil { @@ -167,6 +173,12 @@ func (h *Handler) ExportAdminPaymentsCSV(c *fiber.Ctx) error { // @Tags user // @Produce text/csv // @Router /api/v1/admin/users/export [get] +// @Security Bearer +// @Produce text/csv +// @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request" func (h *Handler) ExportUsersCSV(c *fiber.Ctx) error { filter, err := parseUserListFilter(c) if err != nil { @@ -245,6 +257,12 @@ func (h *Handler) ExportUsersCSV(c *fiber.Ctx) error { // @Tags activity-logs // @Produce text/csv // @Router /api/v1/admin/activity-logs/export [get] +// @Security Bearer +// @Produce text/csv +// @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) ExportActivityLogsCSV(c *fiber.Ctx) error { filter, err := parseActivityLogFilterFields(c) if err != nil { @@ -297,6 +315,12 @@ func (h *Handler) ExportActivityLogsCSV(c *fiber.Ctx) error { // @Tags subscriptions // @Produce text/csv // @Router /api/v1/admin/subscriptions/export [get] +// @Security Bearer +// @Produce text/csv +// @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) ExportUserSubscriptionsCSV(c *fiber.Ctx) error { filter, err := parseUserSubscriptionAdminFilterFields(c) if err != nil { @@ -358,6 +382,12 @@ func (h *Handler) ExportUserSubscriptionsCSV(c *fiber.Ctx) error { // @Tags team // @Produce text/csv // @Router /api/v1/admin/team/members/export [get] +// @Security Bearer +// @Produce text/csv +// @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ExportTeamMembersCSV(c *fiber.Ctx) error { filter := parseTeamMemberListFilter(c) ctx := exportRequestContext(c) diff --git a/internal/web_server/handlers/admin_subscription_handler.go b/internal/web_server/handlers/admin_subscription_handler.go index 36634a70..b0974cd8 100644 --- a/internal/web_server/handlers/admin_subscription_handler.go +++ b/internal/web_server/handlers/admin_subscription_handler.go @@ -31,7 +31,6 @@ func (r adminApplySubscriptionReq) recordPaymentOrDefault() bool { // @Tags subscriptions // @Accept json // @Produce json -// @Security Bearer // @Param user_id path int true "Target learner user ID" // @Param body body adminApplySubscriptionReq true "Plan to grant or extend" // @Success 200 {object} domain.Response @@ -40,6 +39,9 @@ func (r adminApplySubscriptionReq) recordPaymentOrDefault() bool { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/users/{user_id}/subscriptions/extend [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AdminExtendOrGrantUserSubscription(c *fiber.Ctx) error { targetID, err := parseAdminTargetUserID(c) if err != nil { @@ -157,13 +159,15 @@ func (h *Handler) AdminExtendOrGrantUserSubscription(c *fiber.Ctx) error { // @Description Cancels any user_subscriptions row by ID. Does not require ownership by the caller. // @Tags subscriptions // @Produce json -// @Security Bearer // @Param id path int true "Subscription ID" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/subscriptions/{id}/cancel [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AdminCancelUserSubscription(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { diff --git a/internal/web_server/handlers/admin_user_detail_handler.go b/internal/web_server/handlers/admin_user_detail_handler.go index 90510994..de390a70 100644 --- a/internal/web_server/handlers/admin_user_detail_handler.go +++ b/internal/web_server/handlers/admin_user_detail_handler.go @@ -18,13 +18,15 @@ const adminUserDetailPageSize int32 = 200 // @Description Returns display status, active plans by category, full subscription history, and related payments // @Tags subscriptions // @Produce json -// @Security Bearer // @Param user_id path int true "Target user ID" // @Success 200 {object} domain.Response{data=domain.AdminUserSubscriptionDetails} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/users/{user_id}/subscriptions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AdminGetUserSubscriptions(c *fiber.Ctx) error { targetID, err := parseAdminTargetUserID(c) if err != nil { @@ -77,7 +79,6 @@ func (h *Handler) AdminGetUserSubscriptions(c *fiber.Ctx) error { // @Description Returns the unified catalog-course learning tree, progress summary, and recent activity timeline // @Tags exam-prep // @Produce json -// @Security Bearer // @Param user_id path int true "Target user ID" // @Param limit query int false "Max recent-activity items (default 40, max 120)" // @Param include_practices query bool false "Include practice completions in recent-activity feed" @@ -86,6 +87,9 @@ func (h *Handler) AdminGetUserSubscriptions(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/users/{user_id}/learning-activity [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AdminGetUserLearningActivityDetails(c *fiber.Ctx) error { targetID, err := parseAdminTargetUserID(c) if err != nil { diff --git a/internal/web_server/handlers/analytics_handler.go b/internal/web_server/handlers/analytics_handler.go index 8807a268..223cbc23 100644 --- a/internal/web_server/handlers/analytics_handler.go +++ b/internal/web_server/handlers/analytics_handler.go @@ -34,6 +34,9 @@ func toTime(v interface{}) time.Time { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/analytics/dashboard [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetAnalyticsDashboard(c *fiber.Ctx) error { filter, err := domain.ParseAnalyticsDateFilter(c) if err != nil { diff --git a/internal/web_server/handlers/arifpay.go b/internal/web_server/handlers/arifpay.go index bc99f577..fb434534 100644 --- a/internal/web_server/handlers/arifpay.go +++ b/internal/web_server/handlers/arifpay.go @@ -56,6 +56,9 @@ type paymentRes struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/payments/subscribe [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) InitiateSubscriptionPayment(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -113,6 +116,9 @@ func (h *Handler) InitiateSubscriptionPayment(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/verify/{session_id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) VerifyPayment(c *fiber.Ctx) error { sessionID := c.Params("session_id") if sessionID == "" { @@ -151,6 +157,10 @@ func (h *Handler) VerifyPayment(c *fiber.Ctx) error { // @Param offset query int false "Offset" default(0) // @Success 200 {object} domain.Response // @Router /api/v1/payments [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetMyPayments(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -190,6 +200,10 @@ func (h *Handler) GetMyPayments(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) GetPaymentByID(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -233,6 +247,9 @@ func (h *Handler) GetPaymentByID(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/payments/{id}/cancel [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CancelPayment(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -334,6 +351,8 @@ func paymentInitiationStatus(err error) int { // @Param nonce query string false "Fallback payment nonce" // @Success 200 {string} string "HTML success page" // @Router /api/v1/payments/arifpay/success [get] +// @Param sessionID query string false "Sessionid" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) HandleArifpaySuccessPage(c *fiber.Ctx) error { ref := firstNonEmpty( c.Query("session_id"), @@ -454,6 +473,9 @@ type verifyOTPReq struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/payments/direct [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) InitiateDirectPayment(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -507,6 +529,9 @@ func (h *Handler) InitiateDirectPayment(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/direct/verify-otp [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) VerifyDirectPaymentOTP(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { diff --git a/internal/web_server/handlers/auth_handler.go b/internal/web_server/handlers/auth_handler.go index 25396e7b..ad3120a8 100644 --- a/internal/web_server/handlers/auth_handler.go +++ b/internal/web_server/handlers/auth_handler.go @@ -37,6 +37,11 @@ type loginUserRes struct { // @Tags auth // @Param idToken body string true "Google ID Token from Android" // @Router /api/v1/auth/google/android [post] +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 401 {object} domain.ErrorResponse "Authentication failed" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GoogleAndroidLogin(c *fiber.Ctx) error { var req struct { IDToken string `json:"id_token" validate:"required" example:""` @@ -103,6 +108,11 @@ func (h *Handler) GoogleAndroidLogin(c *fiber.Ctx) error { // @Produce json // @Param body body object true "Apple login payload" // @Router /api/v1/auth/apple [post] +// @Success 200 {object} domain.Response +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 401 {object} domain.ErrorResponse "Authentication failed" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) AppleLogin(c *fiber.Ctx) error { var req struct { IDToken string `json:"id_token" validate:"required"` @@ -173,6 +183,9 @@ func (h *Handler) AppleLogin(c *fiber.Ctx) error { // @Summary Google login redirect // @Tags auth // @Router /api/v1/auth/google/login [get] +// @Success 302 {string} string "Redirect to Google authorization URL; see Location header" +// @Failure 503 {object} domain.ErrorResponse "Google OAuth is not configured" +// @Produce plain func (h *Handler) GoogleLogin(c *fiber.Ctx) error { state := uuid.NewString() url := h.authSvc.GenerateGoogleLoginURL(state) @@ -189,6 +202,12 @@ func (h *Handler) GoogleLogin(c *fiber.Ctx) error { // @Summary Google login callback // @Tags auth // @Router /api/v1/auth/google/callback [get] +// @Param code query string false "Code" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 401 {object} domain.ErrorResponse "Authentication failed" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GoogleCallback(c *fiber.Ctx) error { code := c.Query("code") @@ -257,6 +276,7 @@ func (h *Handler) GoogleCallback(c *fiber.Ctx) error { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/auth/customer-login [post] +// @Failure 403 {object} domain.ErrorResponse "Access denied" func (h *Handler) LoginUser(c *fiber.Ctx) error { var req domain.LoginRequest if err := c.BodyParser(&req); err != nil { @@ -406,6 +426,7 @@ type LoginAdminRes struct { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/auth/admin-login [post] +// @Failure 403 {string} string "Access denied" func (h *Handler) LoginAdmin(c *fiber.Ctx) error { var req domain.LoginRequest if err := c.BodyParser(&req); err != nil { @@ -508,6 +529,7 @@ func (h *Handler) LoginAdmin(c *fiber.Ctx) error { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/auth/super-login [post] +// @Failure 403 {string} string "Access denied" func (h *Handler) LoginSuper(c *fiber.Ctx) error { var req domain.LoginRequest if err := c.BodyParser(&req); err != nil { @@ -614,6 +636,7 @@ type refreshToken struct { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/auth/refresh [post] +// @Failure 403 {string} string "Access denied" func (h *Handler) RefreshToken(c *fiber.Ctx) error { type loginUserRes struct { @@ -754,6 +777,8 @@ type logoutReq struct { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/auth/logout [post] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) LogOutuser(c *fiber.Ctx) error { var req logoutReq if err := c.BodyParser(&req); err != nil { diff --git a/internal/web_server/handlers/chapa.go b/internal/web_server/handlers/chapa.go index aec5d267..4246a612 100644 --- a/internal/web_server/handlers/chapa.go +++ b/internal/web_server/handlers/chapa.go @@ -20,6 +20,12 @@ import ( // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/payments/webhook [post] +// @Accept json +// @Param body body domain.ChapaWebhookPayload true "Exact signed Chapa webhook payload" +// @Param x-chapa-signature header string false "Webhook HMAC signature. Alternatively send chapa-signature; one of these headers is required." +// @Param chapa-signature header string false "Alternative signature header" +// @Failure 401 {object} domain.ErrorResponse "Authentication failed" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) HandleChapaWebhook(c *fiber.Ctx) error { body := c.Body() signature := c.Get("x-chapa-signature") @@ -84,6 +90,9 @@ func (h *Handler) logChapaWebhookActivity(c *fiber.Ctx, payload domain.ChapaWebh // @Param status query string false "Payment status" // @Success 200 {object} domain.Response // @Router /api/v1/payments/chapa/callback [get] +// @Param tx_ref query string false "Tx ref" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) HandleChapaCallback(c *fiber.Ctx) error { query := domain.ChapaCallbackQuery{ TrxRef: c.Query("trx_ref"), @@ -127,6 +136,8 @@ func (h *Handler) HandleChapaCallback(c *fiber.Ctx) error { // @Param status query string false "Payment status from Chapa redirect" // @Success 200 {string} string "HTML success page" // @Router /api/v1/payments/chapa/success [get] +// @Router /payment/success [get] +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) HandleChapaSuccessPage(c *fiber.Ctx) error { txRef := firstNonEmpty( c.Query("trx_ref"), diff --git a/internal/web_server/handlers/chapa_direct.go b/internal/web_server/handlers/chapa_direct.go index 996a62ed..1bb9a7a2 100644 --- a/internal/web_server/handlers/chapa_direct.go +++ b/internal/web_server/handlers/chapa_direct.go @@ -33,6 +33,9 @@ type authorizeChapaDirectPaymentReq struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/payments/chapa/direct [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) InitiateChapaDirectPayment(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -80,6 +83,9 @@ func (h *Handler) InitiateChapaDirectPayment(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/chapa/direct/authorize [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AuthorizeChapaDirectPayment(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { diff --git a/internal/web_server/handlers/email_template.go b/internal/web_server/handlers/email_template.go index 0b623d32..1f59f6b3 100644 --- a/internal/web_server/handlers/email_template.go +++ b/internal/web_server/handlers/email_template.go @@ -91,6 +91,9 @@ func mapEmailTemplateToRes(t domain.EmailTemplate) emailTemplateRes { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListEmailTemplatesAdmin(c *fiber.Ctx) error { status := strings.ToUpper(strings.TrimSpace(c.Query("status"))) var statusPtr *string @@ -151,6 +154,9 @@ func (h *Handler) ListEmailTemplatesAdmin(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetEmailTemplateByIDAdmin(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -190,6 +196,9 @@ func (h *Handler) GetEmailTemplateByIDAdmin(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates/slug/{slug} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetEmailTemplateBySlugAdmin(c *fiber.Ctx) error { slug := strings.TrimSpace(c.Params("slug")) if slug == "" { @@ -229,6 +238,9 @@ func (h *Handler) GetEmailTemplateBySlugAdmin(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateEmailTemplate(c *fiber.Ctx) error { var req createEmailTemplateReq if err := c.BodyParser(&req); err != nil { @@ -281,6 +293,9 @@ func (h *Handler) CreateEmailTemplate(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateEmailTemplate(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -337,6 +352,9 @@ func (h *Handler) UpdateEmailTemplate(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteEmailTemplate(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -379,6 +397,9 @@ func (h *Handler) DeleteEmailTemplate(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates/slug/{slug}/preview [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) PreviewEmailTemplateBySlug(c *fiber.Ctx) error { slug := strings.TrimSpace(c.Params("slug")) if slug == "" { @@ -426,6 +447,9 @@ func (h *Handler) PreviewEmailTemplateBySlug(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates/{id}/preview [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) PreviewEmailTemplateByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { diff --git a/internal/web_server/handlers/exam_prep_assessment_handler.go b/internal/web_server/handlers/exam_prep_assessment_handler.go index ce0b8bd8..026b7f5a 100644 --- a/internal/web_server/handlers/exam_prep_assessment_handler.go +++ b/internal/web_server/handlers/exam_prep_assessment_handler.go @@ -21,11 +21,16 @@ func assessmentParentFromQuery(c *fiber.Ctx) (domain.ExamPrepAssessmentParent, e } // ListExamPrepAssessments godoc -// @Summary ListExamPrepAssessments -// @Tags client -// @Security Bearer +// @Summary List Exam Prep Assessments +// @Tags exam-prep // @Router /api/v1/admin/exam-prep/assessments [get] // @Router /api/v1/exam-prep/assessments [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) ListExamPrepAssessments(c *fiber.Ctx) error { parent, err := assessmentParentFromQuery(c) if err != nil || parent.Kind == "" { @@ -39,10 +44,17 @@ func (h *Handler) ListExamPrepAssessments(c *fiber.Ctx) error { } // LinkExamPrepAssessment godoc -// @Summary LinkExamPrepAssessment -// @Tags admin -// @Security Bearer +// @Summary Link Exam Prep Assessment +// @Tags exam-prep // @Router /api/v1/admin/exam-prep/assessments [post] +// @Security Bearer +// @Accept json +// @Param body body domain.LinkExamPrepAssessmentInput true "Request payload" +// @Success 201 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) LinkExamPrepAssessment(c *fiber.Ctx) error { var input domain.LinkExamPrepAssessmentInput if err := c.BodyParser(&input); err != nil { @@ -60,10 +72,20 @@ func (h *Handler) LinkExamPrepAssessment(c *fiber.Ctx) error { } // UnlinkExamPrepAssessment godoc -// @Summary UnlinkExamPrepAssessment -// @Tags admin -// @Security Bearer +// @Summary Unlink Exam Prep Assessment +// @Tags exam-prep // @Router /api/v1/admin/exam-prep/assessments/{questionSetId}/parents/{parentKind}/{parentId} [delete] +// @Security Bearer +// @Param parentId path int64 true "Parent id" +// @Param parentKind path string true "Parent kind" +// @Param questionSetId path int64 true "Question set id" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UnlinkExamPrepAssessment(c *fiber.Ctx) error { questionSetID, err := parseAssessmentID(c.Params("questionSetId")) if err != nil { diff --git a/internal/web_server/handlers/exam_prep_catalog_course_handler.go b/internal/web_server/handlers/exam_prep_catalog_course_handler.go index 21e12102..c95f26b5 100644 --- a/internal/web_server/handlers/exam_prep_catalog_course_handler.go +++ b/internal/web_server/handlers/exam_prep_catalog_course_handler.go @@ -20,6 +20,10 @@ import ( // @Success 201 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/admin/exam-prep/catalog-courses [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreateExamPrepCatalogCourse(c *fiber.Ctx) error { var req domain.CreateExamPrepCatalogCourseInput if err := c.BodyParser(&req); err != nil { @@ -59,6 +63,10 @@ func (h *Handler) CreateExamPrepCatalogCourse(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Router /api/v1/admin/exam-prep/catalog-courses [get] // @Router /api/v1/exam-prep/catalog-courses [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListExamPrepCatalogCourses(c *fiber.Ctx) error { limit, _ := strconv.Atoi(c.Query("limit", "20")) offset, _ := strconv.Atoi(c.Query("offset", "0")) @@ -99,6 +107,11 @@ func (h *Handler) ListExamPrepCatalogCourses(c *fiber.Ctx) error { // @Param body body domain.ReorderIDsRequest true "ordered_ids: every catalog course id exactly once" // @Success 200 {object} domain.Response // @Router /api/v1/admin/exam-prep/catalog-courses/reorder [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ReorderExamPrepCatalogCourses(c *fiber.Ctx) error { var req domain.ReorderIDsRequest if err := c.BodyParser(&req); err != nil { @@ -140,6 +153,12 @@ func (h *Handler) ReorderExamPrepCatalogCourses(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Router /api/v1/admin/exam-prep/catalog-courses/{id} [get] // @Router /api/v1/exam-prep/catalog-courses/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetExamPrepCatalogCourseByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -191,6 +210,12 @@ func (h *Handler) GetExamPrepCatalogCourseByID(c *fiber.Ctx) error { // @Param body body domain.UpdateExamPrepCatalogCourseInput true "Fields to update" // @Success 200 {object} domain.Response // @Router /api/v1/admin/exam-prep/catalog-courses/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdateExamPrepCatalogCourse(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -234,6 +259,13 @@ func (h *Handler) UpdateExamPrepCatalogCourse(c *fiber.Ctx) error { // @Param id path int true "Catalog course ID" // @Success 200 {object} domain.Response // @Router /api/v1/admin/exam-prep/catalog-courses/{id} [delete] +// @Security Bearer +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeleteExamPrepCatalogCourse(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/exam_prep_lesson_handler.go b/internal/web_server/handlers/exam_prep_lesson_handler.go index 5ff99765..ec4f0944 100644 --- a/internal/web_server/handlers/exam_prep_lesson_handler.go +++ b/internal/web_server/handlers/exam_prep_lesson_handler.go @@ -16,6 +16,14 @@ import ( // @Param moduleId path int true "Exam prep unit module ID" // @Param body body domain.CreateExamPrepLessonInput true "Lesson" // @Router /api/v1/admin/exam-prep/modules/{moduleId}/lessons [post] +// @Security Bearer +// @Success 201 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreateExamPrepLesson(c *fiber.Ctx) error { moduleID, err := strconv.ParseInt(c.Params("moduleId"), 10, 64) if err != nil { @@ -67,6 +75,14 @@ func (h *Handler) CreateExamPrepLesson(c *fiber.Ctx) error { // @Param offset query int false "Offset" default(0) // @Router /api/v1/admin/exam-prep/modules/{moduleId}/lessons [get] // @Router /api/v1/exam-prep/modules/{moduleId}/lessons [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListExamPrepLessonsByUnitModule(c *fiber.Ctx) error { moduleID, err := strconv.ParseInt(c.Params("moduleId"), 10, 64) if err != nil { @@ -129,6 +145,17 @@ func (h *Handler) ListExamPrepLessonsByUnitModule(c *fiber.Ctx) error { // @Summary Reorder lessons within an exam-prep unit module // @Tags exam-prep // @Router /api/v1/admin/exam-prep/modules/{moduleId}/lessons/reorder [put] +// @Security Bearer +// @Param moduleId path int64 true "Module id" +// @Accept json +// @Param body body domain.ReorderIDsRequest true "Request payload" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ReorderExamPrepLessonsInUnitModule(c *fiber.Ctx) error { moduleID, err := strconv.ParseInt(c.Params("moduleId"), 10, 64) if err != nil { @@ -181,6 +208,15 @@ func (h *Handler) ReorderExamPrepLessonsInUnitModule(c *fiber.Ctx) error { // @Tags exam-prep // @Router /api/v1/admin/exam-prep/lessons/{id} [get] // @Router /api/v1/exam-prep/lessons/{id} [get] +// @Security Bearer +// @Param id path int64 true "Id" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetExamPrepLessonByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -231,6 +267,17 @@ func (h *Handler) GetExamPrepLessonByID(c *fiber.Ctx) error { // @Summary Update exam-prep lesson // @Tags exam-prep // @Router /api/v1/admin/exam-prep/lessons/{id} [put] +// @Security Bearer +// @Param id path int64 true "Id" +// @Accept json +// @Param body body domain.UpdateExamPrepLessonInput true "Request payload" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdateExamPrepLesson(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -272,6 +319,15 @@ func (h *Handler) UpdateExamPrepLesson(c *fiber.Ctx) error { // @Summary Delete exam-prep lesson // @Tags exam-prep // @Router /api/v1/admin/exam-prep/lessons/{id} [delete] +// @Security Bearer +// @Param id path int64 true "Id" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeleteExamPrepLesson(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/exam_prep_module_handler.go b/internal/web_server/handlers/exam_prep_module_handler.go index 2f750f23..13ac1d62 100644 --- a/internal/web_server/handlers/exam_prep_module_handler.go +++ b/internal/web_server/handlers/exam_prep_module_handler.go @@ -16,6 +16,14 @@ import ( // @Param unitId path int true "Unit ID" // @Param body body domain.CreateExamPrepModuleInput true "Module" // @Router /api/v1/admin/exam-prep/units/{unitId}/modules [post] +// @Security Bearer +// @Success 201 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreateExamPrepModule(c *fiber.Ctx) error { unitID, err := strconv.ParseInt(c.Params("unitId"), 10, 64) if err != nil { @@ -65,6 +73,16 @@ func (h *Handler) CreateExamPrepModule(c *fiber.Ctx) error { // @Param unitId path int true "Unit ID" // @Router /api/v1/admin/exam-prep/units/{unitId}/modules [get] // @Router /api/v1/exam-prep/units/{unitId}/modules [get] +// @Security Bearer +// @Param limit query int false "Limit" default(20) +// @Param offset query int false "Offset" default(0) minimum(0) +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListExamPrepModulesByUnit(c *fiber.Ctx) error { unitID, err := strconv.ParseInt(c.Params("unitId"), 10, 64) if err != nil { @@ -129,6 +147,14 @@ func (h *Handler) ListExamPrepModulesByUnit(c *fiber.Ctx) error { // @Param unitId path int true "Unit ID" // @Param body body domain.ReorderIDsRequest true "ordered_ids" // @Router /api/v1/admin/exam-prep/units/{unitId}/modules/reorder [put] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ReorderExamPrepModulesInUnit(c *fiber.Ctx) error { unitID, err := strconv.ParseInt(c.Params("unitId"), 10, 64) if err != nil { @@ -181,6 +207,15 @@ func (h *Handler) ReorderExamPrepModulesInUnit(c *fiber.Ctx) error { // @Tags exam-prep // @Router /api/v1/admin/exam-prep/modules/{id} [get] // @Router /api/v1/exam-prep/modules/{id} [get] +// @Security Bearer +// @Param id path int64 true "Id" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetExamPrepModuleByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -231,6 +266,17 @@ func (h *Handler) GetExamPrepModuleByID(c *fiber.Ctx) error { // @Summary Update exam-prep module // @Tags exam-prep // @Router /api/v1/admin/exam-prep/modules/{id} [put] +// @Security Bearer +// @Param id path int64 true "Id" +// @Accept json +// @Param body body domain.UpdateExamPrepModuleInput true "Request payload" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdateExamPrepModule(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -272,6 +318,15 @@ func (h *Handler) UpdateExamPrepModule(c *fiber.Ctx) error { // @Summary Delete exam-prep module // @Tags exam-prep // @Router /api/v1/admin/exam-prep/modules/{id} [delete] +// @Security Bearer +// @Param id path int64 true "Id" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeleteExamPrepModule(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/exam_prep_practice_handler.go b/internal/web_server/handlers/exam_prep_practice_handler.go index 5984ff51..9b9a94f1 100644 --- a/internal/web_server/handlers/exam_prep_practice_handler.go +++ b/internal/web_server/handlers/exam_prep_practice_handler.go @@ -15,6 +15,13 @@ import ( // @Tags exam-prep // @Param body body domain.CreateExamPrepPracticeInput true "Practice" // @Router /api/v1/admin/exam-prep/practices [post] +// @Security Bearer +// @Success 201 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreateExamPrepPracticeFromInput(c *fiber.Ctx) error { var req domain.CreateExamPrepPracticeInput if err := c.BodyParser(&req); err != nil { @@ -56,6 +63,13 @@ func (h *Handler) CreateExamPrepPracticeFromInput(c *fiber.Ctx) error { // @Param unlinked_only query bool false "When true, return only practices with no parent links (admin)" // @Router /api/v1/admin/exam-prep/practices [get] // @Router /api/v1/exam-prep/practices [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListAllExamPrepPractices(c *fiber.Ctx) error { limit, offset, err := parseOptionalExamPrepPracticePagination(c) if err != nil { @@ -132,6 +146,13 @@ func (h *Handler) CreateExamPrepPractice(c *fiber.Ctx) error { // @Param offset query int false "Offset (used when limit is provided)" // @Router /api/v1/admin/exam-prep/lessons/{lessonId}/practices [get] // @Router /api/v1/exam-prep/lessons/{lessonId}/practices [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListExamPrepPracticesByLesson(c *fiber.Ctx) error { lessonID, err := strconv.ParseInt(c.Params("lessonId"), 10, 64) if err != nil { @@ -167,6 +188,14 @@ func (h *Handler) ListExamPrepPracticesByLesson(c *fiber.Ctx) error { // @Param id path int true "Exam prep practice ID" // @Router /api/v1/admin/exam-prep/practices/{id} [get] // @Router /api/v1/exam-prep/practices/{id} [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetExamPrepPracticeByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -208,6 +237,14 @@ func (h *Handler) GetExamPrepPracticeByID(c *fiber.Ctx) error { // @Param id path int true "Exam prep practice ID" // @Param body body domain.UpdateExamPrepPracticeInput true "Fields to update" // @Router /api/v1/admin/exam-prep/practices/{id} [put] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdateExamPrepPractice(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -260,6 +297,14 @@ func (h *Handler) UpdateExamPrepPractice(c *fiber.Ctx) error { // @Param id path int true "Exam prep practice ID" // @Param body body domain.UpdateExamPrepPracticeParentsInput true "Parent links (replaces all; use empty array to detach)" // @Router /api/v1/admin/exam-prep/practices/{id}/parents [put] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdateExamPrepPracticeParents(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -316,6 +361,14 @@ func (h *Handler) UpdateExamPrepPracticeParents(c *fiber.Ctx) error { // @Param parentKind path string true "Parent kind (CATALOG_COURSE, UNIT, LESSON)" // @Param parentId path int true "Parent entity ID" // @Router /api/v1/admin/exam-prep/practices/{id}/parents/{parentKind}/{parentId} [delete] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UnlinkExamPrepPracticeParent(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -370,6 +423,14 @@ func (h *Handler) UnlinkExamPrepPracticeParent(c *fiber.Ctx) error { // @Tags exam-prep // @Param id path int true "Exam prep practice ID" // @Router /api/v1/admin/exam-prep/practices/{id} [delete] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeleteExamPrepPractice(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -460,6 +521,13 @@ func (h *Handler) listExamPrepPracticesResponse(c *fiber.Ctx, items []domain.Exa // @Param catalogCourseId path int true "Exam prep catalog course ID" // @Param body body domain.CreateExamPrepPracticeInput true "Practice" // @Router /api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/practices [post] +// @Security Bearer +// @Success 201 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreateExamPrepPracticeForCatalogCourse(c *fiber.Ctx) error { catalogCourseID, err := strconv.ParseInt(c.Params("catalogCourseId"), 10, 64) if err != nil { @@ -493,6 +561,13 @@ func (h *Handler) CreateExamPrepPracticeForCatalogCourse(c *fiber.Ctx) error { // @Param offset query int false "Offset (used when limit is provided)" // @Router /api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/practices [get] // @Router /api/v1/exam-prep/catalog-courses/{catalogCourseId}/practices [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListExamPrepPracticesByCatalogCourse(c *fiber.Ctx) error { catalogCourseID, err := strconv.ParseInt(c.Params("catalogCourseId"), 10, 64) if err != nil { @@ -522,6 +597,13 @@ func (h *Handler) ListExamPrepPracticesByCatalogCourse(c *fiber.Ctx) error { // @Param unitId path int true "Exam prep unit ID" // @Param body body domain.CreateExamPrepPracticeInput true "Practice" // @Router /api/v1/admin/exam-prep/units/{unitId}/practices [post] +// @Security Bearer +// @Success 201 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreateExamPrepPracticeForUnit(c *fiber.Ctx) error { unitID, err := strconv.ParseInt(c.Params("unitId"), 10, 64) if err != nil { @@ -555,6 +637,13 @@ func (h *Handler) CreateExamPrepPracticeForUnit(c *fiber.Ctx) error { // @Param offset query int false "Offset (used when limit is provided)" // @Router /api/v1/admin/exam-prep/units/{unitId}/practices [get] // @Router /api/v1/exam-prep/units/{unitId}/practices [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListExamPrepPracticesByUnit(c *fiber.Ctx) error { unitID, err := strconv.ParseInt(c.Params("unitId"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/exam_prep_unit_handler.go b/internal/web_server/handlers/exam_prep_unit_handler.go index bc2545de..a2ca4e1f 100644 --- a/internal/web_server/handlers/exam_prep_unit_handler.go +++ b/internal/web_server/handlers/exam_prep_unit_handler.go @@ -20,6 +20,12 @@ import ( // @Param body body domain.CreateExamPrepUnitInput true "Unit" // @Success 201 {object} domain.Response // @Router /api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/units [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreateExamPrepUnit(c *fiber.Ctx) error { catalogCourseID, err := strconv.ParseInt(c.Params("catalogCourseId"), 10, 64) if err != nil { @@ -72,6 +78,13 @@ func (h *Handler) CreateExamPrepUnit(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Router /api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/units [get] // @Router /api/v1/exam-prep/catalog-courses/{catalogCourseId}/units [get] +// @Security Bearer +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListExamPrepUnitsByCatalogCourse(c *fiber.Ctx) error { catalogCourseID, err := strconv.ParseInt(c.Params("catalogCourseId"), 10, 64) if err != nil { @@ -136,6 +149,14 @@ func (h *Handler) ListExamPrepUnitsByCatalogCourse(c *fiber.Ctx) error { // @Param catalogCourseId path int true "Catalog course ID" // @Param body body domain.ReorderIDsRequest true "ordered_ids: every unit id in this catalog course, new order" // @Router /api/v1/admin/exam-prep/catalog-courses/{catalogCourseId}/units/reorder [put] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ReorderExamPrepUnitsInCatalogCourse(c *fiber.Ctx) error { catalogCourseID, err := strconv.ParseInt(c.Params("catalogCourseId"), 10, 64) if err != nil { @@ -189,6 +210,14 @@ func (h *Handler) ReorderExamPrepUnitsInCatalogCourse(c *fiber.Ctx) error { // @Param id path int true "Unit ID" // @Router /api/v1/admin/exam-prep/units/{id} [get] // @Router /api/v1/exam-prep/units/{id} [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetExamPrepUnitByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -241,6 +270,14 @@ func (h *Handler) GetExamPrepUnitByID(c *fiber.Ctx) error { // @Param id path int true "Unit ID" // @Param body body domain.UpdateExamPrepUnitInput true "Fields to update" // @Router /api/v1/admin/exam-prep/units/{id} [put] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdateExamPrepUnit(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -283,6 +320,14 @@ func (h *Handler) UpdateExamPrepUnit(c *fiber.Ctx) error { // @Tags exam-prep // @Param id path int true "Unit ID" // @Router /api/v1/admin/exam-prep/units/{id} [delete] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeleteExamPrepUnit(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/faq.go b/internal/web_server/handlers/faq.go index 996a1cb9..e186c1db 100644 --- a/internal/web_server/handlers/faq.go +++ b/internal/web_server/handlers/faq.go @@ -128,6 +128,7 @@ func (h *Handler) ListPublicFAQs(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/faqs/{id} [get] +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetPublicFAQByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -169,6 +170,9 @@ func (h *Handler) GetPublicFAQByID(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/faqs [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListFAQsAdmin(c *fiber.Ctx) error { status := strings.ToUpper(strings.TrimSpace(c.Query("status"))) var statusPtr *string @@ -229,6 +233,9 @@ func (h *Handler) ListFAQsAdmin(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/faqs/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetFAQByIDAdmin(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -268,6 +275,9 @@ func (h *Handler) GetFAQByIDAdmin(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/faqs [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateFAQ(c *fiber.Ctx) error { var req createFAQReq if err := c.BodyParser(&req); err != nil { @@ -318,6 +328,9 @@ func (h *Handler) CreateFAQ(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/faqs/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateFAQ(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -373,6 +386,9 @@ func (h *Handler) UpdateFAQ(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/faqs/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteFAQ(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { diff --git a/internal/web_server/handlers/field_option.go b/internal/web_server/handlers/field_option.go index 5cd24d14..bea75a8a 100644 --- a/internal/web_server/handlers/field_option.go +++ b/internal/web_server/handlers/field_option.go @@ -119,6 +119,9 @@ func (h *Handler) ListFieldKeys(c *fiber.Ctx) error { // @Param offset query int false "Offset" // @Success 200 {object} domain.Response // @Router /api/v1/admin/field-options [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListFieldOptionsAdmin(c *fiber.Ctx) error { limit, _ := strconv.Atoi(c.Query("limit", "50")) offset, _ := strconv.Atoi(c.Query("offset", "0")) @@ -158,6 +161,10 @@ func (h *Handler) ListFieldOptionsAdmin(c *fiber.Ctx) error { // @Param id path int true "Option ID" // @Success 200 {object} domain.Response // @Router /api/v1/admin/field-options/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) GetFieldOptionByIDAdmin(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -186,6 +193,10 @@ func (h *Handler) GetFieldOptionByIDAdmin(c *fiber.Ctx) error { // @Param body body createFieldOptionReq true "Create option" // @Success 201 {object} domain.Response // @Router /api/v1/admin/field-options [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) CreateFieldOption(c *fiber.Ctx) error { var req createFieldOptionReq if err := c.BodyParser(&req); err != nil { @@ -230,6 +241,10 @@ func (h *Handler) CreateFieldOption(c *fiber.Ctx) error { // @Param body body updateFieldOptionReq true "Update option" // @Success 200 {object} domain.Response // @Router /api/v1/admin/field-options/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) UpdateFieldOption(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -271,6 +286,12 @@ func (h *Handler) UpdateFieldOption(c *fiber.Ctx) error { // @Param id path int true "Option ID" // @Success 200 {object} domain.Response // @Router /api/v1/admin/field-options/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeleteFieldOption(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { diff --git a/internal/web_server/handlers/file_handler.go b/internal/web_server/handlers/file_handler.go index 978084e3..805759dd 100644 --- a/internal/web_server/handlers/file_handler.go +++ b/internal/web_server/handlers/file_handler.go @@ -77,6 +77,13 @@ func (h *Handler) resolveFileURL(c *fiber.Ctx, storedPath string) string { // @Success 200 {object} domain.Response // @Router /api/v1/admin/files/url [get] // @Router /api/v1/files/url [get] +// @Security Bearer +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) GetFileURL(c *fiber.Ctx) error { key := strings.TrimSpace(c.Query("key")) if key == "" { @@ -124,6 +131,12 @@ func (h *Handler) extractObjectKeyFromReference(reference string) (string, error // @Success 200 {object} domain.Response // @Router /api/v1/admin/files/refresh-url [post] // @Router /api/v1/files/refresh-url [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) RefreshFileURL(c *fiber.Ctx) error { if h.minioSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -177,6 +190,12 @@ func (h *Handler) RefreshFileURL(c *fiber.Ctx) error { // @Success 201 {object} domain.Response // @Router /api/v1/admin/files/presign-upload [post] // @Router /api/v1/files/presign-upload [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) CreatePresignedUpload(c *fiber.Ctx) error { if h.minioSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -268,6 +287,13 @@ func (h *Handler) CreatePresignedUpload(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Router /api/v1/admin/files/complete-upload [post] // @Router /api/v1/files/complete-upload [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) CompletePresignedUpload(c *fiber.Ctx) error { if h.minioSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -389,6 +415,13 @@ func objectKeyMatchesMediaType(objectKey, mediaType string) bool { // @Success 200 {object} domain.Response // @Router /api/v1/admin/files/upload [post] // @Router /api/v1/files/upload [post] +// @Security Bearer +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) UploadMedia(c *fiber.Ctx) error { mediaType := strings.ToLower(strings.TrimSpace(c.FormValue("media_type"))) sourceURL := strings.TrimSpace(c.FormValue("source_url")) @@ -633,6 +666,13 @@ func normalizeAndValidateMediaContentType(mediaType, contentType, fileName strin // @Success 200 {object} domain.Response // @Router /api/v1/admin/files/audio [post] // @Router /api/v1/files/audio [post] +// @Security Bearer +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) UploadAudio(c *fiber.Ctx) error { if h.minioSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -752,6 +792,13 @@ func (h *Handler) UploadAudio(c *fiber.Ctx) error { // @Param file formData file true "Audio recording" // @Success 200 {object} domain.Response // @Router /api/v1/questions/audio-answer [post] +// @Security Bearer +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) SubmitAudioAnswer(c *fiber.Ctx) error { if h.minioSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ diff --git a/internal/web_server/handlers/issue_reporting.go b/internal/web_server/handlers/issue_reporting.go index 23573f7d..aa4ea895 100644 --- a/internal/web_server/handlers/issue_reporting.go +++ b/internal/web_server/handlers/issue_reporting.go @@ -60,13 +60,14 @@ func mapIssueToRes(issue domain.ReportedIssue) issueRes { // @Tags issues // @Accept json // @Produce json -// @Security Bearer // @Param body body createIssueReq true "Issue report payload" // @Success 201 {object} domain.Response{data=issueRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/issues [post] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateIssue(c *fiber.Ctx) error { var req createIssueReq if err := c.BodyParser(&req); err != nil { @@ -133,12 +134,14 @@ func (h *Handler) CreateIssue(c *fiber.Ctx) error { // @Description Returns a single issue report by its ID (admin only) // @Tags issues // @Produce json -// @Security Bearer // @Param id path int true "Issue ID" // @Success 200 {object} domain.Response{data=issueRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/issues/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetIssueByID(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -169,7 +172,6 @@ func (h *Handler) GetIssueByID(c *fiber.Ctx) error { // @Description Returns paginated issues reported by a specific user (admin only) // @Tags issues // @Produce json -// @Security Bearer // @Param user_id path int true "User ID" // @Param limit query int false "Limit" default(20) // @Param offset query int false "Offset" default(0) @@ -177,6 +179,9 @@ func (h *Handler) GetIssueByID(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/issues/user/{user_id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetUserIssues(c *fiber.Ctx) error { userIDStr := c.Params("user_id") userID, err := strconv.ParseInt(userIDStr, 10, 64) @@ -223,12 +228,14 @@ func (h *Handler) GetUserIssues(c *fiber.Ctx) error { // @Description Returns paginated issues reported by the authenticated user // @Tags issues // @Produce json -// @Security Bearer // @Param limit query int false "Limit" default(20) // @Param offset query int false "Offset" default(0) // @Success 200 {object} domain.Response{data=issueListRes} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/issues/me [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetMyIssues(c *fiber.Ctx) error { userID := c.Locals("user_id").(int64) @@ -268,12 +275,14 @@ func (h *Handler) GetMyIssues(c *fiber.Ctx) error { // @Description Returns all reported issues with pagination (admin only) // @Tags issues // @Produce json -// @Security Bearer // @Param limit query int false "Limit" default(20) // @Param offset query int false "Offset" default(0) // @Success 200 {object} domain.Response{data=issueListRes} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/issues [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetAllIssues(c *fiber.Ctx) error { limit, _ := strconv.Atoi(c.Query("limit", "20")) offset, _ := strconv.Atoi(c.Query("offset", "0")) @@ -312,13 +321,15 @@ func (h *Handler) GetAllIssues(c *fiber.Ctx) error { // @Tags issues // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Issue ID" // @Param body body updateIssueStatusReq true "Status update payload" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/issues/{id}/status [patch] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateIssueStatus(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -381,12 +392,14 @@ func (h *Handler) UpdateIssueStatus(c *fiber.Ctx) error { // @Description Deletes an issue report (admin only) // @Tags issues // @Produce json -// @Security Bearer // @Param id path int true "Issue ID" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/issues/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteIssue(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) diff --git a/internal/web_server/handlers/lms_persona_handler.go b/internal/web_server/handlers/lms_persona_handler.go index 4d32dd5e..aa34a90a 100644 --- a/internal/web_server/handlers/lms_persona_handler.go +++ b/internal/web_server/handlers/lms_persona_handler.go @@ -25,6 +25,12 @@ type listPersonasData struct { // @Param body body domain.CreateLmsPersonaInput true "Persona" // @Success 201 {object} domain.Response // @Router /api/v1/admin/personas [post] +// @Security Bearer +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CreatePersona(c *fiber.Ctx) error { var req domain.CreateLmsPersonaInput if err := c.BodyParser(&req); err != nil { @@ -63,6 +69,13 @@ func (h *Handler) CreatePersona(c *fiber.Ctx) error { // @Param offset query int false "Offset" // @Router /api/v1/admin/personas [get] // @Router /api/v1/personas [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListPersonas(c *fiber.Ctx) error { activeOnlyStr := strings.ToLower(strings.TrimSpace(c.Query("active_only", "true"))) activeOnly := activeOnlyStr != "false" @@ -98,6 +111,14 @@ func (h *Handler) ListPersonas(c *fiber.Ctx) error { // @Param id path int true "Persona ID" // @Router /api/v1/admin/personas/{id} [get] // @Router /api/v1/personas/{id} [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetPersona(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -123,6 +144,14 @@ func (h *Handler) GetPersona(c *fiber.Ctx) error { // @Param id path int true "Persona ID" // @Param body body domain.UpdateLmsPersonaInput true "Fields to update" // @Router /api/v1/admin/personas/{id} [put] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdatePersona(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -155,6 +184,13 @@ func (h *Handler) UpdatePersona(c *fiber.Ctx) error { // @Tags personas // @Param id path int true "Persona ID" // @Router /api/v1/admin/personas/{id} [delete] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeletePersona(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { diff --git a/internal/web_server/handlers/lms_progress_handler.go b/internal/web_server/handlers/lms_progress_handler.go index 843ded28..da2ddc2e 100644 --- a/internal/web_server/handlers/lms_progress_handler.go +++ b/internal/web_server/handlers/lms_progress_handler.go @@ -45,6 +45,9 @@ func (h *Handler) GetMyLMSProgress(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/exam-prep/progress-summary [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetMyLMSProgressSummary(c *fiber.Ctx) error { uid := c.Locals("user_id").(int64) role := c.Locals("role").(domain.Role) @@ -109,7 +112,6 @@ func (h *Handler) AdminGetUserLMSLearningActivity(c *fiber.Ctx) error { // @Description Reverse-chronological feed for profile UI: account joined plus LMS completion milestones (lessons/modules/courses/programs). Optional practice completions via include_practices. Does not include "started learning path" unless you add persisted engagement events—the schema stores completions only. // @Tags lms // @Produce json -// @Security Bearer // @Param user_id path int true "Target user ID" // @Param limit query int false "Max items after merge (default 40, max 120)" // @Param include_practices query bool false "Include completed LMS practices (more verbose)" @@ -118,6 +120,9 @@ func (h *Handler) AdminGetUserLMSLearningActivity(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/users/{user_id}/recent-activity [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AdminGetUserRecentActivity(c *fiber.Ctx) error { targetIDStr := c.Params("user_id") targetID, err := strconv.ParseInt(targetIDStr, 10, 64) diff --git a/internal/web_server/handlers/mobile_app_version_handler.go b/internal/web_server/handlers/mobile_app_version_handler.go index d1a9b33a..b4f94106 100644 --- a/internal/web_server/handlers/mobile_app_version_handler.go +++ b/internal/web_server/handlers/mobile_app_version_handler.go @@ -127,7 +127,6 @@ func (h *Handler) CheckMobileAppVersion(c *fiber.Ctx) error { // @Summary List mobile app versions (admin) // @Tags app-versions // @Produce json -// @Security Bearer // @Param platform query string false "Filter by ANDROID or IOS" // @Param status query string false "Filter by ACTIVE or INACTIVE" // @Param limit query int false "Limit (default 20)" @@ -136,6 +135,9 @@ func (h *Handler) CheckMobileAppVersion(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/app-versions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListMobileAppVersionsAdmin(c *fiber.Ctx) error { var platformPtr *string if platform := strings.TrimSpace(c.Query("platform")); platform != "" { @@ -193,13 +195,15 @@ func (h *Handler) ListMobileAppVersionsAdmin(c *fiber.Ctx) error { // @Summary Get mobile app version by ID (admin) // @Tags app-versions // @Produce json -// @Security Bearer // @Param id path int true "App version ID" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/app-versions/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetMobileAppVersionByIDAdmin(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -236,12 +240,14 @@ func (h *Handler) GetMobileAppVersionByIDAdmin(c *fiber.Ctx) error { // @Tags app-versions // @Accept json // @Produce json -// @Security Bearer // @Param body body createMobileAppVersionReq true "App version payload" // @Success 201 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/app-versions [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateMobileAppVersion(c *fiber.Ctx) error { var req createMobileAppVersionReq if err := c.BodyParser(&req); err != nil { @@ -293,7 +299,6 @@ func (h *Handler) CreateMobileAppVersion(c *fiber.Ctx) error { // @Tags app-versions // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "App version ID" // @Param body body updateMobileAppVersionReq true "App version payload" // @Success 200 {object} domain.Response @@ -301,6 +306,9 @@ func (h *Handler) CreateMobileAppVersion(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/app-versions/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateMobileAppVersion(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -358,13 +366,15 @@ func (h *Handler) UpdateMobileAppVersion(c *fiber.Ctx) error { // @Summary Delete mobile app version (admin) // @Tags app-versions // @Produce json -// @Security Bearer // @Param id path int true "App version ID" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/app-versions/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteMobileAppVersion(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/mongoLogger.go b/internal/web_server/handlers/mongoLogger.go index a4c47c3a..5488ab23 100644 --- a/internal/web_server/handlers/mongoLogger.go +++ b/internal/web_server/handlers/mongoLogger.go @@ -23,6 +23,9 @@ import ( // @Success 200 {object} domain.LogResponse "Paginated list of application logs" // @Failure 400 {object} domain.ErrorResponse "Invalid request parameters" // @Failure 500 {object} domain.ErrorResponse "Internal server error" +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Staff account and logs.list permission required" // @Router /api/v1/admin/logs [get] func GetLogsHandler(appCtx context.Context) fiber.Handler { return func(c *fiber.Ctx) error { diff --git a/internal/web_server/handlers/notification_handler.go b/internal/web_server/handlers/notification_handler.go index 3aa46c5d..003dba4f 100644 --- a/internal/web_server/handlers/notification_handler.go +++ b/internal/web_server/handlers/notification_handler.go @@ -34,11 +34,13 @@ func notificationRequestContext(c *fiber.Ctx) context.Context { } // ConnectSocket godoc -// @Summary ConnectSocket -// @Tags client +// @Summary Connect Socket +// @Tags ws // @Param token query string true "Access token" // @Router /api/v1/admin/ws/connect [get] // @Router /api/v1/ws/connect [get] +// @Success 101 {string} string "WebSocket protocol upgrade; subsequent messages are notification events" +// @Failure 401 {string} string "Authentication failed" func (h *Handler) ConnectSocket(c *fiber.Ctx) error { userID, ok := c.Locals("userID").(int64) if !ok || userID == 0 { @@ -156,6 +158,8 @@ func (w *hijackResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/{id} [get] // @Router /api/v1/notifications/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" func (h *Handler) GetNotificationByID(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -216,11 +220,18 @@ func (h *Handler) GetNotificationByID(c *fiber.Ctx) error { } // MarkNotificationAsRead godoc -// @Summary MarkNotificationAsRead -// @Tags client -// @Security Bearer +// @Summary Mark Notification As Read +// @Tags notifications // @Router /api/v1/admin/notifications/{id}/read [patch] // @Router /api/v1/notifications/{id}/read [patch] +// @Security Bearer +// @Param id path int64 true "Id" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) MarkNotificationAsRead(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -256,11 +267,16 @@ func (h *Handler) MarkNotificationAsRead(c *fiber.Ctx) error { } // MarkAllNotificationsAsRead godoc -// @Summary MarkAllNotificationsAsRead -// @Tags client -// @Security Bearer +// @Summary Mark All Notifications As Read +// @Tags notifications // @Router /api/v1/admin/notifications/mark-all-read [post] // @Router /api/v1/notifications/mark-all-read [post] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) MarkAllNotificationsAsRead(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok || userID == 0 { @@ -293,11 +309,18 @@ func (h *Handler) MarkAllNotificationsAsRead(c *fiber.Ctx) error { } // MarkNotificationAsUnread godoc -// @Summary MarkNotificationAsUnread -// @Tags client -// @Security Bearer +// @Summary Mark Notification As Unread +// @Tags notifications // @Router /api/v1/admin/notifications/{id}/unread [patch] // @Router /api/v1/notifications/{id}/unread [patch] +// @Security Bearer +// @Param id path int64 true "Id" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) MarkNotificationAsUnread(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -333,11 +356,16 @@ func (h *Handler) MarkNotificationAsUnread(c *fiber.Ctx) error { } // MarkAllNotificationsAsUnread godoc -// @Summary MarkAllNotificationsAsUnread -// @Tags client -// @Security Bearer +// @Summary Mark All Notifications As Unread +// @Tags notifications // @Router /api/v1/admin/notifications/mark-all-unread [post] // @Router /api/v1/notifications/mark-all-unread [post] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) MarkAllNotificationsAsUnread(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok || userID == 0 { @@ -370,11 +398,16 @@ func (h *Handler) MarkAllNotificationsAsUnread(c *fiber.Ctx) error { } // DeleteUserNotifications godoc -// @Summary DeleteUserNotifications -// @Tags client -// @Security Bearer +// @Summary Delete User Notifications +// @Tags notifications // @Router /api/v1/admin/notifications [delete] // @Router /api/v1/notifications [delete] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) DeleteUserNotifications(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok || userID == 0 { @@ -418,6 +451,9 @@ func (h *Handler) DeleteUserNotifications(c *fiber.Ctx) error { // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/{id} [delete] // @Router /api/v1/notifications/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteInAppNotification(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -478,6 +514,9 @@ func (h *Handler) DeleteInAppNotification(c *fiber.Ctx) error { // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/delete-in-app [post] // @Router /api/v1/notifications/delete-in-app [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteInAppNotifications(c *fiber.Ctx) error { type request struct { IDs []int64 `json:"ids"` @@ -536,10 +575,18 @@ func (h *Handler) DeleteInAppNotifications(c *fiber.Ctx) error { } // CreateAndSendNotification godoc -// @Summary CreateAndSendNotification -// @Tags admin -// @Security Bearer +// @Summary Create And Send Notification +// @Tags notifications // @Router /api/v1/admin/notifications/create [post] +// @Security Bearer +// @Accept json +// @Param body body handlers.CreateAndSendNotification.Request true "Notification recipient and delivery settings" +// @Success 201 {object} NotificationDispatchResponse +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request" +// @Failure 500 {string} string "Internal server error" func (h *Handler) CreateAndSendNotification(c *fiber.Ctx) error { type Request struct { RecipientID int64 `json:"recipient_id" validate:"required_if=DeliveryScheme single"` @@ -702,11 +749,19 @@ func (h *Handler) CreateAndSendNotification(c *fiber.Ctx) error { } // GetUserNotification godoc -// @Summary GetUserNotification -// @Tags client -// @Security Bearer +// @Summary Get User Notification +// @Tags notifications // @Router /api/v1/admin/notifications [get] // @Router /api/v1/notifications [get] +// @Security Bearer +// @Param limit query int false "Limit" default(10) +// @Param offset query int false "Offset" default(0) minimum(0) +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request" +// @Failure 500 {string} string "Internal server error" func (h *Handler) GetUserNotification(c *fiber.Ctx) error { limitStr := c.Query("limit", "10") offsetStr := c.Query("offset", "0") @@ -769,11 +824,16 @@ func (h *Handler) GetUserNotification(c *fiber.Ctx) error { // } // CountUnreadNotifications godoc -// @Summary CountUnreadNotifications -// @Tags client -// @Security Bearer +// @Summary Count Unread Notifications +// @Tags notifications // @Router /api/v1/admin/notifications/unread [get] // @Router /api/v1/notifications/unread [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {string} string "Internal server error" func (h *Handler) CountUnreadNotifications(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) @@ -804,10 +864,24 @@ func (h *Handler) CountUnreadNotifications(c *fiber.Ctx) error { } // GetAllNotifications godoc -// @Summary GetAllNotifications -// @Tags admin -// @Security Bearer +// @Summary Get All Notifications +// @Tags notifications // @Router /api/v1/admin/notifications/all [get] +// @Security Bearer +// @Param limit query int false "Limit" default(10) +// @Param page query int false "Page" default(1) +// @Param channel query string false "Channel" +// @Param type query string false "Type" +// @Param user_id query int false "User id" +// @Param is_read query bool false "Is read" +// @Param after query string false "After" +// @Param before query string false "Before" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request" +// @Failure 500 {string} string "Internal server error" func (h *Handler) GetAllNotifications(c *fiber.Ctx) error { limitStr := c.Query("limit", "10") pageStr := c.Query("page", "1") @@ -891,6 +965,9 @@ type SendSingleAfroSMSReq struct { // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/sendSMS [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) SendSingleAfroSMS(c *fiber.Ctx) error { var req SendSingleAfroSMSReq @@ -952,11 +1029,19 @@ func (h *Handler) SendSingleAfroSMS(c *fiber.Ctx) error { } // RegisterDeviceToken godoc -// @Summary RegisterDeviceToken -// @Tags client -// @Security Bearer +// @Summary Register Device Token +// @Tags devices // @Router /api/v1/admin/devices/register [post] // @Router /api/v1/devices/register [post] +// @Security Bearer +// @Accept json +// @Param body body handlers.RegisterDeviceToken.Request true "Device token and platform" +// @Success 201 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {string} string "Internal server error" func (h *Handler) RegisterDeviceToken(c *fiber.Ctx) error { type Request struct { DeviceToken string `json:"device_token" validate:"required"` @@ -1038,6 +1123,8 @@ func (h *Handler) RegisterDeviceToken(c *fiber.Ctx) error { // @Failure 401 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/test-push [post] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) SendTestPushNotification(c *fiber.Ctx) error { title := c.FormValue("title", "Test Push Notification") message := c.FormValue("message", "This is a test push notification from Rezina") @@ -1141,6 +1228,10 @@ func (h *Handler) SendTestPushNotification(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/bulk-push [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Success 201 {object} domain.Response "Scheduled notification created when scheduled_at is provided" func (h *Handler) SendBulkPushNotification(c *fiber.Ctx) error { title := c.FormValue("title") message := c.FormValue("message") @@ -1348,6 +1439,10 @@ func (h *Handler) SendBulkPushNotification(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/bulk-sms [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Success 201 {object} domain.Response "Scheduled notification created when scheduled_at is provided" func (h *Handler) SendBulkSMS(c *fiber.Ctx) error { type Request struct { Message string `json:"message" validate:"required"` @@ -1532,6 +1627,10 @@ func (h *Handler) SendBulkSMS(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/bulk-in-app [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Success 201 {object} domain.Response "Scheduled notification created when scheduled_at is provided" func (h *Handler) SendBulkInAppNotification(c *fiber.Ctx) error { type Request struct { Title string `json:"title" validate:"required"` @@ -1704,6 +1803,9 @@ func (h *Handler) SendBulkInAppNotification(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/scheduled/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetScheduledNotification(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -1744,6 +1846,9 @@ func (h *Handler) GetScheduledNotification(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/scheduled [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListScheduledNotifications(c *fiber.Ctx) error { limit, err := strconv.Atoi(c.Query("limit", "20")) if err != nil || limit <= 0 { @@ -1813,6 +1918,9 @@ func (h *Handler) ListScheduledNotifications(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/scheduled/{id}/cancel [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CancelScheduledNotification(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -1876,6 +1984,16 @@ func (h *Handler) parseEmailAttachment(c *fiber.Ctx) []*resend.Attachment { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/send-email [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Param email_template_slug formData string false "Saved template slug; otherwise subject and message or html are required" +// @Param template_variables formData string false "JSON object of template variables" +// @Param subject formData string false "Subject, required when no template is selected" +// @Param message formData string false "Plain-text body, required without a template unless html is supplied" +// @Param html formData string false "HTML body alternative to message" +// @Param file formData file false "Optional attachment" +// @Param recipient formData string true "Recipient email address" func (h *Handler) SendSingleEmail(c *fiber.Ctx) error { recipient := strings.TrimSpace(c.FormValue("recipient")) if recipient == "" { @@ -1931,6 +2049,22 @@ func (h *Handler) SendSingleEmail(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/bulk-email [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Param email_template_slug formData string false "Saved template slug; otherwise subject and message or html are required" +// @Param template_variables formData string false "JSON object of template variables" +// @Param subject formData string false "Subject, required when no template is selected" +// @Param message formData string false "Plain-text body, required without a template unless html is supplied" +// @Param html formData string false "HTML body alternative to message" +// @Param file formData file false "Optional attachment" +// @Param emails formData string false "Comma-separated direct email addresses" +// @Param user_ids formData string false "Comma-separated customer IDs" +// @Param role formData string false "Customer role used to select recipients" +// @Param team_member_ids formData string false "Comma-separated team-member IDs" +// @Param team_role formData string false "Team role used to select recipients" +// @Param scheduled_at formData string false "Optional future delivery time in RFC3339 format" +// @Success 201 {object} domain.Response "Scheduled notification created when scheduled_at is provided" func (h *Handler) SendBulkEmail(c *fiber.Ctx) error { role := c.FormValue("role") userIDsRaw := c.FormValue("user_ids") @@ -2119,11 +2253,19 @@ func (h *Handler) SendBulkEmail(c *fiber.Ctx) error { } // UnregisterDeviceToken godoc -// @Summary UnregisterDeviceToken -// @Tags client -// @Security Bearer +// @Summary Unregister Device Token +// @Tags devices // @Router /api/v1/admin/devices/unregister [post] // @Router /api/v1/devices/unregister [post] +// @Security Bearer +// @Accept json +// @Param body body handlers.UnregisterDeviceToken.Request true "Device token to unregister" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request" +// @Failure 500 {string} string "Internal server error" func (h *Handler) UnregisterDeviceToken(c *fiber.Ctx) error { type Request struct { DeviceToken string `json:"device_token" validate:"required"` diff --git a/internal/web_server/handlers/payments_admin.go b/internal/web_server/handlers/payments_admin.go index 270b7f64..e0876ae1 100644 --- a/internal/web_server/handlers/payments_admin.go +++ b/internal/web_server/handlers/payments_admin.go @@ -91,6 +91,10 @@ type listAdminPaymentsRes struct { // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/admin/payments [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListAdminPayments(c *fiber.Ctx) error { filter, err := parsePaymentListFilter(c) if err != nil { @@ -133,6 +137,13 @@ func (h *Handler) ListAdminPayments(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/payments/{id} [get] +// @Security Bearer +// @Param limit query int false "Limit" default(20) +// @Param offset query int false "Offset" default(0) minimum(0) +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetAdminPayment(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/practice_full_update_handler.go b/internal/web_server/handlers/practice_full_update_handler.go index ca770435..f7b64105 100644 --- a/internal/web_server/handlers/practice_full_update_handler.go +++ b/internal/web_server/handlers/practice_full_update_handler.go @@ -240,6 +240,10 @@ func (h *Handler) GetLmsPracticeFull(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/exam-prep/practices/{id}/full [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetExamPrepPracticeFull(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -381,6 +385,10 @@ func (h *Handler) UpdateLmsPracticeFull(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/exam-prep/practices/{id}/full [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) UpdateExamPrepPracticeFull(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { diff --git a/internal/web_server/handlers/question_type_builder.go b/internal/web_server/handlers/question_type_builder.go index af504265..bba122d9 100644 --- a/internal/web_server/handlers/question_type_builder.go +++ b/internal/web_server/handlers/question_type_builder.go @@ -106,6 +106,9 @@ func parseOptionalGroupIDQuery(c *fiber.Ctx) (*int64, error) { // @Produce json // @Success 200 {object} domain.Response // @Router /api/v1/admin/questions/component-catalog [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetQuestionTypeComponentCatalog(c *fiber.Ctx) error { return c.JSON(domain.Response{ Message: "Component catalog", @@ -126,6 +129,9 @@ func (h *Handler) GetQuestionTypeComponentCatalog(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/validate-question-type-definition [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ValidateQuestionTypeDefinition(c *fiber.Ctx) error { var req validateQuestionTypeDefinitionReq if err := c.BodyParser(&req); err != nil { @@ -159,6 +165,10 @@ func (h *Handler) ValidateQuestionTypeDefinition(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) CreateQuestionTypeDefinition(c *fiber.Ctx) error { var req createQuestionTypeDefinitionReq if err := c.BodyParser(&req); err != nil { @@ -223,6 +233,10 @@ func (h *Handler) CreateQuestionTypeDefinition(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) ListQuestionTypeDefinitions(c *fiber.Ctx) error { status := strings.ToUpper(strings.TrimSpace(c.Query("status"))) var statusPtr *string @@ -301,6 +315,9 @@ func (h *Handler) ListQuestionTypeDefinitions(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetQuestionTypeDefinitionByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -336,6 +353,10 @@ func (h *Handler) GetQuestionTypeDefinitionByID(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id}/practices [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListPracticesByQuestionTypeDefinition(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -383,6 +404,10 @@ func (h *Handler) ListPracticesByQuestionTypeDefinition(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) UpdateQuestionTypeDefinition(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -456,6 +481,9 @@ func (h *Handler) UpdateQuestionTypeDefinition(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteQuestionTypeDefinition(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -491,6 +519,10 @@ func (h *Handler) DeleteQuestionTypeDefinition(c *fiber.Ctx) error { // @Param body body createQuestionTypeDefinitionGroupReq true "Group payload" // @Success 201 {object} domain.Response // @Router /api/v1/admin/questions/type-definition-groups [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) CreateQuestionTypeDefinitionGroup(c *fiber.Ctx) error { var req createQuestionTypeDefinitionGroupReq if err := c.BodyParser(&req); err != nil { @@ -539,6 +571,11 @@ func (h *Handler) CreateQuestionTypeDefinitionGroup(c *fiber.Ctx) error { // @Param offset query int false "Page offset" default(0) // @Success 200 {object} domain.Response // @Router /api/v1/admin/questions/type-definition-groups [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) ListQuestionTypeDefinitionGroups(c *fiber.Ctx) error { status := strings.ToUpper(strings.TrimSpace(c.Query("status"))) var statusPtr *string @@ -593,6 +630,11 @@ func (h *Handler) ListQuestionTypeDefinitionGroups(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definition-groups/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetQuestionTypeDefinitionGroupByID(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -631,6 +673,11 @@ func (h *Handler) GetQuestionTypeDefinitionGroupByID(c *fiber.Ctx) error { // @Param body body updateQuestionTypeDefinitionGroupReq true "Update group payload" // @Success 200 {object} domain.Response // @Router /api/v1/admin/questions/type-definition-groups/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) UpdateQuestionTypeDefinitionGroup(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { @@ -687,6 +734,11 @@ func (h *Handler) UpdateQuestionTypeDefinitionGroup(c *fiber.Ctx) error { // @Param id path int true "Group id" // @Success 200 {object} domain.Response // @Router /api/v1/admin/questions/type-definition-groups/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) DeleteQuestionTypeDefinitionGroup(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || id <= 0 { diff --git a/internal/web_server/handlers/questions.go b/internal/web_server/handlers/questions.go index 9a7df1ec..086a231d 100644 --- a/internal/web_server/handlers/questions.go +++ b/internal/web_server/handlers/questions.go @@ -216,6 +216,9 @@ func activityLogQuestionSummary(questionType string, stored string, payload *dom // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateQuestion(c *fiber.Ctx) error { var req createQuestionReq if err := c.BodyParser(&req); err != nil { @@ -370,6 +373,10 @@ func (h *Handler) CreateQuestion(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetQuestionByID(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -416,6 +423,9 @@ func (h *Handler) GetQuestionByID(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListQuestions(c *fiber.Ctx) error { questionType := c.Query("question_type") difficulty := c.Query("difficulty") @@ -479,6 +489,9 @@ func (h *Handler) ListQuestions(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/search [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) SearchQuestions(c *fiber.Ctx) error { query := c.Query("q") if query == "" { @@ -552,6 +565,10 @@ type updateQuestionReq struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) UpdateQuestion(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -722,6 +739,9 @@ func (h *Handler) UpdateQuestion(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteQuestion(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -842,6 +862,9 @@ func (h *Handler) enforcePracticeSequenceForStudent(c *fiber.Ctx, set domain.Que // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateQuestionSet(c *fiber.Ctx) error { var req createQuestionSetReq if err := c.BodyParser(&req); err != nil { @@ -911,6 +934,9 @@ func (h *Handler) CreateQuestionSet(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetQuestionSetByID(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -976,6 +1002,9 @@ func (h *Handler) GetQuestionSetByID(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetQuestionSetsByType(c *fiber.Ctx) error { setType := c.Query("set_type") if setType == "" { @@ -1039,6 +1068,9 @@ func (h *Handler) GetQuestionSetsByType(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/by-owner [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetQuestionSetsByOwner(c *fiber.Ctx) error { ownerType := c.Query("owner_type") ownerIDStr := c.Query("owner_id") @@ -1117,6 +1149,10 @@ type updateQuestionSetReq struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) UpdateQuestionSet(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -1199,6 +1235,9 @@ func (h *Handler) UpdateQuestionSet(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteQuestionSet(c *fiber.Ctx) error { idStr := c.Params("id") id, err := strconv.ParseInt(idStr, 10, 64) @@ -1344,6 +1383,9 @@ func questionSetItemsToRes( // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/questions [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AddQuestionToSet(c *fiber.Ctx) error { setIDStr := c.Params("setId") setID, err := strconv.ParseInt(setIDStr, 10, 64) @@ -1416,6 +1458,9 @@ func (h *Handler) AddQuestionToSet(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/question-types [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetQuestionTypesInSet(c *fiber.Ctx) error { setID, err := strconv.ParseInt(c.Params("setId"), 10, 64) if err != nil { @@ -1502,6 +1547,10 @@ func (h *Handler) questionSetStimulusContexts(ctx context.Context, setID int64) // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/questions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) GetQuestionsInSet(c *fiber.Ctx) error { setIDStr := c.Params("setId") setID, err := strconv.ParseInt(setIDStr, 10, 64) @@ -1632,6 +1681,9 @@ func (h *Handler) GetQuestionsInSet(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/exam-prep/practices/{practiceId}/questions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetQuestionsByPractice(c *fiber.Ctx) error { practiceIDStr := c.Params("practiceId") practiceID, err := strconv.ParseInt(practiceIDStr, 10, 64) @@ -1741,6 +1793,12 @@ func (h *Handler) GetQuestionsByPractice(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/exam-prep/progress/practices/{id}/complete [post] +// @Security Bearer +// @Accept json +// @Param body body domain.CompletePracticeInput false "Optional practice parent scope" +// @Param parent_kind query string false "Parent kind" +// @Param parent_id query int false "Parent id" +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" func (h *Handler) CompletePractice(c *fiber.Ctx) error { role := c.Locals("role").(domain.Role) if !role.IsCustomerLearnerRole() { @@ -1903,6 +1961,9 @@ func (h *Handler) CompletePractice(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/questions/{questionId} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) RemoveQuestionFromSet(c *fiber.Ctx) error { setIDStr := c.Params("setId") setID, err := strconv.ParseInt(setIDStr, 10, 64) @@ -1963,6 +2024,9 @@ type updateQuestionOrderReq struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/questions/{questionId}/order [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateQuestionOrderInSet(c *fiber.Ctx) error { setIDStr := c.Params("setId") setID, err := strconv.ParseInt(setIDStr, 10, 64) @@ -2047,6 +2111,9 @@ type addUserPersonaReq struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/personas [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetUserPersonasByQuestionSet(c *fiber.Ctx) error { setIDStr := c.Params("setId") setID, err := strconv.ParseInt(setIDStr, 10, 64) @@ -2096,6 +2163,9 @@ func (h *Handler) GetUserPersonasByQuestionSet(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/personas [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AddUserPersonaToQuestionSet(c *fiber.Ctx) error { setIDStr := c.Params("setId") setID, err := strconv.ParseInt(setIDStr, 10, 64) @@ -2149,6 +2219,9 @@ func (h *Handler) AddUserPersonaToQuestionSet(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/personas/{userId} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) RemoveUserPersonaFromQuestionSet(c *fiber.Ctx) error { setIDStr := c.Params("setId") setID, err := strconv.ParseInt(setIDStr, 10, 64) diff --git a/internal/web_server/handlers/ratings.go b/internal/web_server/handlers/ratings.go index 34cba96c..31a32b1a 100644 --- a/internal/web_server/handlers/ratings.go +++ b/internal/web_server/handlers/ratings.go @@ -63,6 +63,9 @@ func isValidTargetType(t string) bool { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/ratings [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) SubmitRating(c *fiber.Ctx) error { userID := c.Locals("user_id").(int64) @@ -114,6 +117,9 @@ func (h *Handler) SubmitRating(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/ratings/me [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetMyRating(c *fiber.Ctx) error { userID := c.Locals("user_id").(int64) @@ -164,6 +170,9 @@ func (h *Handler) GetMyRating(c *fiber.Ctx) error { // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/ratings [get] // @Router /api/v1/ratings [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetRatingsByTarget(c *fiber.Ctx) error { targetType := c.Query("target_type") if !isValidTargetType(targetType) { @@ -231,6 +240,9 @@ func (h *Handler) GetRatingsByTarget(c *fiber.Ctx) error { // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/ratings/summary [get] // @Router /api/v1/ratings/summary [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetRatingSummary(c *fiber.Ctx) error { targetType := c.Query("target_type") if !isValidTargetType(targetType) { @@ -276,6 +288,9 @@ func (h *Handler) GetRatingSummary(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/ratings/me/all [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetMyRatings(c *fiber.Ctx) error { userID := c.Locals("user_id").(int64) @@ -309,6 +324,9 @@ func (h *Handler) GetMyRatings(c *fiber.Ctx) error { // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/ratings/{id} [delete] // @Router /api/v1/ratings/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteRating(c *fiber.Ctx) error { userID := c.Locals("user_id").(int64) diff --git a/internal/web_server/handlers/rbac_handler.go b/internal/web_server/handlers/rbac_handler.go index 6e886d54..e34bba19 100644 --- a/internal/web_server/handlers/rbac_handler.go +++ b/internal/web_server/handlers/rbac_handler.go @@ -18,7 +18,6 @@ import ( // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Param query query string false "Search by role name" // @Param is_system query bool false "Filter by system role (true/false)" // @Param page query int false "Page number (default: 1)" @@ -26,6 +25,9 @@ import ( // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListRoles(c *fiber.Ctx) error { filter := domain.RoleListFilter{ Query: c.Query("query"), @@ -70,13 +72,15 @@ func (h *Handler) ListRoles(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Role ID" // @Success 200 {object} domain.Response{data=domain.RoleWithPermissions} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetRoleByID(c *fiber.Ctx) error { roleID, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || roleID <= 0 { @@ -131,12 +135,14 @@ func (h *Handler) GetRoleByID(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Param body body domain.CreateRoleReq true "Role creation payload" // @Success 201 {object} domain.Response{data=domain.RoleRecord} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CreateRole(c *fiber.Ctx) error { var req domain.CreateRoleReq if err := c.BodyParser(&req); err != nil { @@ -202,13 +208,15 @@ func (h *Handler) CreateRole(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Role ID" // @Param body body domain.UpdateRoleReq true "Role update payload" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateRole(c *fiber.Ctx) error { roleID, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || roleID <= 0 { @@ -280,12 +288,14 @@ func (h *Handler) UpdateRole(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Role ID" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteRole(c *fiber.Ctx) error { roleID, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || roleID <= 0 { @@ -333,13 +343,15 @@ func (h *Handler) DeleteRole(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Role ID" // @Param body body domain.SetRolePermissionsReq true "Permission IDs payload" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id}/permissions [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) SetRolePermissions(c *fiber.Ctx) error { roleID, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || roleID <= 0 { @@ -411,12 +423,14 @@ func (h *Handler) SetRolePermissions(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Role ID" // @Success 200 {object} domain.Response{data=[]domain.Permission} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id}/permissions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetRolePermissions(c *fiber.Ctx) error { roleID, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || roleID <= 0 { @@ -454,10 +468,12 @@ func (h *Handler) GetRolePermissions(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Success 200 {object} domain.Response{data=[]domain.Permission} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/permissions [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListPermissions(c *fiber.Ctx) error { permissions, err := h.rbacSvc.ListPermissions(c.Context()) if err != nil { @@ -491,10 +507,12 @@ func (h *Handler) ListPermissions(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Success 200 {object} domain.Response{data=[]string} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/permissions/groups [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListPermissionGroups(c *fiber.Ctx) error { groups, err := h.rbacSvc.ListPermissionGroups(c.Context()) if err != nil { @@ -523,10 +541,12 @@ func (h *Handler) ListPermissionGroups(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Security Bearer // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/permissions/sync [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) SyncPermissions(c *fiber.Ctx) error { if err := h.rbacSvc.SeedPermissions(c.Context()); err != nil { h.mongoLoggerSvc.Error("Failed to seed permissions", diff --git a/internal/web_server/handlers/referal_handlers.go b/internal/web_server/handlers/referal_handlers.go index 1f969364..475f30b6 100644 --- a/internal/web_server/handlers/referal_handlers.go +++ b/internal/web_server/handlers/referal_handlers.go @@ -58,8 +58,15 @@ func referralPagination(c *fiber.Ctx) (int32, int32, error) { // CreateReferralCode creates or returns the authenticated learner's stable share code. // @Router /api/v1/referrals/code [post] -// @Summary CreateReferralCode -// @Tags client +// @Summary Create Referral Code +// @Tags referrals +// @Security Bearer +// @Description Creates or returns the authenticated learner's stable share code. Requires an active STUDENT or OPEN_LEARNER account; a subscription is not required. +// @Success 200 {object} domain.Response{data=ReferralCodeData} +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {string} string "Unable to process referral request" func (h *Handler) CreateReferralCode(c *fiber.Ctx) error { id, err := referralLearner(c) if err != nil { @@ -68,17 +75,31 @@ func (h *Handler) CreateReferralCode(c *fiber.Ctx) error { code, err := h.referralSvc.Code(c.Context(), id) return referralResponse(c, fiber.Map{"code": code}, err) } + // GetReferralCode godoc -// @Summary GetReferralCode -// @Tags client -// @Security Bearer +// @Summary Get Referral Code +// @Tags referrals // @Router /api/v1/referrals/code [get] -func (h *Handler) GetReferralCode(c *fiber.Ctx) error { return h.CreateReferralCode(c) } -// GetMyReferrals godoc -// @Summary GetMyReferrals -// @Tags client // @Security Bearer +// @Description Returns the authenticated learner's stable share code, creating it when necessary. Codes are case-insensitive. +// @Success 200 {object} domain.Response{data=ReferralCodeData} +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {string} string "Unable to process referral request" +func (h *Handler) GetReferralCode(c *fiber.Ctx) error { return h.CreateReferralCode(c) } + +// GetMyReferrals godoc +// @Summary Get My Referrals +// @Tags referrals // @Router /api/v1/referrals/me [get] +// @Security Bearer +// @Description Returns the learner's code, current commission percentage, referral/conversion counts, and commission-wallet balances by currency. +// @Success 200 {object} domain.Response{data=ReferralOverviewData} +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {string} string "Unable to process referral request" func (h *Handler) GetMyReferrals(c *fiber.Ctx) error { id, err := referralLearner(c) if err != nil { @@ -87,29 +108,47 @@ func (h *Handler) GetMyReferrals(c *fiber.Ctx) error { data, err := h.referralSvc.Overview(c.Context(), id) return referralResponse(c, data, err) } + // ApplyReferralCode godoc -// @Summary ApplyReferralCode -// @Tags client -// @Security Bearer +// @Summary Apply Referral Code +// @Tags referrals // @Router /api/v1/referrals/apply [post] +// @Security Bearer +// @Description Attributes the authenticated learner to one referrer. Apply within seven days of account creation and before any successful positive payment. Codes are case-insensitive and surrounding whitespace is ignored. Self referral, reassignment, inactive referrers, and invalid codes are rejected. +// @Accept json +// @Param body body applyReferralReq true "Referral share code" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request or ineligible referral" +// @Failure 500 {string} string "Unable to process referral request" func (h *Handler) ApplyReferralCode(c *fiber.Ctx) error { id, err := referralLearner(c) if err != nil { return err } - var input struct { - Code string `json:"code"` - } + var input applyReferralReq if c.BodyParser(&input) != nil { return fiber.NewError(400, "Invalid request body") } return referralResponse(c, nil, h.referralSvc.Apply(c.Context(), id, input.Code)) } + // ListMyReferrals godoc -// @Summary ListMyReferrals -// @Tags client -// @Security Bearer +// @Summary List My Referrals +// @Tags referrals // @Router /api/v1/referrals [get] +// @Security Bearer +// @Description Returns only the authenticated learner's referral history and conversion flags. Referred learners' names, emails, and phone numbers are not exposed. +// @Success 200 {object} domain.Response{data=ReferralHistoryData} +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid pagination" +// @Failure 500 {string} string "Unable to process referral request" +// @Param limit query int false "Page size" default(20) minimum(1) maximum(100) +// @Param offset query int false "Number of entries to skip" default(0) minimum(0) func (h *Handler) ListMyReferrals(c *fiber.Ctx) error { id, err := referralLearner(c) if err != nil { @@ -122,11 +161,21 @@ func (h *Handler) ListMyReferrals(c *fiber.Ctx) error { data, err := h.referralSvc.List(c.Context(), id, limit, offset) return referralResponse(c, fiber.Map{"items": data, "limit": limit, "offset": offset}, err) } + // GetReferralWallet godoc -// @Summary GetReferralWallet -// @Tags client -// @Security Bearer +// @Summary Get Referral Wallet +// @Tags referrals // @Router /api/v1/referrals/wallet [get] +// @Security Bearer +// @Description Returns wallet balances separately by currency and a paginated commission ledger. Decimal amounts and percentages are strings. Only the first successful positive subscription payment earns a commission; duplicate callbacks and renewals do not. Reversed credits are excluded from balances. This endpoint does not initiate cash payouts. +// @Success 200 {object} domain.Response{data=ReferralWalletData} +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid pagination" +// @Failure 500 {string} string "Unable to process referral request" +// @Param limit query int false "Page size" default(20) minimum(1) maximum(100) +// @Param offset query int false "Number of entries to skip" default(0) minimum(0) func (h *Handler) GetReferralWallet(c *fiber.Ctx) error { id, err := referralLearner(c) if err != nil { @@ -143,11 +192,18 @@ func (h *Handler) GetReferralWallet(c *fiber.Ctx) error { entries, err := h.referralSvc.Commissions(c.Context(), id, limit, offset) return referralResponse(c, fiber.Map{"balances": overview.Wallet, "transactions": entries, "limit": limit, "offset": offset}, err) } + // GetReferralSettings godoc -// @Summary GetReferralSettings -// @Tags admin -// @Security Bearer +// @Summary Get Referral Settings +// @Tags referrals // @Router /api/v1/admin/referrals/settings [get] +// @Security Bearer +// @Description Returns the saved referral commission percentage. Restricted to ADMIN and SUPER_ADMIN. The initial percentage is 0, which disables new credits. +// @Success 200 {object} domain.Response{data=ReferralSettingsData} +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {string} string "Unable to process referral request" func (h *Handler) GetReferralSettings(c *fiber.Ctx) error { if _, err := referralAdmin(c); err != nil { return err @@ -155,19 +211,27 @@ func (h *Handler) GetReferralSettings(c *fiber.Ctx) error { data, err := h.referralSvc.Settings(c.Context()) return referralResponse(c, data, err) } + // UpdateReferralSettings godoc -// @Summary UpdateReferralSettings -// @Tags admin -// @Security Bearer +// @Summary Update Referral Settings +// @Tags referrals // @Router /api/v1/admin/referrals/settings [put] +// @Security Bearer +// @Description Sets the percentage credited on a referred learner's first successful positive subscription payment. Accepts 0 through 100 with at most two decimal places. Zero disables new credits. Changes affect future conversions only; existing credits retain their rate. Restricted to ADMIN and SUPER_ADMIN; changes are audited. +// @Accept json +// @Param body body updateReferralSettingsReq true "Commission percentage configuration" +// @Success 200 {object} domain.Response{data=ReferralSettingsData} +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Missing or invalid commission_percent; use 0 through 100 with at most two decimal places" +// @Failure 500 {string} string "Unable to process referral request" func (h *Handler) UpdateReferralSettings(c *fiber.Ctx) error { id, err := referralAdmin(c) if err != nil { return err } - var input struct { - Percent *float64 `json:"commission_percent"` - } + var input updateReferralSettingsReq if c.BodyParser(&input) != nil || input.Percent == nil { return fiber.NewError(400, "commission_percent is required") } diff --git a/internal/web_server/handlers/settings_handler.go b/internal/web_server/handlers/settings_handler.go index c38a9e38..4b6b7999 100644 --- a/internal/web_server/handlers/settings_handler.go +++ b/internal/web_server/handlers/settings_handler.go @@ -13,10 +13,15 @@ import ( ) // GetGlobalSettingList godoc -// @Summary GetGlobalSettingList -// @Tags admin -// @Security Bearer +// @Summary Get Global Setting List +// @Tags settings // @Router /api/v1/admin/settings [get] +// @Security Bearer +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {string} string "Internal server error" func (h *Handler) GetGlobalSettingList(c *fiber.Ctx) error { settingsList, err := h.settingSvc.GetGlobalSettingList(c.Context()) @@ -36,10 +41,16 @@ func (h *Handler) GetGlobalSettingList(c *fiber.Ctx) error { } // GetGlobalSettingByKey godoc -// @Summary GetGlobalSettingByKey -// @Tags admin -// @Security Bearer +// @Summary Get Global Setting By Key +// @Tags settings // @Router /api/v1/admin/settings/{key} [get] +// @Security Bearer +// @Param key path string true "Key" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request" func (h *Handler) GetGlobalSettingByKey(c *fiber.Ctx) error { settingKey := c.Params("key") if settingKey == "" { @@ -68,10 +79,18 @@ func (h *Handler) GetGlobalSettingByKey(c *fiber.Ctx) error { } // UpdateGlobalSettingList godoc -// @Summary UpdateGlobalSettingList -// @Tags admin -// @Security Bearer +// @Summary Update Global Setting List +// @Tags settings // @Router /api/v1/admin/settings [put] +// @Security Bearer +// @Accept json +// @Param body body domain.SaveSettingListReq true "Request payload" +// @Success 200 {object} domain.Response +// @Produce json +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {string} string "Invalid request" +// @Failure 500 {string} string "Internal server error" func (h *Handler) UpdateGlobalSettingList(c *fiber.Ctx) error { var req domain.SaveSettingListReq diff --git a/internal/web_server/handlers/subscription_checkout_link.go b/internal/web_server/handlers/subscription_checkout_link.go index d779a93c..e7c820ca 100644 --- a/internal/web_server/handlers/subscription_checkout_link.go +++ b/internal/web_server/handlers/subscription_checkout_link.go @@ -37,6 +37,10 @@ type requestCheckoutLinkRes struct { // @Failure 429 {object} domain.ErrorResponse // @Failure 503 {object} domain.ErrorResponse // @Router /api/v1/subscriptions/request-checkout-link [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) RequestSubscriptionCheckoutLink(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { diff --git a/internal/web_server/handlers/subscriptions.go b/internal/web_server/handlers/subscriptions.go index f04e54f8..cd08631f 100644 --- a/internal/web_server/handlers/subscriptions.go +++ b/internal/web_server/handlers/subscriptions.go @@ -121,6 +121,10 @@ type autoRenewReq struct { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/subscription-plans [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 409 {object} domain.ErrorResponse "Resource conflict" func (h *Handler) CreateSubscriptionPlan(c *fiber.Ctx) error { var req createPlanReq if err := c.BodyParser(&req); err != nil { @@ -201,12 +205,11 @@ func (h *Handler) CreateSubscriptionPlan(c *fiber.Ctx) error { // @Description Returns subscription plans. Optional category filter: EDUCATION. // @Tags subscriptions // @Produce json -// @Param active_only query bool false "Return only active plans (default true)" +// @Param active_only query bool false "Customer requests always return active plans; false is honored only by the admin endpoint" default(true) // @Param category query string false "Filter by plan category (EDUCATION)" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse -// @Router /api/v1/admin/subscription-plans [get] // @Router /api/v1/subscription-plans [get] func (h *Handler) ListSubscriptionPlans(c *fiber.Ctx) error { activeOnly := c.Query("active_only", "true") == "true" @@ -253,8 +256,8 @@ func (h *Handler) ListSubscriptionPlans(c *fiber.Ctx) error { // @Param id path int true "Plan ID" // @Success 200 {object} domain.Response // @Failure 404 {object} domain.ErrorResponse -// @Router /api/v1/admin/subscription-plans/{id} [get] // @Router /api/v1/subscription-plans/{id} [get] +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) GetSubscriptionPlan(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -292,6 +295,11 @@ func (h *Handler) GetSubscriptionPlan(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/subscription-plans/{id} [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 409 {object} domain.ErrorResponse "Resource conflict" func (h *Handler) UpdateSubscriptionPlan(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -393,6 +401,12 @@ func (h *Handler) UpdateSubscriptionPlan(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/subscription-plans/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" +// @Failure 409 {object} domain.ErrorResponse "Resource conflict" func (h *Handler) DeleteSubscriptionPlan(c *fiber.Ctx) error { id, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil { @@ -449,6 +463,9 @@ func (h *Handler) DeleteSubscriptionPlan(c *fiber.Ctx) error { // @Failure 500 {object} domain.ErrorResponse // @deprecated Use POST /api/v1/payments/subscribe for user subscriptions with payment // @Router /api/v1/subscriptions [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) Subscribe(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -517,6 +534,10 @@ func (h *Handler) Subscribe(c *fiber.Ctx) error { // @Failure 409 {object} domain.ErrorResponse "User already has active subscription" // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/subscriptions/checkout [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) SubscribeWithPayment(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -625,6 +646,10 @@ func (h *Handler) SubscribeWithPayment(c *fiber.Ctx) error { // @Produce json // @Success 200 {object} domain.Response // @Router /api/v1/subscriptions/me [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetMySubscription(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -661,6 +686,10 @@ func (h *Handler) GetMySubscription(c *fiber.Ctx) error { // @Param offset query int false "Offset" default(0) // @Success 200 {object} domain.Response // @Router /api/v1/subscriptions/history [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) GetMySubscriptionHistory(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -698,6 +727,10 @@ func (h *Handler) GetMySubscriptionHistory(c *fiber.Ctx) error { // @Produce json // @Success 200 {object} domain.Response // @Router /api/v1/subscriptions/status [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) CheckSubscriptionStatus(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -731,6 +764,11 @@ func (h *Handler) CheckSubscriptionStatus(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/subscriptions/{id}/cancel [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) CancelSubscription(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { @@ -784,6 +822,11 @@ func (h *Handler) CancelSubscription(c *fiber.Ctx) error { // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/subscriptions/{id}/auto-renew [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 404 {object} domain.ErrorResponse "Resource not found" func (h *Handler) SetAutoRenew(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok { diff --git a/internal/web_server/handlers/swagger_admin_shared.go b/internal/web_server/handlers/swagger_admin_shared.go new file mode 100644 index 00000000..2b8336ca --- /dev/null +++ b/internal/web_server/handlers/swagger_admin_shared.go @@ -0,0 +1,69 @@ +package handlers + +// Documentation-only operations distinguish protected admin reads from their public customer counterparts. +// These functions are never registered as HTTP handlers. + +// DocumentAdminListSubscriptionPlans godoc +// @Summary List subscription plans +// @Description Returns subscription plans. Optional category filter: EDUCATION. +// @Tags subscriptions +// @Produce json +// @Param active_only query bool false "Return only active plans (default true)" +// @Param category query string false "Filter by plan category (EDUCATION)" +// @Success 200 {object} domain.Response +// @Failure 400 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Security Bearer +// @Router /api/v1/admin/subscription-plans [get] +func documentAdminListSubscriptionPlans() {} + +// DocumentAdminGetSubscriptionPlan godoc +// @Summary Get a subscription plan +// @Description Returns a single subscription plan by ID +// @Tags subscriptions +// @Produce json +// @Param id path int true "Plan ID" +// @Success 200 {object} domain.Response +// @Failure 404 {object} domain.ErrorResponse +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Security Bearer +// @Router /api/v1/admin/subscription-plans/{id} [get] +func documentAdminGetSubscriptionPlan() {} + +// DocumentAdminGetSampleVideo godoc +// @Summary Get a sample Vimeo video with iframe embed +// @Description Fetches a sample video from Vimeo and returns video details along with an embeddable iframe for client-side integration +// @Tags Vimeo +// @Accept json +// @Produce json +// @Param video_id query string false "Vimeo Video ID to use as sample" default(76979871) +// @Param width query int false "Player width" default(640) +// @Param height query int false "Player height" default(360) +// @Success 200 {object} domain.Response +// @Failure 500 {object} domain.ErrorResponse +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Security Bearer +// @Router /api/v1/admin/vimeo/sample [get] +func documentAdminGetSampleVideo() {} + +// DocumentAdminGetOEmbed godoc +// @Summary Get oEmbed data for a Vimeo URL +// @Description Fetches oEmbed metadata for a Vimeo video URL +// @Tags Vimeo +// @Accept json +// @Produce json +// @Param url query string true "Vimeo video URL" +// @Param width query int false "Desired width" +// @Param height query int false "Desired height" +// @Success 200 {object} vimeo.OEmbedResponse +// @Failure 400 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Security Bearer +// @Router /api/v1/admin/vimeo/oembed [get] +func documentAdminGetOEmbed() {} diff --git a/internal/web_server/handlers/swagger_referral_models.go b/internal/web_server/handlers/swagger_referral_models.go new file mode 100644 index 00000000..ed5e971e --- /dev/null +++ b/internal/web_server/handlers/swagger_referral_models.go @@ -0,0 +1,68 @@ +package handlers + +// ReferralCodeData is the learner's stable, case-insensitive share code. +type ReferralCodeData struct { + Code string `json:"code" validate:"required" example:"ABCDEF0123456789"` +} + +type applyReferralReq struct { + Code string `json:"code" validate:"required" example:"ABCDEF0123456789"` +} + +type updateReferralSettingsReq struct { + // Percentage of the first successful positive subscription payment, with at most two decimal places. Zero disables new commissions. + Percent *float64 `json:"commission_percent" validate:"required" minimum:"0" maximum:"100" example:"10.25"` +} + +type ReferralWalletBalance struct { + Currency string `json:"currency" example:"ETB"` + // Decimal string; balances are not combined across currencies. + Balance string `json:"balance" example:"125.50"` +} + +type ReferralOverviewData struct { + Code string `json:"code" validate:"required" example:"ABCDEF0123456789"` + CommissionPercent string `json:"commission_percent" example:"10.25"` + TotalReferrals int64 `json:"total_referrals" example:"12"` + ConvertedReferrals int64 `json:"converted_referrals" example:"3"` + Wallet []ReferralWalletBalance `json:"wallet"` +} + +type ReferralHistoryItem struct { + ID int64 `json:"id" example:"14"` + CreatedAt string `json:"created_at" format:"date-time" example:"2026-10-28T09:00:00Z"` + Converted bool `json:"converted" example:"true"` +} +type ReferralHistoryData struct { + Items []ReferralHistoryItem `json:"items"` + Limit int32 `json:"limit" example:"20"` + Offset int32 `json:"offset" example:"0"` +} +type ReferralCommissionItem struct { + ID int64 `json:"id" example:"7"` + PaymentID int64 `json:"payment_id" example:"42"` + CommissionPercent string `json:"commission_percent" example:"10.25"` + Amount string `json:"amount" example:"51.25"` + Currency string `json:"currency" example:"ETB"` + CreatedAt string `json:"created_at" format:"date-time" example:"2026-10-28T09:00:00Z"` + // Null until the qualifying payment leaves SUCCESS; reversed credits no longer contribute to the balance. + ReversedAt *string `json:"reversed_at" format:"date-time" extensions:"x-nullable"` +} +type ReferralWalletData struct { + Balances []ReferralWalletBalance `json:"balances"` + Transactions []ReferralCommissionItem `json:"transactions"` + Limit int32 `json:"limit" example:"20"` + Offset int32 `json:"offset" example:"0"` +} +type ReferralSettingsData struct { + CommissionPercent string `json:"commission_percent" example:"10.25"` + UpdatedAt string `json:"updated_at" format:"date-time" example:"2026-10-28T09:00:00Z"` +} + +// NotificationDispatchResponse describes immediate single or bulk notification delivery. +type NotificationDispatchResponse struct { + Message string `json:"message"` + NotificationID string `json:"notification_id,omitempty"` + RecipientCount *int `json:"recipient_count,omitempty"` + NotificationIDs []string `json:"notification_ids,omitempty"` +} diff --git a/internal/web_server/handlers/team_handler.go b/internal/web_server/handlers/team_handler.go index 96343ff2..28b72745 100644 --- a/internal/web_server/handlers/team_handler.go +++ b/internal/web_server/handlers/team_handler.go @@ -186,6 +186,7 @@ func (h *Handler) TeamMemberLogin(c *fiber.Ctx) error { // @Failure 401 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/refresh [post] +// @Failure 403 {object} domain.ErrorResponse "Access denied" func (h *Handler) TeamMemberRefresh(c *fiber.Ctx) error { var req teamMemberRefreshReq if err := c.BodyParser(&req); err != nil { @@ -258,7 +259,6 @@ func (h *Handler) TeamMemberRefresh(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param body body domain.CreateTeamMemberReq true "Team member creation payload" // @Success 201 {object} domain.Response{data=domain.TeamMemberResponse} // @Failure 400 {object} domain.ErrorResponse @@ -266,6 +266,7 @@ func (h *Handler) TeamMemberRefresh(c *fiber.Ctx) error { // @Failure 403 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members [post] +// @Security Bearer func (h *Handler) CreateTeamMember(c *fiber.Ctx) error { var req domain.CreateTeamMemberReq if err := c.BodyParser(&req); err != nil { @@ -354,7 +355,6 @@ func (h *Handler) CreateTeamMember(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Team Member ID" // @Success 200 {object} domain.Response{data=domain.TeamMemberResponse} // @Failure 400 {object} domain.ErrorResponse @@ -362,6 +362,8 @@ func (h *Handler) CreateTeamMember(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/{id} [get] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetTeamMember(c *fiber.Ctx) error { memberIDStr := c.Params("id") memberID, err := strconv.ParseInt(memberIDStr, 10, 64) @@ -406,7 +408,6 @@ func (h *Handler) GetTeamMember(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param team_role query string false "Filter by team role (super_admin, admin, content_manager, support_agent, instructor, finance, hr, analyst)" // @Param department query string false "Filter by department" // @Param status query string false "Filter by status (active, inactive, suspended, terminated)" @@ -418,6 +419,7 @@ func (h *Handler) GetTeamMember(c *fiber.Ctx) error { // @Failure 403 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members [get] +// @Security Bearer func (h *Handler) GetAllTeamMembers(c *fiber.Ctx) error { filter := domain.TeamMemberFilter{} @@ -496,7 +498,6 @@ func (h *Handler) GetAllTeamMembers(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Team Member ID" // @Param body body domain.UpdateTeamMemberReq true "Team member update payload" // @Success 200 {object} domain.Response @@ -506,6 +507,7 @@ func (h *Handler) GetAllTeamMembers(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/{id} [put] +// @Security Bearer func (h *Handler) UpdateTeamMember(c *fiber.Ctx) error { memberIDStr := c.Params("id") memberID, err := strconv.ParseInt(memberIDStr, 10, 64) @@ -586,7 +588,6 @@ func (h *Handler) UpdateTeamMember(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Team Member ID" // @Param body body domain.UpdateTeamMemberStatusReq true "Status update payload" // @Success 200 {object} domain.Response @@ -596,6 +597,7 @@ func (h *Handler) UpdateTeamMember(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/{id}/status [patch] +// @Security Bearer func (h *Handler) UpdateTeamMemberStatus(c *fiber.Ctx) error { memberIDStr := c.Params("id") memberID, err := strconv.ParseInt(memberIDStr, 10, 64) @@ -688,7 +690,6 @@ func (h *Handler) UpdateTeamMemberStatus(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Team Member ID" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse @@ -697,6 +698,7 @@ func (h *Handler) UpdateTeamMemberStatus(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/{id} [delete] +// @Security Bearer func (h *Handler) DeleteTeamMember(c *fiber.Ctx) error { memberIDStr := c.Params("id") memberID, err := strconv.ParseInt(memberIDStr, 10, 64) @@ -751,12 +753,12 @@ func (h *Handler) DeleteTeamMember(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Success 200 {object} domain.Response{data=domain.TeamMemberStats} // @Failure 401 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/stats [get] +// @Security Bearer func (h *Handler) GetTeamMemberStats(c *fiber.Ctx) error { stats, err := h.teamSvc.GetTeamMemberStats(c.Context()) if err != nil { @@ -785,7 +787,6 @@ func (h *Handler) GetTeamMemberStats(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param id path int true "Team Member ID" // @Param body body changePasswordReq true "Password change payload" // @Success 200 {object} domain.Response @@ -794,6 +795,8 @@ func (h *Handler) GetTeamMemberStats(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/{id}/change-password [post] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ChangeTeamMemberPassword(c *fiber.Ctx) error { memberIDStr := c.Params("id") memberID, err := strconv.ParseInt(memberIDStr, 10, 64) @@ -864,13 +867,14 @@ func (h *Handler) ChangeTeamMemberPassword(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Success 200 {object} domain.Response{data=domain.TeamMemberResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/me [get] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetMyTeamProfile(c *fiber.Ctx) error { memberID, ok := c.Locals("user_id").(int64) if !ok { @@ -914,7 +918,6 @@ func (h *Handler) GetMyTeamProfile(c *fiber.Ctx) error { // @Tags team // @Accept json // @Produce json -// @Security Bearer // @Param body body domain.UpdateMyTeamProfileReq true "Profile update payload" // @Success 200 {object} domain.Response{data=domain.TeamMemberResponse} // @Failure 400 {object} domain.ErrorResponse @@ -922,6 +925,8 @@ func (h *Handler) GetMyTeamProfile(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/me [put] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateMyTeamProfile(c *fiber.Ctx) error { memberID, ok := c.Locals("user_id").(int64) if !ok { diff --git a/internal/web_server/handlers/team_invitation_handler.go b/internal/web_server/handlers/team_invitation_handler.go index a13be0d5..3f5ad4e5 100644 --- a/internal/web_server/handlers/team_invitation_handler.go +++ b/internal/web_server/handlers/team_invitation_handler.go @@ -60,6 +60,9 @@ func mapTeamInvitationListItem(row domain.TeamInvitationWithMember) teamInvitati // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/invite [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) InviteTeamMember(c *fiber.Ctx) error { if err := requireSuperAdminForTeamInvitation(c); err != nil { return err @@ -116,6 +119,9 @@ func (h *Handler) InviteTeamMember(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/{id}/resend-invite [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ResendTeamInvitation(c *fiber.Ctx) error { if err := requireSuperAdminForTeamInvitation(c); err != nil { return err @@ -159,6 +165,10 @@ func (h *Handler) ResendTeamInvitation(c *fiber.Ctx) error { // @Param offset query int false "Offset (default 0)" // @Success 200 {object} domain.Response // @Router /api/v1/admin/team/invitations [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) ListTeamInvitations(c *fiber.Ctx) error { status := strings.TrimSpace(c.Query("status")) var statusPtr *string @@ -200,6 +210,10 @@ func (h *Handler) ListTeamInvitations(c *fiber.Ctx) error { // @Param id path int true "Invitation ID" // @Success 200 {object} domain.Response // @Router /api/v1/admin/team/invitations/{id}/revoke [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) RevokeTeamInvitation(c *fiber.Ctx) error { invitationID, err := strconv.ParseInt(c.Params("id"), 10, 64) if err != nil || invitationID <= 0 { @@ -230,6 +244,8 @@ func (h *Handler) RevokeTeamInvitation(c *fiber.Ctx) error { // @Param token query string true "Invitation token" // @Success 200 {object} domain.Response // @Router /api/v1/admin/team/invitations/verify [get] +// @Failure 400 {object} domain.ErrorResponse "Invalid request" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) VerifyTeamInvitation(c *fiber.Ctx) error { token := strings.TrimSpace(c.Query("token")) if token == "" { @@ -262,6 +278,7 @@ func (h *Handler) VerifyTeamInvitation(c *fiber.Ctx) error { // @Param body body domain.AcceptTeamInvitationReq true "Accept invitation payload" // @Success 200 {object} domain.Response // @Router /api/v1/admin/team/invitations/accept [post] +// @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) AcceptTeamInvitation(c *fiber.Ctx) error { var req domain.AcceptTeamInvitationReq if err := c.BodyParser(&req); err != nil { diff --git a/internal/web_server/handlers/user.go b/internal/web_server/handlers/user.go index 9458039c..9d583412 100644 --- a/internal/web_server/handlers/user.go +++ b/internal/web_server/handlers/user.go @@ -29,10 +29,12 @@ import ( // @Tags user // @Accept json // @Produce json -// @Security Bearer // @Success 200 {object} domain.Response{data=domain.UserSummary} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/users/summary [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetUserSummary(c *fiber.Ctx) error { summary, err := h.userSvc.GetUserSummary(c.Context()) if err != nil { @@ -62,6 +64,9 @@ func (h *Handler) GetUserSummary(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/user/{user_id}/is-profile-completed [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) CheckProfileCompleted(c *fiber.Ctx) error { userIDParam := c.Params("user_id") if userIDParam == "" { @@ -109,13 +114,15 @@ func (h *Handler) CheckProfileCompleted(c *fiber.Ctx) error { // @Tags user // @Accept json // @Produce json -// @Param user_id path int true "User ID" // @Param body body domain.UpdateUserReq true "Update user payload" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/user [put] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateUser(c *fiber.Ctx) error { // Extract user ID from context userID, ok := c.Locals("user_id").(int64) @@ -195,6 +202,8 @@ func (h *Handler) UpdateUser(c *fiber.Ctx) error { // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/user/knowledge-level [put] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateUserKnowledgeLevel(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok || userID <= 0 { @@ -381,12 +390,12 @@ func (h *Handler) ResendOtp(c *fiber.Ctx) error { // @Tags user // @Accept json // @Produce json -// @Param user_id path string true "User ID" // @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/user/{user_name}/is-pending [get] +// @Param user_name path string true "User name" func (h *Handler) CheckUserPending(c *fiber.Ctx) error { userID, err := strconv.ParseInt(c.Params("user_id"), 10, 64) if err != nil { @@ -444,6 +453,9 @@ func (h *Handler) CheckUserPending(c *fiber.Ctx) error { // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/users [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetAllUsers(c *fiber.Ctx) error { filter, err := parseUserListFilter(c) if err != nil { @@ -591,6 +603,9 @@ func (h *Handler) GetAllUsers(c *fiber.Ctx) error { // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/users/deletion-requests [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListAccountDeletionRequests(c *fiber.Ctx) error { parseRFC3339 := func(value string) (domain.ValidTime, error) { if value == "" { @@ -675,6 +690,9 @@ func (h *Handler) ListAccountDeletionRequests(c *fiber.Ctx) error { // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/user/status [patch] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UpdateUserStatus(c *fiber.Ctx) error { var req struct { UserID int64 `json:"user_id"` @@ -1029,7 +1047,6 @@ func (h *Handler) SendRegisterCode(c *fiber.Ctx) error { // RegisterUser godoc // @Summary Register user -// @Description Register user // @Tags user // @Accept json // @Produce json @@ -1038,6 +1055,7 @@ func (h *Handler) SendRegisterCode(c *fiber.Ctx) error { // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/user/register [post] +// @Description Registers a learner with email or phone and password. The server assigns the learner role and selects the OTP medium from the contact method. An optional referral_code attributes the new account atomically; invalid or ineligible codes reject registration. func (h *Handler) RegisterUser(c *fiber.Ctx) error { var req domain.RegisterUserReq if err := c.BodyParser(&req); err != nil { @@ -1374,8 +1392,10 @@ func (h *Handler) ResetTenantPassword(c *fiber.Ctx) error { // @Success 200 {object} domain.UserProfileResponse // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse -// @Security Bearer // @Router /api/v1/user/user-profile [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetUserProfile(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) @@ -1496,8 +1516,10 @@ type AdminProfileRes struct { // @Success 200 {object} AdminProfileRes // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse -// @Security Bearer // @Router /api/v1/admin/user/admin-profile [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) AdminProfile(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) @@ -1629,6 +1651,9 @@ type SearchUserByNameOrPhoneReq struct { // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/user/search [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) SearchUserByNameOrPhone(c *fiber.Ctx) error { var req SearchUserByNameOrPhoneReq if err := c.BodyParser(&req); err != nil { @@ -1765,6 +1790,8 @@ func (h *Handler) SearchUserByNameOrPhone(c *fiber.Ctx) error { // @Failure 401 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/user/single/{id} [get] +// @Security Bearer +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) GetUserByID(c *fiber.Ctx) error { userIDstr := c.Params("id") userID, err := strconv.ParseInt(userIDstr, 10, 64) @@ -1883,6 +1910,9 @@ func (h *Handler) GetUserByID(c *fiber.Ctx) error { // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse // @Router /api/v1/admin/user/delete/{id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) DeleteUser(c *fiber.Ctx) error { userIDstr := c.Params("id") userID, err := strconv.ParseInt(userIDstr, 10, 64) @@ -1943,8 +1973,8 @@ const ( // @Failure 401 {object} response.APIResponse // @Failure 403 {object} response.APIResponse // @Failure 500 {object} response.APIResponse -// @Security Bearer // @Router /api/v1/user/me [delete] +// @Security Bearer func (h *Handler) DeleteMyUserAccount(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok || userID <= 0 { @@ -1996,8 +2026,8 @@ func (h *Handler) DeleteMyUserAccount(c *fiber.Ctx) error { // @Failure 401 {object} response.APIResponse // @Failure 403 {object} response.APIResponse // @Failure 500 {object} response.APIResponse -// @Security Bearer // @Router /api/v1/user/me/deletion/cancel [post] +// @Security Bearer func (h *Handler) CancelMyUserAccountDeletion(c *fiber.Ctx) error { userID, ok := c.Locals("user_id").(int64) if !ok || userID <= 0 { @@ -2043,8 +2073,10 @@ func (h *Handler) CancelMyUserAccountDeletion(c *fiber.Ctx) error { // @Success 200 {object} response.APIResponse // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse -// @Security Bearer // @Router /api/v1/admin/internal/users/purge-due-deletions [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) PurgeDueDeletedUsers(c *fiber.Ctx) error { limit := int32(c.QueryInt("limit", int(defaultDeletePurgeBatchSize))) if limit <= 0 { @@ -2094,9 +2126,11 @@ type UpdateUserSuspendRes struct { // @Success 200 {object} response.APIResponse // @Failure 400 {object} response.APIResponse // @Failure 500 {object} response.APIResponse -// @Security Bearer // @Router /api/v1/admin/user/{id}/profile-picture [post] // @Router /api/v1/user/{id}/profile-picture [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) UploadProfilePicture(c *fiber.Ctx) error { idStr := c.Params("id") userID, err := strconv.ParseInt(idStr, 10, 64) diff --git a/internal/web_server/handlers/video_engagement_handler.go b/internal/web_server/handlers/video_engagement_handler.go index 5dec166e..4f433e7a 100644 --- a/internal/web_server/handlers/video_engagement_handler.go +++ b/internal/web_server/handlers/video_engagement_handler.go @@ -24,6 +24,9 @@ import ( // @Failure 403 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/exam-prep/videos/engagement/heartbeat [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 500 {object} domain.ErrorResponse "Internal server error" func (h *Handler) RecordVideoEngagementHeartbeat(c *fiber.Ctx) error { var req domain.VideoEngagementHeartbeatInput if err := c.BodyParser(&req); err != nil { diff --git a/internal/web_server/handlers/vimeo.go b/internal/web_server/handlers/vimeo.go index 02eb262a..77fc97ba 100644 --- a/internal/web_server/handlers/vimeo.go +++ b/internal/web_server/handlers/vimeo.go @@ -107,6 +107,9 @@ func vimeoVideoInfoToResponse(info *vimeoservice.VideoInfo) VimeoVideoResponse { // @Failure 503 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" func (h *Handler) ListVimeoVideos(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -193,6 +196,10 @@ func (h *Handler) ListVimeoVideos(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id} [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) GetVimeoVideo(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -236,6 +243,10 @@ func (h *Handler) GetVimeoVideo(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/uploads/pull [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) CreatePullUpload(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -293,6 +304,10 @@ func (h *Handler) CreatePullUpload(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/uploads/tus [post] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) CreateTusUpload(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -356,6 +371,10 @@ func (h *Handler) CreateTusUpload(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id}/embed [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) GetEmbedCode(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -418,10 +437,14 @@ func (h *Handler) GetEmbedCode(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param video_id path string true "Vimeo Video ID" -// @Success 204 +// @Success 200 {object} domain.Response // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id} [delete] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) DeleteVimeoVideo(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -466,6 +489,10 @@ func (h *Handler) DeleteVimeoVideo(c *fiber.Ctx) error { // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id}/status [get] +// @Security Bearer +// @Failure 401 {string} string "Missing, invalid, or expired Bearer token" +// @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) GetTranscodeStatus(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -512,8 +539,8 @@ func (h *Handler) GetTranscodeStatus(c *fiber.Ctx) error { // @Param height query int false "Player height" default(360) // @Success 200 {object} domain.Response // @Failure 500 {object} domain.ErrorResponse -// @Router /api/v1/admin/vimeo/sample [get] // @Router /api/v1/vimeo/sample [get] +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) GetSampleVideo(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ @@ -557,8 +584,8 @@ func (h *Handler) GetSampleVideo(c *fiber.Ctx) error { // @Success 200 {object} vimeo.OEmbedResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse -// @Router /api/v1/admin/vimeo/oembed [get] // @Router /api/v1/vimeo/oembed [get] +// @Failure 503 {object} domain.ErrorResponse "Service unavailable" func (h *Handler) GetOEmbed(c *fiber.Ctx) error { if h.vimeoSvc == nil { return c.Status(fiber.StatusServiceUnavailable).JSON(domain.ErrorResponse{ diff --git a/internal/web_server/swagger_contract_test.go b/internal/web_server/swagger_contract_test.go new file mode 100644 index 00000000..b0e9e8a5 --- /dev/null +++ b/internal/web_server/swagger_contract_test.go @@ -0,0 +1,333 @@ +package httpserver + +import ( + "encoding/json" + "go/ast" + "go/parser" + "go/token" + "os" + "path/filepath" + "regexp" + "strconv" + "strings" + "testing" + + "Rezina-Backend/docs" + openapiswag "github.com/go-openapi/swag" +) + +type documentedParameter struct { + Name string `json:"name"` + In string `json:"in"` + Required bool `json:"required"` + Type string `json:"type"` + Schema map[string]any `json:"schema"` +} +type documentedOperation struct { + Summary string `json:"summary"` + Parameters []documentedParameter `json:"parameters"` + Responses map[string]json.RawMessage `json:"responses"` + Security []map[string][]string `json:"security"` +} +type swaggerRouteContract struct { + Method, Path, Handler string + Bearer, WebSocket bool +} + +var fiberPathParameter = regexp.MustCompile(`:(\w+)(?:<[^>]+>)?`) +var swaggerPathParameter = regexp.MustCompile(`\{([^}]+)\}`) + +func registeredSwaggerContracts(t *testing.T) []swaggerRouteContract { + t.Helper() + var result []swaggerRouteContract + for _, audience := range []string{"admin", "client", "integration"} { + file, err := parser.ParseFile(token.NewFileSet(), "routes_"+audience+".go", nil, 0) + if err != nil { + t.Fatal(err) + } + ast.Inspect(file, func(node ast.Node) bool { + call, ok := node.(*ast.CallExpr) + if !ok { + return true + } + selector, ok := call.Fun.(*ast.SelectorExpr) + if !ok { + return true + } + receiver, ok := selector.X.(*ast.Ident) + if !ok || receiver.Name != "api" { + return true + } + method := strings.ToLower(selector.Sel.Name) + switch method { + case "get", "post", "put", "patch", "delete": + default: + return true + } + literal, ok := call.Args[0].(*ast.BasicLit) + if !ok { + t.Fatal("API route must use a string literal") + } + path, err := strconv.Unquote(literal.Value) + if err != nil { + t.Fatal(err) + } + prefix := "/api/v1" + if audience == "admin" { + prefix += "/admin" + } + contract := swaggerRouteContract{Method: method, Path: prefix + fiberPathParameter.ReplaceAllString(path, "{$1}")} + for _, argument := range call.Args[1:] { + member, ok := argument.(*ast.SelectorExpr) + if !ok { + if factory, ok := argument.(*ast.CallExpr); ok { + member, _ = factory.Fun.(*ast.SelectorExpr) + } + } + if member == nil { + continue + } + if strings.HasSuffix(member.Sel.Name, "WebsocketAuthMiddleware") { + contract.WebSocket = true + } + if member.Sel.Name == "adminAuthMiddleware" || member.Sel.Name == "clientAuthMiddleware" { + contract.Bearer = true + } + if owner, ok := member.X.(*ast.Ident); ok && (owner.Name == "h" || owner.Name == "handlers") { + contract.Handler = member.Sel.Name + } + } + result = append(result, contract) + return true + }) + } + result = append(result, swaggerRouteContract{Method: "get", Path: "/payment/success", Handler: "HandleChapaSuccessPage"}) + return result +} + +func TestSwaggerMatchesRegisteredRoutes(t *testing.T) { + var spec struct { + Paths map[string]map[string]documentedOperation `json:"paths"` + SecurityDefinitions map[string]any `json:"securityDefinitions"` + } + if err := json.Unmarshal([]byte(docs.SwaggerInfo.ReadDoc()), &spec); err != nil { + t.Fatal(err) + } + expected := map[string]bool{} + for _, route := range registeredSwaggerContracts(t) { + key := strings.ToUpper(route.Method) + " " + route.Path + expected[key] = true + t.Run(key, func(t *testing.T) { + operation, ok := spec.Paths[route.Path][route.Method] + if !ok { + t.Fatal("registered operation is missing from Swagger") + } + if operation.Summary == "" { + t.Error("operation has no summary") + } + if len(operation.Responses) == 0 { + t.Error("operation has no responses") + } + success := false + for code := range operation.Responses { + if strings.HasPrefix(code, "2") || code == "101" || strings.HasPrefix(code, "3") { + success = true + } + } + if !success { + t.Error("operation has no documented success response") + } + bearer := false + for _, requirement := range operation.Security { + for scheme := range requirement { + if _, exists := spec.SecurityDefinitions[scheme]; !exists { + t.Errorf("unknown security scheme %s", scheme) + } + } + if _, ok := requirement["Bearer"]; ok { + bearer = true + } + } + if bearer != route.Bearer { + t.Errorf("Bearer security=%v; route requires=%v", bearer, route.Bearer) + } + actual := map[string]bool{} + for _, parameter := range operation.Parameters { + if parameter.In == "path" { + if !parameter.Required { + t.Errorf("path parameter %s is optional", parameter.Name) + } + if parameter.Type == "" { + t.Errorf("path parameter %s has no type", parameter.Name) + } + actual[parameter.Name] = true + } + if parameter.In == "body" && len(parameter.Schema) == 0 { + t.Error("body parameter has no schema") + } + } + for _, match := range swaggerPathParameter.FindAllStringSubmatch(route.Path, -1) { + if !actual[match[1]] { + t.Errorf("missing path parameter %s", match[1]) + } + delete(actual, match[1]) + } + for name := range actual { + t.Errorf("documented path parameter %s does not exist in route", name) + } + if route.WebSocket { + found := false + for _, parameter := range operation.Parameters { + if parameter.Name == "token" && parameter.In == "query" && parameter.Required { + found = true + } + } + if !found { + t.Error("WebSocket query-token authentication is undocumented") + } + if _, exists := operation.Responses["101"]; !exists { + t.Error("WebSocket upgrade response is undocumented") + } + } + }) + } + for path, operations := range spec.Paths { + for method := range operations { + if !expected[strings.ToUpper(method)+" "+path] { + t.Errorf("Swagger documents an unregistered operation: %s %s", method, path) + } + } + } +} + +func TestSwaggerDocumentsParsedRequestBodies(t *testing.T) { + parsedBodies := map[string]bool{"HandleChapaWebhook": true, "SendSingleEmail": true, "SendBulkEmail": true} + files, err := filepath.Glob(filepath.Join("handlers", "*.go")) + if err != nil { + t.Fatal(err) + } + for _, name := range files { + if strings.HasSuffix(name, "_test.go") { + continue + } + file, err := parser.ParseFile(token.NewFileSet(), name, nil, 0) + if err != nil { + t.Fatal(err) + } + for _, declaration := range file.Decls { + fn, ok := declaration.(*ast.FuncDecl) + if !ok || fn.Recv == nil || fn.Body == nil { + continue + } + ast.Inspect(fn.Body, func(node ast.Node) bool { + if call, ok := node.(*ast.CallExpr); ok { + if member, ok := call.Fun.(*ast.SelectorExpr); ok && member.Sel.Name == "BodyParser" { + parsedBodies[fn.Name.Name] = true + } + } + return true + }) + } + } + var spec struct { + Paths map[string]map[string]documentedOperation `json:"paths"` + } + if err := json.Unmarshal([]byte(docs.SwaggerInfo.ReadDoc()), &spec); err != nil { + t.Fatal(err) + } + for _, route := range registeredSwaggerContracts(t) { + if !parsedBodies[route.Handler] { + continue + } + operation := spec.Paths[route.Path][route.Method] + found := false + for _, parameter := range operation.Parameters { + if parameter.In == "body" || parameter.In == "formData" { + found = true + } + } + if !found { + t.Errorf("%s %s parses a request body but documents no body or form fields", route.Method, route.Path) + } + } +} + +func TestGeneratedSwaggerArtifactsStayInSync(t *testing.T) { + var runtimeDoc map[string]any + if err := json.Unmarshal([]byte(docs.SwaggerInfo.ReadDoc()), &runtimeDoc); err != nil { + t.Fatal(err) + } + for _, name := range []string{"swagger.json", "swagger.yaml"} { + raw, err := os.ReadFile(filepath.Join("..", "..", "docs", name)) + if err != nil { + t.Fatal(err) + } + if strings.HasSuffix(name, ".yaml") { + document, err := openapiswag.BytesToYAMLDoc(raw) + if err != nil { + t.Fatal(err) + } + raw, err = openapiswag.YAMLToJSON(document) + if err != nil { + t.Fatal(err) + } + } + var exported map[string]any + if err := json.Unmarshal(raw, &exported); err != nil { + t.Fatal(err) + } + // Runtime host/scheme placeholders may be omitted in the static exports. + for _, section := range []string{"swagger", "info", "paths", "definitions", "securityDefinitions"} { + runtimeJSON, _ := json.Marshal(runtimeDoc[section]) + exportedJSON, _ := json.Marshal(exported[section]) + if string(runtimeJSON) != string(exportedJSON) { + t.Errorf("%s section %s differs from docs.go; run make swagger", name, section) + } + } + } +} + +func assertSwaggerReferences(t *testing.T, document map[string]any) { + t.Helper() + var visit func(any) + visit = func(value any) { + switch node := value.(type) { + case map[string]any: + if reference, ok := node["$ref"].(string); ok { + if !strings.HasPrefix(reference, "#/") { + t.Errorf("unexpected external schema reference: %s", reference) + } else { + var current any = document + for _, segment := range strings.Split(strings.TrimPrefix(reference, "#/"), "/") { + segment = strings.ReplaceAll(strings.ReplaceAll(segment, "~1", "/"), "~0", "~") + object, ok := current.(map[string]any) + if !ok { + current = nil + break + } + current = object[segment] + } + if current == nil { + t.Errorf("unresolved schema reference: %s", reference) + } + } + } + for _, child := range node { + visit(child) + } + case []any: + for _, child := range node { + visit(child) + } + } + } + visit(document) +} + +func TestSwaggerSchemaReferences(t *testing.T) { + var document map[string]any + if err := json.Unmarshal([]byte(docs.SwaggerInfo.ReadDoc()), &document); err != nil { + t.Fatal(err) + } + assertSwaggerReferences(t, document) +} diff --git a/makefile b/makefile index b39dc16c..4c10b0f6 100644 --- a/makefile +++ b/makefile @@ -88,6 +88,10 @@ postgres_log: .PHONY: swagger swagger: @swag init -g cmd/main.go +.PHONY: swagger-check +swagger-check: swagger + @go test ./internal/web_server -run 'TestSwagger|TestGeneratedSwagger|TestAudienceSpecifications' + .PHONY: db-up logs: @mkdir -p logs