From aa718ae7d08bc5590d90b5f0e9b196a83703d49d Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Sun, 1 Nov 2026 14:02:47 +0300 Subject: [PATCH] Document detailed Swagger response schemas for every API --- README.md | 5 + docs/docs.go | 5774 +++++++++++++++-- docs/swagger-response-schemas.md | 68 + docs/swagger.json | 5774 +++++++++++++++-- docs/swagger.yaml | 3590 ++++++++-- internal/domain/arifpay.go | 4 +- internal/domain/common.go | 5 +- internal/domain/notification.go | 6 +- internal/domain/question_type_builder.go | 17 +- internal/domain/question_type_definitions.go | 26 +- internal/domain/questions.go | 46 +- internal/domain/scheduled_notification.go | 16 +- internal/domain/user.go | 22 +- internal/web_server/handlers/activity_logs.go | 33 +- internal/web_server/handlers/admin.go | 36 +- internal/web_server/handlers/admin_export.go | 5 + .../handlers/admin_subscription_handler.go | 6 +- internal/web_server/handlers/arifpay.go | 16 +- internal/web_server/handlers/auth_handler.go | 47 +- internal/web_server/handlers/chapa.go | 6 +- internal/web_server/handlers/chapa_direct.go | 6 +- .../handlers/chapter_quiz_operations.go | 4 +- .../web_server/handlers/email_template.go | 16 +- .../handlers/exam_prep_assessment_handler.go | 6 +- .../exam_prep_catalog_course_handler.go | 4 +- .../handlers/exam_prep_lesson_handler.go | 4 +- .../handlers/exam_prep_practice_handler.go | 24 +- .../handlers/exam_prep_unit_handler.go | 4 +- internal/web_server/handlers/faq.go | 14 +- internal/web_server/handlers/field_option.go | 14 +- internal/web_server/handlers/file_handler.go | 14 +- .../web_server/handlers/issue_reporting.go | 4 +- .../handlers/lms_persona_handler.go | 10 +- .../handlers/lms_progress_handler.go | 4 +- .../handlers/mobile_app_version_handler.go | 12 +- .../handlers/notification_handler.go | 58 +- .../web_server/handlers/payments_admin.go | 4 +- .../handlers/practice_full_update_handler.go | 4 +- .../handlers/question_type_builder.go | 26 +- internal/web_server/handlers/questions.go | 42 +- internal/web_server/handlers/ratings.go | 12 +- internal/web_server/handlers/rbac_handler.go | 10 +- .../web_server/handlers/referal_handlers.go | 2 +- .../web_server/handlers/response_contracts.go | 288 + .../handlers/response_contracts_test.go | 49 + .../web_server/handlers/settings_handler.go | 6 +- .../handlers/subscription_checkout_link.go | 2 +- internal/web_server/handlers/subscriptions.go | 24 +- .../handlers/swagger_admin_shared.go | 8 +- .../handlers/swagger_service_info.go | 30 + internal/web_server/handlers/team_handler.go | 8 +- .../handlers/team_invitation_handler.go | 12 +- .../handlers/team_password_reset_handler.go | 6 +- internal/web_server/handlers/user.go | 128 +- internal/web_server/handlers/vimeo.go | 16 +- internal/web_server/response/res.go | 9 +- internal/web_server/swagger_contract_test.go | 2 + .../swagger_response_schema_test.go | 140 + 58 files changed, 14785 insertions(+), 1743 deletions(-) create mode 100644 docs/swagger-response-schemas.md create mode 100644 internal/web_server/handlers/response_contracts.go create mode 100644 internal/web_server/handlers/response_contracts_test.go create mode 100644 internal/web_server/handlers/swagger_service_info.go create mode 100644 internal/web_server/swagger_response_schema_test.go diff --git a/README.md b/README.md index bb9e7074..62f4ac72 100644 --- a/README.md +++ b/README.md @@ -304,6 +304,11 @@ make postgres # psql shell into Compose Postgres 3. **Postman collections**: `postman/` (FAQ, personas, mobile app versions, dynamic question types, …) 4. **Feature integration guides**: `docs/*-admin-panel-integration.md` (see [below](#admin-panel-integration-docs)) +Every API operation documents a concrete response schema, including envelopes, +pagination, message-only results, and notification scheduling variants. See +[Swagger response contracts](docs/swagger-response-schemas.md) for conventions, +intentional JSON extension fields, and the regression checks. + Regenerate after handler / annotation changes: ```bash diff --git a/docs/docs.go b/docs/docs.go index 27ae476a..6b012c38 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -17,6 +17,44 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "discovery" + ], + "summary": "Service welcome and version", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/handlers.serviceInfoResponse" + } + } + } + } + }, + "/api/v1/": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "discovery" + ], + "summary": "Discover the admin and customer API roots", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/handlers.apiIndexResponse" + } + } + } + } + }, "/api/v1/admin/activity-logs": { "get": { "security": [ @@ -94,7 +132,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.activityLogListRes" + } + } + } + ] } }, "400": { @@ -144,6 +194,12 @@ const docTemplate = `{ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -195,7 +251,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.activityLogRes" + } + } + } + ] } }, "400": { @@ -285,19 +353,34 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.AdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.AdminRes" + } + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -307,9 +390,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -346,19 +429,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -368,9 +451,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -415,7 +498,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.BulkDeactivateAccountsByRoleResult" + } + } + } + ] } }, "400": { @@ -490,7 +585,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.BulkReactivateAccountsByRoleResult" + } + } + } + ] } }, "400": { @@ -557,19 +664,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.AdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.AdminRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -579,9 +698,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -626,19 +745,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -648,9 +767,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -781,7 +900,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listMobileAppVersionsRes" + } + } + } + ] } }, "400": { @@ -841,7 +972,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + ] } }, "400": { @@ -898,7 +1041,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + ] } }, "400": { @@ -971,7 +1126,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + ] } }, "400": { @@ -1032,7 +1199,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -1086,7 +1253,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepAssessmentsData" + } + } + } + ] } }, "400": { @@ -1140,7 +1319,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.LinkExamPrepAssessmentData" + } + } + } + ] } }, "400": { @@ -1207,7 +1398,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -1271,19 +1462,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.LoginAdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -1293,9 +1496,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -1329,19 +1532,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.LoginAdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -1351,9 +1566,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -1570,7 +1785,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -1645,7 +1860,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByUnitData" + } + } + } + ] } }, "400": { @@ -1709,7 +1936,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -2091,7 +2330,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2302,7 +2541,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2543,7 +2782,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2618,7 +2857,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData" + } + } + } + ] } }, "400": { @@ -2682,7 +2933,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -2897,7 +3160,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2965,7 +3228,7 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -3027,7 +3290,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -3102,7 +3365,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listEmailTemplatesRes" + } + } + } + ] } }, "400": { @@ -3163,7 +3438,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3221,7 +3508,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3297,7 +3596,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.RenderedEmail" + } + } + } + ] } }, "400": { @@ -3361,7 +3672,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3435,7 +3758,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3497,7 +3832,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteEmailTemplateData" + } + } + } + ] } }, "400": { @@ -3573,7 +3920,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.RenderedEmail" + } + } + } + ] } }, "400": { @@ -3654,7 +4013,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listFAQsRes" + } + } + } + ] } }, "400": { @@ -3715,7 +4086,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -3773,7 +4156,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -3847,7 +4242,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -3909,7 +4316,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteFAQData" + } + } + } + ] } }, "400": { @@ -3989,7 +4408,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listFieldOptionsRes" + } + } + } + ] } }, "401": { @@ -4037,7 +4468,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + } + } + ] } }, "400": { @@ -4088,7 +4531,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + } + } + ] } }, "400": { @@ -4149,7 +4604,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + } + } + ] } }, "400": { @@ -4198,7 +4665,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -4264,7 +4731,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadAudioData" + } + } + } + ] } }, "400": { @@ -4333,7 +4812,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -4408,7 +4899,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.presignedUploadRes" + } + } + } + ] } }, "400": { @@ -4476,7 +4979,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.RefreshFileURLData" + } + } + } + ] } }, "400": { @@ -4549,7 +5064,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -4612,7 +5139,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetFileURLData" + } + } + } + ] } }, "400": { @@ -4675,13 +5214,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.PurgeDueDeletedUsersData" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -4697,9 +5248,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -4956,7 +5507,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -5026,7 +5577,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -5244,7 +5795,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -5319,7 +5870,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByLessonData" + } + } + } + ] } }, "400": { @@ -5461,7 +6024,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.GetUserNotificationResponse" } }, "400": { @@ -5507,7 +6070,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -5601,7 +6164,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.GetAllNotificationsResponse" } }, "400": { @@ -5727,13 +6290,37 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkEmailData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -5833,13 +6420,37 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkInAppNotificationData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -5926,13 +6537,37 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkPushNotificationData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6019,13 +6654,37 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkSMSData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6150,7 +6809,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteInAppNotificationsData" + } + } + } + ] } }, "400": { @@ -6198,7 +6869,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -6240,7 +6911,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -6323,7 +6994,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.ListScheduledNotificationsResponse" } }, "400": { @@ -6381,7 +7052,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6439,7 +7122,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6536,7 +7231,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -6607,7 +7302,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendTestPushNotificationData" + } + } + } + ] } }, "400": { @@ -6655,7 +7362,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.CountUnreadNotificationsResponse" } }, "401": { @@ -6707,7 +7414,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -6769,7 +7488,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -6833,7 +7552,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -6891,7 +7622,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -7046,7 +7789,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listAdminPaymentsRes" + } + } + } + ] } }, "400": { @@ -7096,6 +7851,12 @@ const docTemplate = `{ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -7162,7 +7923,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.adminPaymentRes" + } + } + } + ] } }, "400": { @@ -7237,7 +8010,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listPersonasData" + } + } + } + ] } }, "400": { @@ -7297,7 +8082,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -7354,7 +8151,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -7424,7 +8233,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -7485,7 +8306,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -7553,7 +8374,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListAllExamPrepPracticesData" + } + } + } + ] } }, "400": { @@ -7610,7 +8443,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -7667,7 +8512,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -7737,7 +8594,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -7798,7 +8667,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -7862,7 +8731,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.quizFullData" + } + } + } + ] } }, "400": { @@ -7936,7 +8817,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.quizFullData" + } + } + } + ] } }, "400": { @@ -8008,7 +8901,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -8085,7 +8990,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -8163,7 +9080,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionSetsRes" + } + } + } + ] } }, "400": { @@ -8224,7 +9153,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionSetRes" + } + } + } + ] } }, "400": { @@ -8289,7 +9230,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.questionSetRes" + } + } + } + } + ] } }, "400": { @@ -8347,7 +9303,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionSetRes" + } + } + } + ] } }, "400": { @@ -8415,7 +9383,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8477,7 +9445,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8535,7 +9503,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.userPersonaRes" + } + } + } + } + ] } }, "400": { @@ -8603,7 +9586,7 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8668,7 +9651,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8726,7 +9709,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionSetQuestionTypesSummary" + } + } + } + ] } }, "400": { @@ -8879,7 +9874,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.AddQuestionToSetData" + } + } + } + ] } }, "400": { @@ -8944,7 +9951,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -9021,7 +10028,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -9104,7 +10111,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionsRes" + } + } + } + ] } }, "400": { @@ -9165,7 +10184,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionRes" + } + } + } + ] } }, "400": { @@ -9214,7 +10245,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.componentCatalogRes" + } + } + } + ] } }, "401": { @@ -9274,7 +10317,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionsRes" + } + } + } + ] } }, "400": { @@ -9344,7 +10399,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionTypeDefinitionGroupsData" + } + } + } + ] } }, "400": { @@ -9404,7 +10471,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" + } + } + } + ] } }, "400": { @@ -9455,7 +10534,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroupDetail" + } + } + } + ] } }, "400": { @@ -9528,7 +10619,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" + } + } + } + ] } }, "400": { @@ -9583,7 +10686,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteQuestionTypeDefinitionGroupData" + } + } + } + ] } }, "400": { @@ -9660,7 +10775,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionTypeDefinitionsData" + } + } + } + ] } }, "400": { @@ -9727,7 +10854,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + } + } + ] } }, "400": { @@ -9790,7 +10929,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + } + } + ] } }, "400": { @@ -9858,7 +11009,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UpdateQuestionTypeDefinitionData" + } + } + } + ] } }, "400": { @@ -9919,7 +11082,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteQuestionTypeDefinitionData" + } + } + } + ] } }, "400": { @@ -9991,7 +11166,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.PracticesByQuestionTypeDefinitionSummary" + } + } + } + ] } }, "400": { @@ -10060,7 +11247,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ValidateQuestionTypeDefinitionData" + } + } + } + ] } }, "400": { @@ -10112,7 +11311,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionRes" + } + } + } + ] } }, "400": { @@ -10186,7 +11397,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -10248,7 +11459,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -10466,7 +11677,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -10711,7 +11922,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + } + ] } }, "400": { @@ -10776,7 +12002,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingSummaryRes" + } + } + } + ] } }, "400": { @@ -10834,7 +12072,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11008,7 +12246,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -11080,7 +12318,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListRolesData" + } + } + } + ] } }, "401": { @@ -11294,7 +12544,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11353,7 +12603,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11497,7 +12747,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11688,13 +12938,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendSingleAfroSMSReq" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { @@ -11712,7 +12974,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -11736,7 +12998,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.SettingListRes" + } + } + } + ] } }, "401": { @@ -11790,7 +13064,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.SettingListRes" + } + } + } + ] } }, "400": { @@ -11847,7 +13133,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.SettingRes" + } + } + } + ] } }, "400": { @@ -11904,7 +13202,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + } + ] } }, "400": { @@ -11965,7 +13278,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + ] } }, "400": { @@ -12029,7 +13354,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + ] } }, "401": { @@ -12091,7 +13428,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -12159,7 +13496,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -12221,6 +13558,12 @@ const docTemplate = `{ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -12272,7 +13615,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "400": { @@ -12347,7 +13702,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listTeamInvitationsRes" + } + } + } + ] } }, "400": { @@ -12399,7 +13766,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.TeamMemberResponse" + } + } + } + ] } }, "400": { @@ -12434,7 +13813,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.VerifyTeamInvitationRes" + } + } + } + ] } }, "400": { @@ -12480,7 +13871,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.RevokeTeamInvitationData" + } + } + } + ] } }, "400": { @@ -12912,6 +14315,12 @@ const docTemplate = `{ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "401": { @@ -12968,7 +14377,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InviteTeamMemberRes" + } + } + } + ] } }, "400": { @@ -13115,7 +14536,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13180,7 +14601,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13256,7 +14677,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13320,7 +14741,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InviteTeamMemberRes" + } + } + } + ] } }, "400": { @@ -13390,7 +14823,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13524,7 +14957,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13576,7 +15009,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13688,7 +15121,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.TeamVerifyPasswordResetRes" + } + } + } + ] } } } @@ -13716,13 +15161,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.AdminProfileRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13738,9 +15195,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13777,13 +15234,13 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13799,9 +15256,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13840,13 +15297,28 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.UserProfileResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13862,9 +15334,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13901,19 +15373,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.UserProfileResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -13923,9 +15407,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13964,13 +15448,13 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13986,9 +15470,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -14032,13 +15516,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadProfilePictureData" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { @@ -14056,7 +15552,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -14146,13 +15642,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetAllUsersData" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -14168,9 +15676,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -14260,13 +15768,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListAccountDeletionRequestsData" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -14282,9 +15802,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -14310,6 +15830,12 @@ const docTemplate = `{ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -14519,7 +16045,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserRecentActivityFeed" + } + } + } + ] } }, "400": { @@ -14671,13 +16209,37 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "400": { @@ -14756,7 +16318,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/vimeo.OEmbedResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/vimeo.OEmbedResponse" + } + } + } + ] } }, "400": { @@ -14831,7 +16405,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.documentAdminGetSampleVideoData" + } + } + } + ] } }, "401": { @@ -14888,7 +16474,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/handlers.VimeoUploadResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoUploadResultData" + } + } + } + ] } }, "400": { @@ -14957,7 +16555,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/handlers.VimeoUploadResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoUploadResultData" + } + } + } + ] } }, "400": { @@ -15140,7 +16750,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.VimeoVideoResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoVideoResponse" + } + } + } + ] } }, "400": { @@ -15205,7 +16827,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -15310,7 +16932,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.VimeoEmbedResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoEmbedResponse" + } + } + } + ] } }, "400": { @@ -15377,10 +17011,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoTranscodeStatusData" + } + } + } + ] } }, "400": { @@ -15477,7 +17120,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.MobileAppVersionCheckResult" + } + } + } + ] } }, "400": { @@ -15513,7 +17168,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepAssessmentsData" + } + } + } + ] } }, "400": { @@ -15565,7 +17232,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { @@ -15623,19 +17302,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.loginUserRes" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { @@ -15647,7 +17338,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -15677,7 +17368,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { @@ -15722,7 +17425,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { @@ -15760,6 +17475,12 @@ const docTemplate = `{ "description": "Redirect to Google authorization URL; see Location header", "schema": { "type": "string" + }, + "headers": { + "Location": { + "type": "string", + "description": "Google authorization URL" + } } }, "503": { @@ -15804,19 +17525,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -15826,9 +17547,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -15862,19 +17583,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.loginUserRes" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -15884,9 +17617,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -16145,7 +17878,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByUnitData" + } + } + } + ] } }, "400": { @@ -16532,7 +18277,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData" + } + } + } + ] } }, "400": { @@ -16669,7 +18426,7 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -16731,7 +18488,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -16795,7 +18552,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listFAQsRes" + } + } + } + ] } }, "400": { @@ -16836,7 +18605,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -16882,7 +18663,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ProfileFieldOptionsGrouped" + } + } + } + ] } } } @@ -16910,7 +18703,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListFieldKeysData" + } + } + } + ] } } } @@ -16946,7 +18751,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadAudioData" + } + } + } + ] } }, "400": { @@ -17015,7 +18832,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -17090,7 +18919,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.presignedUploadRes" + } + } + } + ] } }, "400": { @@ -17158,7 +18999,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.RefreshFileURLData" + } + } + } + ] } }, "400": { @@ -17231,7 +19084,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -17294,7 +19159,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetFileURLData" + } + } + } + ] } }, "400": { @@ -17591,7 +19468,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByLessonData" + } + } + } + ] } }, "400": { @@ -17656,7 +19545,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.GetUserNotificationResponse" } }, "400": { @@ -17702,7 +19591,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -17759,7 +19648,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteInAppNotificationsData" + } + } + } + ] } }, "400": { @@ -17807,7 +19708,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -17849,7 +19750,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -17891,7 +19792,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.CountUnreadNotificationsResponse" } }, "401": { @@ -17943,7 +19844,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -18005,7 +19918,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -18069,7 +19982,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -18127,7 +20052,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -18192,7 +20129,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.paymentRes" + } + } + } + } + ] } }, "401": { @@ -18308,7 +20260,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -18359,7 +20311,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InitiateChapaDirectChargeResponse" + } + } + } + ] } }, "400": { @@ -18422,7 +20386,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.AuthorizeChapaDirectChargeResponse" + } + } + } + ] } }, "400": { @@ -18466,7 +20442,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ChapaDirectChargeMethod" + } + } + } + } + ] } } } @@ -18557,7 +20548,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InitiateDirectPaymentResponse" + } + } + } + ] } }, "400": { @@ -18601,7 +20604,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ARIFPAYPaymentMethod" + } + } + } + } + ] } } } @@ -18640,7 +20658,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.VerifyOTPResponse" + } + } + } + ] } }, "400": { @@ -18684,7 +20714,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ChapaPaymentMethod" + } + } + } + } + ] } } } @@ -18723,7 +20768,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InitiateSubscriptionPaymentResponse" + } + } + } + ] } }, "400": { @@ -18781,7 +20838,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.paymentRes" + } + } + } + ] } }, "400": { @@ -18852,7 +20921,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -18904,7 +20973,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.paymentRes" + } + } + } + ] } }, "400": { @@ -18962,7 +21043,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -19025,7 +21106,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listPersonasData" + } + } + } + ] } }, "400": { @@ -19082,7 +21175,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -19156,7 +21261,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListAllExamPrepPracticesData" + } + } + } + ] } }, "400": { @@ -19213,7 +21330,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -19297,7 +21426,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.paginatedQuestionSetItemsRes" + } + } + } + ] } }, "400": { @@ -19352,7 +21493,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepProgressSummary" + } + } + } + ] } }, "401": { @@ -19427,7 +21580,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -19502,7 +21655,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -19582,7 +21735,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SubmitAudioAnswerData" + } + } + } + ] } }, "400": { @@ -19837,7 +22002,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + } + ] } }, "400": { @@ -19898,7 +22078,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + ] } }, "400": { @@ -19963,7 +22155,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + ] } }, "400": { @@ -20018,7 +22222,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + } + ] } }, "401": { @@ -20077,7 +22296,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingSummaryRes" + } + } + } + ] } }, "400": { @@ -20135,7 +22366,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -20278,7 +22509,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -20580,7 +22811,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + } + ] } }, "400": { @@ -20621,7 +22867,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + ] } }, "400": { @@ -20673,7 +22931,19 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "400": { @@ -20736,7 +23006,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionCheckoutRes" + } + } + } + ] } }, "400": { @@ -20813,7 +23095,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + } + ] } }, "401": { @@ -20856,7 +23153,22 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + } + ] } }, "401": { @@ -20912,7 +23224,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.requestCheckoutLinkRes" + } + } + } + ] } }, "400": { @@ -20979,7 +23303,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckSubscriptionStatusData" + } + } + } + ] } }, "401": { @@ -21043,7 +23379,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21107,7 +23443,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21176,7 +23512,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21240,19 +23576,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.CheckPhoneEmailExistRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckPhoneEmailExistRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21291,7 +23639,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21346,25 +23694,37 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteMyUserAccountData" + } + } + } + ] } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { - "description": "Forbidden", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21389,25 +23749,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { - "description": "Forbidden", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21441,19 +23801,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21487,19 +23847,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21533,19 +23893,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21579,19 +23939,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21625,19 +23985,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21665,13 +24025,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.UserProfileResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -21687,9 +24059,9 @@ const docTemplate = `{ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21723,19 +24095,31 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21779,13 +24163,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadProfilePictureData" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { @@ -21803,7 +24199,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21840,7 +24236,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckProfileCompletedData" + } + } + } + ] } }, "400": { @@ -21902,7 +24310,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckUserPendingData" + } + } + } + ] } }, "400": { @@ -22045,7 +24465,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/vimeo.OEmbedResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/vimeo.OEmbedResponse" + } + } + } + ] } }, "400": { @@ -22109,7 +24541,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetSampleVideoData" + } + } + } + ] } }, "500": { @@ -22212,6 +24656,17 @@ const docTemplate = `{ } }, "definitions": { + "domain.ARIFPAYPaymentMethod": { + "type": "object", + "properties": { + "ID": { + "type": "integer" + }, + "Name": { + "type": "string" + } + } + }, "domain.AcceptTeamInvitationReq": { "type": "object", "required": [ @@ -22264,6 +24719,57 @@ const docTemplate = `{ } } }, + "domain.AccountDeletionRequest": { + "type": "object", + "properties": { + "DeletionCancelledAt": { + "type": "string" + }, + "DeletionRequestedAt": { + "type": "string" + }, + "DeletionScheduledAt": { + "type": "string" + }, + "DeletionState": { + "$ref": "#/definitions/domain.AccountDeletionState" + }, + "Email": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "PhoneNumber": { + "type": "string" + }, + "Role": { + "$ref": "#/definitions/domain.Role" + }, + "Status": { + "$ref": "#/definitions/domain.UserStatus" + }, + "UserID": { + "type": "integer" + } + } + }, + "domain.AccountDeletionState": { + "type": "string", + "enum": [ + "PENDING", + "DUE", + "CANCELLED" + ], + "x-enum-varnames": [ + "AccountDeletionStatePending", + "AccountDeletionStateDue", + "AccountDeletionStateCancelled" + ] + }, "domain.AdminExamPrepCatalogCourseLearningEntry": { "type": "object", "properties": { @@ -23211,6 +25717,20 @@ const docTemplate = `{ } } }, + "domain.AuthorizeChapaDirectChargeResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, "domain.BulkAccountsByRoleRequest": { "type": "object", "properties": { @@ -23219,6 +25739,60 @@ const docTemplate = `{ } } }, + "domain.BulkDeactivateAccountsByRoleResult": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "team_members_deactivated": { + "type": "integer" + }, + "users_deactivated": { + "type": "integer" + } + } + }, + "domain.BulkReactivateAccountsByRoleResult": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "team_members_reactivated": { + "type": "integer" + }, + "users_reactivated": { + "type": "integer" + } + } + }, + "domain.ChapaDirectChargeMethod": { + "type": "object", + "properties": { + "auth_type": { + "description": "\"ussd\" or \"otp\"", + "type": "string" + }, + "display_name": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "domain.ChapaPaymentMethod": { + "type": "object", + "properties": { + "display_name": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, "domain.ChapaWebhookPayload": { "type": "object", "properties": { @@ -23902,7 +26476,10 @@ const docTemplate = `{ "type": "object", "additionalProperties": true }, - "value": {} + "value": { + "description": "Component-specific JSON value selected by kind: string, number, boolean, object, array, or null. Use the component catalog and definition schema to interpret it.", + "x-json-types": "string|number|boolean|object|array|null" + } } }, "domain.DynamicQuestionPayload": { @@ -24395,6 +26972,99 @@ const docTemplate = `{ } } }, + "domain.InitiateChapaDirectChargeResponse": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "auth_type": { + "description": "ussd | otp", + "type": "string" + }, + "chapa_reference": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "portal_html": { + "type": "string" + }, + "request_id": { + "description": "OTP flows only", + "type": "string" + }, + "requires_authorize": { + "type": "boolean" + }, + "session_id": { + "description": "tx_ref for verify polling", + "type": "string" + } + } + }, + "domain.InitiateDirectPaymentResponse": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "currency": { + "type": "string" + }, + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "requires_otp": { + "type": "boolean" + }, + "session_id": { + "type": "string" + } + } + }, + "domain.InitiateSubscriptionPaymentResponse": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "free_enrollment": { + "type": "boolean" + }, + "payment_id": { + "type": "integer" + }, + "payment_url": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + } + } + }, "domain.InviteTeamMemberReq": { "type": "object", "required": [ @@ -24410,6 +27080,23 @@ const docTemplate = `{ } } }, + "domain.InviteTeamMemberRes": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "invitation_id": { + "type": "integer" + }, + "team_member_id": { + "type": "integer" + } + } + }, "domain.LMSEntityAccess": { "type": "object", "properties": { @@ -24461,6 +27148,37 @@ const docTemplate = `{ } } }, + "domain.LmsPersona": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "gender": { + "description": "Gender matches learner-style free text (nullable); always present in JSON for stable list payloads.", + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "profile_picture": { + "description": "ProfilePicture is always serialized (null when not set); clients rely on stable keys in list payloads.", + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "domain.LogEntry": { "type": "object", "properties": { @@ -24525,6 +27243,92 @@ const docTemplate = `{ } } }, + "domain.MobileAppVersionCheckResult": { + "type": "object", + "properties": { + "client_version_code": { + "type": "integer" + }, + "force_update": { + "type": "boolean" + }, + "latest_version_code": { + "type": "integer" + }, + "latest_version_name": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "release_notes": { + "type": "string" + }, + "store_url": { + "type": "string" + }, + "update_available": { + "type": "boolean" + }, + "update_type": { + "type": "string" + } + } + }, + "domain.Notification": { + "type": "object", + "properties": { + "delivery_channel": { + "$ref": "#/definitions/domain.DeliveryChannel" + }, + "delivery_status": { + "$ref": "#/definitions/domain.NotificationDeliveryStatus" + }, + "error_severity": { + "$ref": "#/definitions/domain.NotificationErrorSeverity" + }, + "expires": { + "type": "string" + }, + "id": { + "type": "string" + }, + "image": { + "type": "string" + }, + "is_read": { + "type": "boolean" + }, + "level": { + "$ref": "#/definitions/domain.NotificationLevel" + }, + "metadata": { + "description": "Free-form notification metadata supplied by the sending application. Keys are application-defined.", + "type": "object" + }, + "payload": { + "$ref": "#/definitions/domain.NotificationPayload" + }, + "priority": { + "type": "integer" + }, + "receiver_type": { + "$ref": "#/definitions/domain.ReceiverType" + }, + "reciever": { + "$ref": "#/definitions/domain.NotificationRecieverSide" + }, + "recipient_id": { + "type": "integer" + }, + "timestamp": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/domain.NotificationType" + } + } + }, "domain.NotificationDeliveryScheme": { "type": "string", "enum": [ @@ -24536,6 +27340,19 @@ const docTemplate = `{ "NotificationDeliverySchemeSingle" ] }, + "domain.NotificationDeliveryStatus": { + "type": "string", + "enum": [ + "pending", + "sent", + "failed" + ], + "x-enum-varnames": [ + "DeliveryStatusPending", + "DeliveryStatusSent", + "DeliveryStatusFailed" + ] + }, "domain.NotificationErrorSeverity": { "type": "string", "enum": [ @@ -24707,6 +27524,62 @@ const docTemplate = `{ "PracticeAuthoringProfileIELTSSharedStimulus" ] }, + "domain.PracticeByQuestionTypeDefinition": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "exam_prep_lesson_id": { + "type": "integer" + }, + "exam_prep_parents": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPracticeParent" + } + }, + "matching_question_count": { + "type": "integer" + }, + "parents": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PracticeParent" + } + }, + "persona_id": { + "type": "integer" + }, + "practice_id": { + "type": "integer" + }, + "practice_kind": { + "type": "string" + }, + "publish_status": { + "$ref": "#/definitions/domain.PracticePublishStatus" + }, + "question_set_id": { + "type": "integer" + }, + "quick_tips": { + "type": "string" + }, + "story_description": { + "type": "string" + }, + "story_image": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "domain.PracticeParent": { "type": "object", "properties": { @@ -24749,6 +27622,49 @@ const docTemplate = `{ } } }, + "domain.PracticesByQuestionTypeDefinitionSummary": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PracticeByQuestionTypeDefinition" + } + }, + "question_type_definition_id": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "domain.ProfileFieldOptionItem": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, + "domain.ProfileFieldOptionsGrouped": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ProfileFieldOptionItem" + } + } + }, "domain.PublicCatalogPage": { "type": "object", "properties": { @@ -24905,6 +27821,168 @@ const docTemplate = `{ } } }, + "domain.QuestionSetQuestionTypeCount": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "display_name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "question_type_definition_id": { + "type": "integer" + } + } + }, + "domain.QuestionSetQuestionTypesSummary": { + "type": "object", + "properties": { + "question_set_id": { + "type": "integer" + }, + "question_types": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionSetQuestionTypeCount" + } + }, + "total_questions": { + "type": "integer" + } + } + }, + "domain.QuestionTypeDefinition": { + "type": "object", + "properties": { + "CreatedAt": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "DisplayName": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "IsSystem": { + "type": "boolean" + }, + "Key": { + "type": "string" + }, + "ResponseComponentKinds": { + "type": "array", + "items": { + "type": "string" + } + }, + "ResponseSchema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.DynamicElementDefinition" + } + }, + "Status": { + "type": "string" + }, + "StimulusComponentKinds": { + "type": "array", + "items": { + "type": "string" + } + }, + "StimulusSchema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.DynamicElementDefinition" + } + }, + "UpdatedAt": { + "type": "string" + }, + "group_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "domain.QuestionTypeDefinitionGroup": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.QuestionTypeDefinitionGroupDetail": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "definitions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + }, + "description": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.ReceiverType": { + "type": "string", + "enum": [ + "user", + "team_member" + ], + "x-enum-varnames": [ + "ReceiverTypeUser", + "ReceiverTypeTeamMember" + ] + }, "domain.RecentActivityCourseRef": { "type": "object", "properties": { @@ -24988,6 +28066,20 @@ const docTemplate = `{ } } }, + "domain.RenderedEmail": { + "type": "object", + "properties": { + "html": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, "domain.ReorderIDsRequest": { "type": "object", "properties": { @@ -25013,11 +28105,14 @@ const docTemplate = `{ "domain.Response": { "type": "object", "properties": { - "data": {}, "message": { "type": "string" }, - "metadata": {}, + "metadata": { + "description": "Optional endpoint-specific metadata; null unless the operation documents a concrete metadata schema.", + "type": "object", + "x-nullable": true + }, "status_code": { "type": "integer" }, @@ -25099,6 +28194,15 @@ const docTemplate = `{ } } }, + "domain.SMSProvider": { + "type": "string", + "enum": [ + "afro_message" + ], + "x-enum-varnames": [ + "AfroMessage" + ] + }, "domain.SaveSettingListReq": { "type": "object", "properties": { @@ -25170,6 +28274,103 @@ const docTemplate = `{ } } }, + "domain.ScheduledNotification": { + "type": "object", + "properties": { + "attempt_count": { + "type": "integer" + }, + "cancelled_at": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/domain.DeliveryChannel" + }, + "created_at": { + "type": "string" + }, + "created_by": { + "description": "team_members.id of the staff actor who scheduled the job", + "type": "integer" + }, + "email_template_slug": { + "type": "string" + }, + "email_template_variables": { + "description": "Free-form template variable object. Keys are defined by the selected email template.", + "type": "object" + }, + "html": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "processing_started_at": { + "type": "string" + }, + "scheduled_at": { + "type": "string" + }, + "sent_at": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/domain.ScheduledNotificationStatus" + }, + "target_raw": { + "description": "Optional extra targets: phones and emails arrays, team_member_ids array, team_role, level, and type strings.", + "type": "object" + }, + "target_role": { + "type": "string" + }, + "target_team_member_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "target_team_role": { + "type": "string" + }, + "target_user_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.ScheduledNotificationStatus": { + "type": "string", + "enum": [ + "pending", + "processing", + "sent", + "failed", + "cancelled" + ], + "x-enum-varnames": [ + "ScheduledStatusPending", + "ScheduledStatusProcessing", + "ScheduledStatusSent", + "ScheduledStatusFailed", + "ScheduledStatusCancelled" + ] + }, "domain.SetRolePermissionsReq": { "type": "object", "required": [ @@ -25184,6 +28385,91 @@ const docTemplate = `{ } } }, + "domain.SettingListRes": { + "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": { + "$ref": "#/definitions/domain.SMSProvider" + }, + "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.SettingRes": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, "domain.TeamMemberLoginReq": { "type": "object", "required": [ @@ -25353,6 +28639,18 @@ const docTemplate = `{ } } }, + "domain.TeamVerifyPasswordResetRes": { + "type": "object", + "properties": { + "reason": { + "description": "missing | invalid | used | expired", + "type": "string" + }, + "valid": { + "type": "boolean" + } + } + }, "domain.UpdateCourseInput": { "type": "object", "properties": { @@ -25946,6 +29244,32 @@ const docTemplate = `{ } } }, + "domain.UserPersona": { + "type": "object", + "properties": { + "DisplayOrder": { + "type": "integer" + }, + "FirstName": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "LastName": { + "type": "string" + }, + "NickName": { + "type": "string" + }, + "ProfilePictureURL": { + "type": "string" + }, + "Role": { + "type": "string" + } + } + }, "domain.UserProfileResponse": { "type": "object", "properties": { @@ -26172,6 +29496,23 @@ const docTemplate = `{ } } }, + "domain.VerifyOTPResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "success": { + "type": "boolean" + }, + "transaction_id": { + "type": "string" + } + } + }, "domain.VerifyOtpReq": { "type": "object", "required": [ @@ -26189,6 +29530,29 @@ const docTemplate = `{ } } }, + "domain.VerifyTeamInvitationRes": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "needs_profile_setup": { + "type": "boolean" + }, + "status": { + "type": "string" + }, + "team_role": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + } + }, "domain.VideoEngagementHeartbeatInput": { "type": "object", "required": [ @@ -26275,47 +29639,23 @@ const docTemplate = `{ } } }, - "handlers.AdminProfileRes": { + "handlers.AddQuestionToSetData": { "type": "object", "properties": { - "created_at": { - "type": "string" + "associated_question_id": { + "type": "integer" }, - "email": { - "type": "string" - }, - "email_verified": { - "type": "boolean" - }, - "first_name": { - "type": "string" + "display_order": { + "type": "integer" }, "id": { "type": "integer" }, - "last_login": { - "type": "string" + "question_id": { + "type": "integer" }, - "last_name": { - "type": "string" - }, - "phone_number": { - "type": "string" - }, - "phone_verified": { - "type": "boolean" - }, - "role": { - "$ref": "#/definitions/domain.Role" - }, - "suspended": { - "type": "boolean" - }, - "suspended_at": { - "type": "string" - }, - "updated_at": { - "type": "string" + "set_id": { + "type": "integer" } } }, @@ -26387,6 +29727,41 @@ const docTemplate = `{ } } }, + "handlers.CheckProfileCompletedData": { + "type": "object", + "properties": { + "is_profile_completed": { + "type": "boolean" + }, + "profile_completion_percentage": { + "type": "integer" + } + } + }, + "handlers.CheckSubscriptionStatusData": { + "type": "object", + "properties": { + "has_active_subscription": { + "type": "boolean" + } + } + }, + "handlers.CheckUserPendingData": { + "type": "object", + "properties": { + "is_pending": { + "type": "boolean" + } + } + }, + "handlers.CountUnreadNotificationsResponse": { + "type": "object", + "properties": { + "unread": { + "type": "integer" + } + } + }, "handlers.CreateAdminReq": { "type": "object", "properties": { @@ -26455,20 +29830,353 @@ const docTemplate = `{ } } }, - "handlers.LoginAdminRes": { + "handlers.DeleteEmailTemplateData": { "type": "object", "properties": { - "access_token": { + "id": { + "type": "integer" + } + } + }, + "handlers.DeleteFAQData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.DeleteInAppNotificationsData": { + "type": "object", + "properties": { + "deleted_count": { + "type": "integer" + }, + "requested_ids": { + "type": "integer" + } + } + }, + "handlers.DeleteMyUserAccountData": { + "type": "object", + "properties": { + "can_cancel_until_at": { "type": "string" }, - "refresh_token": { + "grace_period_days": { + "type": "integer" + }, + "scheduled_purge_at": { + "type": "string" + } + } + }, + "handlers.DeleteQuestionTypeDefinitionData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.DeleteQuestionTypeDefinitionGroupData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.GetAllNotificationsResponse": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Notification" + } + }, + "page": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.GetAllUsersData": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + }, + "handlers.GetFileURLData": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "handlers.GetSampleVideoData": { + "type": "object", + "properties": { + "iframe": { "type": "string" }, - "role": { + "video": { + "$ref": "#/definitions/handlers.VimeoVideoResponse" + } + } + }, + "handlers.GetUserNotificationResponse": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Notification" + } + }, + "offset": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.LinkExamPrepAssessmentData": { + "type": "object", + "properties": { + "assessment": { + "$ref": "#/definitions/handlers.RawQuestionSetResponse" + }, + "parent_id": { + "type": "integer" + }, + "parent_kind": { "type": "string" } } }, + "handlers.ListAccountDeletionRequestsData": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.AccountDeletionRequest" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "handlers.ListAllExamPrepPracticesData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListExamPrepAssessmentsData": { + "type": "object", + "properties": { + "assessments": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.RawQuestionSetResponse" + } + } + } + }, + "handlers.ListExamPrepPracticesByCatalogCourseData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListExamPrepPracticesByLessonData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListExamPrepPracticesByUnitData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListFieldKeysData": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handlers.ListRolesData": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.RoleRecord" + } + }, + "total": { + "type": "integer" + } + } + }, + "handlers.ListScheduledNotificationsResponse": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "scheduled_notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.MessageAPIResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success", + "error" + ] + }, + "timestamp": { + "type": "string" + } + } + }, + "handlers.MessageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "metadata": { + "description": "Always null for message-only domain responses.", + "allOf": [ + { + "$ref": "#/definitions/handlers.NullResponseValue" + } + ], + "x-nullable": true + }, + "status_code": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, "handlers.NotificationDispatchResponse": { "type": "object", "properties": { @@ -26489,6 +30197,77 @@ const docTemplate = `{ } } }, + "handlers.NullResponseValue": { + "description": "Reserved metadata value. Always null; no object properties are returned.", + "type": "object" + }, + "handlers.PurgeDueDeletedUsersData": { + "type": "object", + "properties": { + "batch_limit": { + "type": "integer" + }, + "deleted_count": { + "type": "integer" + } + } + }, + "handlers.RawQuestionSetResponse": { + "type": "object", + "properties": { + "BannerImage": { + "type": "string" + }, + "CreatedAt": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "IntroVideoURL": { + "type": "string" + }, + "OwnerID": { + "type": "integer" + }, + "OwnerType": { + "type": "string" + }, + "PassingScore": { + "type": "integer" + }, + "Persona": { + "type": "string" + }, + "SetType": { + "type": "string" + }, + "ShuffleQuestions": { + "type": "boolean" + }, + "Status": { + "type": "string" + }, + "TimeLimitMinutes": { + "type": "integer" + }, + "Title": { + "type": "string" + }, + "UpdatedAt": { + "type": "string" + }, + "UserPersonas": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.UserPersona" + } + } + } + }, "handlers.ReferralCodeData": { "type": "object", "required": [ @@ -26657,6 +30436,20 @@ const docTemplate = `{ } } }, + "handlers.RefreshFileURLData": { + "type": "object", + "properties": { + "expires_in": { + "type": "integer" + }, + "object_key": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, "handlers.RegisterCodeReq": { "type": "object", "properties": { @@ -26729,6 +30522,14 @@ const docTemplate = `{ } } }, + "handlers.RevokeTeamInvitationData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, "handlers.SearchUserByNameOrPhoneReq": { "type": "object", "properties": { @@ -26740,6 +30541,80 @@ const docTemplate = `{ } } }, + "handlers.SendBulkEmailData": { + "type": "object", + "properties": { + "failed": { + "type": "integer" + }, + "sent": { + "type": "integer" + }, + "team_member_recipients": { + "type": "integer" + }, + "total_recipients": { + "type": "integer" + }, + "user_recipients": { + "type": "integer" + } + } + }, + "handlers.SendBulkInAppNotificationData": { + "type": "object", + "properties": { + "failed": { + "type": "integer" + }, + "sent": { + "type": "integer" + }, + "team_member_recipients": { + "type": "integer" + }, + "total_recipients": { + "type": "integer" + }, + "user_recipients": { + "type": "integer" + } + } + }, + "handlers.SendBulkPushNotificationData": { + "type": "object", + "properties": { + "devices_targeted": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "sent": { + "type": "integer" + }, + "target_users": { + "type": "integer" + } + } + }, + "handlers.SendBulkSMSData": { + "type": "object", + "properties": { + "failed": { + "type": "integer" + }, + "sent": { + "type": "integer" + }, + "total_recipients": { + "type": "integer" + } + } + }, "handlers.SendSingleAfroSMSReq": { "type": "object", "required": [ @@ -26757,6 +30632,43 @@ const docTemplate = `{ } } }, + "handlers.SendTestPushNotificationData": { + "type": "object", + "properties": { + "devices_count": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "message": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "handlers.SubmitAudioAnswerData": { + "type": "object", + "properties": { + "audio_url": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "question_id": { + "type": "integer" + }, + "question_set_id": { + "type": "integer" + } + } + }, "handlers.UnregisterDeviceToken.Request": { "type": "object", "required": [ @@ -26768,6 +30680,44 @@ const docTemplate = `{ } } }, + "handlers.UpdateQuestionTypeDefinitionData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.UploadAudioData": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "object_key": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "handlers.UploadProfilePictureData": { + "type": "object", + "properties": { + "profile_picture_url": { + "type": "string" + } + } + }, + "handlers.ValidateQuestionTypeDefinitionData": { + "type": "object", + "properties": { + "valid": { + "type": "boolean" + } + } + }, "handlers.VimeoEmbedResponse": { "type": "object", "properties": { @@ -26782,22 +30732,33 @@ const docTemplate = `{ } } }, - "handlers.VimeoUploadResponse": { + "handlers.VimeoTranscodeStatusData": { "type": "object", "properties": { - "link": { - "type": "string" - }, "status": { "type": "string" }, - "upload_link": { + "video_id": { + "type": "string" + } + } + }, + "handlers.VimeoUploadResultData": { + "type": "object", + "properties": { + "Link": { "type": "string" }, - "uri": { + "Status": { "type": "string" }, - "vimeo_id": { + "URI": { + "type": "string" + }, + "UploadLink": { + "type": "string" + }, + "VimeoID": { "type": "string" } } @@ -26875,6 +30836,74 @@ const docTemplate = `{ } } }, + "handlers.activityLogListRes": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.activityLogRes" + } + }, + "offset": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.activityLogRes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "actor_email": { + "type": "string" + }, + "actor_id": { + "type": "integer" + }, + "actor_kind": { + "type": "string" + }, + "actor_name": { + "type": "string" + }, + "actor_role": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "ip_address": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "description": "Free-form event metadata; keys depend on action and resource_type. Null when the event has no metadata.", + "type": "object" + }, + "resource_id": { + "type": "integer" + }, + "resource_type": { + "type": "string" + }, + "user_agent": { + "type": "string" + } + } + }, "handlers.addQuestionToSetReq": { "type": "object", "required": [ @@ -26926,6 +30955,152 @@ const docTemplate = `{ } } }, + "handlers.adminPaymentListItemRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "nonce": { + "type": "string" + }, + "paid_at": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "plan_category": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + }, + "transaction_id": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_email": { + "type": "string" + }, + "user_first_name": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "user_last_name": { + "type": "string" + } + } + }, + "handlers.adminPaymentRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "nonce": { + "type": "string" + }, + "paid_at": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "payment_url": { + "type": "string" + }, + "plan_category": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + }, + "transaction_id": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_email": { + "type": "string" + }, + "user_first_name": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "user_last_name": { + "type": "string" + } + } + }, + "handlers.apiIndexResponse": { + "type": "object", + "properties": { + "admin_api": { + "type": "string", + "example": "/api/v1/admin" + }, + "client_api": { + "type": "string", + "example": "/api/v1" + } + } + }, "handlers.applyReferralReq": { "type": "object", "required": [ @@ -27017,6 +31192,23 @@ const docTemplate = `{ } } }, + "handlers.componentCatalogRes": { + "type": "object", + "properties": { + "response_component_kinds": { + "type": "array", + "items": { + "type": "string" + } + }, + "stimulus_component_kinds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "handlers.courseListData": { "type": "object", "properties": { @@ -27427,6 +31619,116 @@ const docTemplate = `{ } } }, + "handlers.documentAdminGetSampleVideoData": { + "type": "object", + "properties": { + "iframe": { + "type": "string" + }, + "video": { + "$ref": "#/definitions/handlers.VimeoVideoResponse" + } + } + }, + "handlers.emailTemplateRes": { + "type": "object", + "properties": { + "body_html": { + "type": "string" + }, + "body_text": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_system": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "variables": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handlers.faqRes": { + "type": "object", + "properties": { + "answer": { + "type": "string" + }, + "category": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "question": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "handlers.fieldOptionRes": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "field_key": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "handlers.initiateChapaDirectPaymentReq": { "type": "object", "required": [ @@ -27566,6 +31868,184 @@ const docTemplate = `{ } } }, + "handlers.listAdminPaymentsRes": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.adminPaymentListItemRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listEmailTemplatesRes": { + "type": "object", + "properties": { + "templates": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listFAQsRes": { + "type": "object", + "properties": { + "faqs": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.faqRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listFieldOptionsRes": { + "type": "object", + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listMobileAppVersionsRes": { + "type": "object", + "properties": { + "total_count": { + "type": "integer" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + }, + "handlers.listPersonasData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "personas": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.LmsPersona" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionSetsRes": { + "type": "object", + "properties": { + "question_sets": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.questionSetRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionTypeDefinitionGroupsData": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" + } + }, + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionTypeDefinitionsData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "question_type_definitions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionsRes": { + "type": "object", + "properties": { + "questions": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.questionRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listTeamInvitationsRes": { + "type": "object", + "properties": { + "invitations": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.teamInvitationListItem" + } + }, + "total_count": { + "type": "integer" + } + } + }, "handlers.loginUserRes": { "type": "object", "properties": { @@ -27599,6 +32079,44 @@ const docTemplate = `{ } } }, + "handlers.mobileAppVersionRes": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "min_supported_version_code": { + "type": "integer" + }, + "platform": { + "type": "string" + }, + "release_notes": { + "type": "string" + }, + "status": { + "type": "string" + }, + "store_url": { + "type": "string" + }, + "update_type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "version_code": { + "type": "integer" + }, + "version_name": { + "type": "string" + } + } + }, "handlers.optionInput": { "type": "object", "required": [ @@ -27659,6 +32177,94 @@ const docTemplate = `{ } } }, + "handlers.paymentRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "paid_at": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "payment_url": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } + }, + "handlers.planRes": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "description": { + "type": "string" + }, + "duration_unit": { + "type": "string" + }, + "duration_value": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "is_active": { + "type": "boolean" + }, + "is_free": { + "type": "boolean" + }, + "is_lifetime": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "price": { + "type": "number" + } + } + }, "handlers.presignedUploadReq": { "type": "object", "properties": { @@ -27676,6 +32282,32 @@ const docTemplate = `{ } } }, + "handlers.presignedUploadRes": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "media_type": { + "type": "string" + }, + "object_key": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "upload_url": { + "type": "string" + } + } + }, "handlers.previewEmailTemplateReq": { "type": "object", "properties": { @@ -27964,6 +32596,46 @@ const docTemplate = `{ } } }, + "handlers.ratingRes": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "review": { + "type": "string" + }, + "stars": { + "type": "integer" + }, + "target_id": { + "type": "integer" + }, + "target_type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "handlers.ratingSummaryRes": { + "type": "object", + "properties": { + "average_stars": { + "type": "number" + }, + "total_count": { + "type": "integer" + } + } + }, "handlers.refreshFileURLReq": { "type": "object", "properties": { @@ -28000,6 +32672,30 @@ const docTemplate = `{ } } }, + "handlers.requestCheckoutLinkRes": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "destination_hint": { + "type": "string" + } + } + }, + "handlers.serviceInfoResponse": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Welcome to Rezina Backend API" + }, + "version": { + "type": "string", + "example": "1.0.1" + } + } + }, "handlers.shortAnswerInput": { "type": "object", "required": [ @@ -28091,6 +32787,126 @@ const docTemplate = `{ } } }, + "handlers.subscriptionCheckoutRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "free_enrollment": { + "type": "boolean" + }, + "payment_id": { + "type": "integer" + }, + "payment_url": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "subscription": { + "$ref": "#/definitions/handlers.subscriptionRes" + }, + "subscription_id": { + "type": "integer" + } + } + }, + "handlers.subscriptionRes": { + "type": "object", + "properties": { + "auto_renew": { + "type": "boolean" + }, + "category": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "duration_unit": { + "type": "string" + }, + "duration_value": { + "type": "integer" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_lifetime": { + "type": "boolean" + }, + "payment_method": { + "type": "string" + }, + "payment_reference": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "price": { + "type": "number" + }, + "starts_at": { + "type": "string" + }, + "status": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "handlers.teamInvitationListItem": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "email": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "team_member_id": { + "type": "integer" + }, + "team_role": { + "type": "string" + } + } + }, "handlers.teamMemberLoginRes": { "type": "object", "properties": { @@ -28419,6 +33235,58 @@ const docTemplate = `{ } } }, + "handlers.uploadMediaRes": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "embed_url": { + "type": "string" + }, + "media_type": { + "type": "string" + }, + "object_key": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "url": { + "type": "string" + }, + "vimeo_id": { + "type": "string" + } + } + }, + "handlers.userPersonaRes": { + "type": "object", + "properties": { + "display_order": { + "type": "integer" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "type": "string" + }, + "nick_name": { + "type": "string" + }, + "profile_picture_url": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, "handlers.validateQuestionTypeDefinitionReq": { "type": "object", "properties": { @@ -28454,11 +33322,13 @@ const docTemplate = `{ "response.APIResponse": { "type": "object", "properties": { - "data": {}, "message": { "type": "string" }, - "metadata": {}, + "metadata": { + "description": "Optional endpoint-specific metadata; omitted when there is no metadata.", + "type": "object" + }, "page": { "type": "integer" }, diff --git a/docs/swagger-response-schemas.md b/docs/swagger-response-schemas.md new file mode 100644 index 00000000..5c039fe9 --- /dev/null +++ b/docs/swagger-response-schemas.md @@ -0,0 +1,68 @@ +# Swagger response contracts + +Every registered API operation has an explicit success response schema. JSON +payloads document their envelope, property names, arrays, nested objects, and +pagination. Operations without a data payload use message-only schemas; CSV, +HTML, OAuth redirects, and WebSocket upgrades retain their actual media/protocol +contracts rather than being described as generic JSON. + +## Response envelopes + +- `domain.Response{data=ConcreteType}` documents `message`, `success`, + `status_code`, endpoint-specific `data`, and `metadata`. +- `response.APIResponse{data=ConcreteType}` documents legacy account responses + with `status`, `message`, typed `data`, `timestamp`, and optional pagination. +- `MessageResponse` and `MessageAPIResponse` describe responses that omit `data`. +- Some endpoints, such as notification counts/lists and analytics, return a + top-level object. Their schemas describe that object without adding an envelope. + +Raw service/domain records retain their existing JSON casing. For example, +assessment question sets and raw Vimeo upload results expose PascalCase fields. +Their Swagger models use those exact names; this documentation update does not +rename existing API properties. + +Both immediately dispatched and scheduled bulk notifications are documented: +`200` returns the delivery summary and `201` returns a scheduled notification. +Free-plan checkout includes an optional `subscription` in the checkout response. +Pagination metadata for staff lists and Vimeo lists has a concrete schema. + +## Extensible JSON and errors + +Activity/notification metadata and template variables are intentionally extensible +objects. Their descriptions identify the source of their keys. A dynamic question +component's `value` depends on its `kind`; its description and `x-json-types` +extension explicitly document the permitted JSON variants. These fields cannot +truthfully be represented as one fixed object or as a byte array. + +Reserved response `metadata` is null, or omitted in the legacy envelope, unless +the operation supplies a concrete metadata schema. Message-only responses document +this null value explicitly. + +Error responses retain their real transport shape: JSON handler errors use +`domain.ErrorResponse`; handlers/middleware returning Fiber errors use a plain-text +string. The API does not have a universal JSON error envelope. Consumers should +respect the response Content-Type, particularly on authentication and service +failures. The documentation does not change runtime error handling. + +## Maintaining complete schemas + +When adding an operation: + +1. Reuse an existing response type or add a small tagged payload DTO for maps. +2. Specify the complete response envelope and typed `data` in `@Success`. +3. Document each success status variant and the actual error bodies. +4. Use explicit descriptions for genuinely open JSON extension points. +5. Regenerate all artifacts and run the contract checks: + +```powershell +swag init -g cmd/main.go +go test ./internal/web_server/... ./internal/domain ./internal/apidocs/... +go run ./cmd/swagger-export -out exports/swagger-offline +``` + +`TestEveryAPIResponseHasDetailedSchema` checks response definitions recursively, +including item schemas and composed envelope overrides. It rejects generic success +envelopes, missing schemas, and unexplained empty fields. Other checks ensure route, +security, request-body, and path-parameter coverage, valid references, and parity +between `docs.go`, `swagger.json`, and `swagger.yaml`. Representative payload tests +also compare documentation-only DTOs with the JSON written by the runtime types. diff --git a/docs/swagger.json b/docs/swagger.json index 582cb615..be7a6bcf 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -9,6 +9,44 @@ "version": "1.0.1" }, "paths": { + "/": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "discovery" + ], + "summary": "Service welcome and version", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/handlers.serviceInfoResponse" + } + } + } + } + }, + "/api/v1/": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "discovery" + ], + "summary": "Discover the admin and customer API roots", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/handlers.apiIndexResponse" + } + } + } + } + }, "/api/v1/admin/activity-logs": { "get": { "security": [ @@ -86,7 +124,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.activityLogListRes" + } + } + } + ] } }, "400": { @@ -136,6 +186,12 @@ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -187,7 +243,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.activityLogRes" + } + } + } + ] } }, "400": { @@ -277,19 +345,34 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.AdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.AdminRes" + } + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -299,9 +382,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -338,19 +421,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -360,9 +443,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -407,7 +490,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.BulkDeactivateAccountsByRoleResult" + } + } + } + ] } }, "400": { @@ -482,7 +577,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.BulkReactivateAccountsByRoleResult" + } + } + } + ] } }, "400": { @@ -549,19 +656,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.AdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.AdminRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -571,9 +690,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -618,19 +737,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -640,9 +759,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -773,7 +892,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listMobileAppVersionsRes" + } + } + } + ] } }, "400": { @@ -833,7 +964,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + ] } }, "400": { @@ -890,7 +1033,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + ] } }, "400": { @@ -963,7 +1118,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + ] } }, "400": { @@ -1024,7 +1191,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -1078,7 +1245,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepAssessmentsData" + } + } + } + ] } }, "400": { @@ -1132,7 +1311,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.LinkExamPrepAssessmentData" + } + } + } + ] } }, "400": { @@ -1199,7 +1390,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -1263,19 +1454,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.LoginAdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -1285,9 +1488,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -1321,19 +1524,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.LoginAdminRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -1343,9 +1558,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -1562,7 +1777,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -1637,7 +1852,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByUnitData" + } + } + } + ] } }, "400": { @@ -1701,7 +1928,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -2083,7 +2322,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2294,7 +2533,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2535,7 +2774,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2610,7 +2849,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData" + } + } + } + ] } }, "400": { @@ -2674,7 +2925,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -2889,7 +3152,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -2957,7 +3220,7 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -3019,7 +3282,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -3094,7 +3357,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listEmailTemplatesRes" + } + } + } + ] } }, "400": { @@ -3155,7 +3430,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3213,7 +3500,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3289,7 +3588,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.RenderedEmail" + } + } + } + ] } }, "400": { @@ -3353,7 +3664,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3427,7 +3750,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + } + } + ] } }, "400": { @@ -3489,7 +3824,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteEmailTemplateData" + } + } + } + ] } }, "400": { @@ -3565,7 +3912,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.RenderedEmail" + } + } + } + ] } }, "400": { @@ -3646,7 +4005,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listFAQsRes" + } + } + } + ] } }, "400": { @@ -3707,7 +4078,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -3765,7 +4148,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -3839,7 +4234,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -3901,7 +4308,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteFAQData" + } + } + } + ] } }, "400": { @@ -3981,7 +4400,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listFieldOptionsRes" + } + } + } + ] } }, "401": { @@ -4029,7 +4460,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + } + } + ] } }, "400": { @@ -4080,7 +4523,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + } + } + ] } }, "400": { @@ -4141,7 +4596,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + } + } + ] } }, "400": { @@ -4190,7 +4657,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -4256,7 +4723,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadAudioData" + } + } + } + ] } }, "400": { @@ -4325,7 +4804,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -4400,7 +4891,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.presignedUploadRes" + } + } + } + ] } }, "400": { @@ -4468,7 +4971,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.RefreshFileURLData" + } + } + } + ] } }, "400": { @@ -4541,7 +5056,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -4604,7 +5131,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetFileURLData" + } + } + } + ] } }, "400": { @@ -4667,13 +5206,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.PurgeDueDeletedUsersData" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -4689,9 +5240,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -4948,7 +5499,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -5018,7 +5569,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -5236,7 +5787,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -5311,7 +5862,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByLessonData" + } + } + } + ] } }, "400": { @@ -5453,7 +6016,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.GetUserNotificationResponse" } }, "400": { @@ -5499,7 +6062,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -5593,7 +6156,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.GetAllNotificationsResponse" } }, "400": { @@ -5719,13 +6282,37 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkEmailData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -5825,13 +6412,37 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkInAppNotificationData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -5918,13 +6529,37 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkPushNotificationData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6011,13 +6646,37 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendBulkSMSData" + } + } + } + ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6142,7 +6801,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteInAppNotificationsData" + } + } + } + ] } }, "400": { @@ -6190,7 +6861,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -6232,7 +6903,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -6315,7 +6986,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.ListScheduledNotificationsResponse" } }, "400": { @@ -6373,7 +7044,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6431,7 +7114,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + } + } + ] } }, "400": { @@ -6528,7 +7223,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -6599,7 +7294,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendTestPushNotificationData" + } + } + } + ] } }, "400": { @@ -6647,7 +7354,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.CountUnreadNotificationsResponse" } }, "401": { @@ -6699,7 +7406,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -6761,7 +7480,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -6825,7 +7544,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -6883,7 +7614,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -7038,7 +7781,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listAdminPaymentsRes" + } + } + } + ] } }, "400": { @@ -7088,6 +7843,12 @@ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -7154,7 +7915,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.adminPaymentRes" + } + } + } + ] } }, "400": { @@ -7229,7 +8002,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listPersonasData" + } + } + } + ] } }, "400": { @@ -7289,7 +8074,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -7346,7 +8143,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -7416,7 +8225,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -7477,7 +8298,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -7545,7 +8366,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListAllExamPrepPracticesData" + } + } + } + ] } }, "400": { @@ -7602,7 +8435,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -7659,7 +8504,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -7729,7 +8586,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -7790,7 +8659,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -7854,7 +8723,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.quizFullData" + } + } + } + ] } }, "400": { @@ -7928,7 +8809,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.quizFullData" + } + } + } + ] } }, "400": { @@ -8000,7 +8893,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -8077,7 +8982,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -8155,7 +9072,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionSetsRes" + } + } + } + ] } }, "400": { @@ -8216,7 +9145,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionSetRes" + } + } + } + ] } }, "400": { @@ -8281,7 +9222,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.questionSetRes" + } + } + } + } + ] } }, "400": { @@ -8339,7 +9295,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionSetRes" + } + } + } + ] } }, "400": { @@ -8407,7 +9375,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8469,7 +9437,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8527,7 +9495,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.userPersonaRes" + } + } + } + } + ] } }, "400": { @@ -8595,7 +9578,7 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8660,7 +9643,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -8718,7 +9701,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionSetQuestionTypesSummary" + } + } + } + ] } }, "400": { @@ -8871,7 +9866,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.AddQuestionToSetData" + } + } + } + ] } }, "400": { @@ -8936,7 +9943,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -9013,7 +10020,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -9096,7 +10103,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionsRes" + } + } + } + ] } }, "400": { @@ -9157,7 +10176,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionRes" + } + } + } + ] } }, "400": { @@ -9206,7 +10237,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.componentCatalogRes" + } + } + } + ] } }, "401": { @@ -9266,7 +10309,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionsRes" + } + } + } + ] } }, "400": { @@ -9336,7 +10391,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionTypeDefinitionGroupsData" + } + } + } + ] } }, "400": { @@ -9396,7 +10463,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" + } + } + } + ] } }, "400": { @@ -9447,7 +10526,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroupDetail" + } + } + } + ] } }, "400": { @@ -9520,7 +10611,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" + } + } + } + ] } }, "400": { @@ -9575,7 +10678,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteQuestionTypeDefinitionGroupData" + } + } + } + ] } }, "400": { @@ -9652,7 +10767,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listQuestionTypeDefinitionsData" + } + } + } + ] } }, "400": { @@ -9719,7 +10846,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + } + } + ] } }, "400": { @@ -9782,7 +10921,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + } + } + ] } }, "400": { @@ -9850,7 +11001,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UpdateQuestionTypeDefinitionData" + } + } + } + ] } }, "400": { @@ -9911,7 +11074,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteQuestionTypeDefinitionData" + } + } + } + ] } }, "400": { @@ -9983,7 +11158,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.PracticesByQuestionTypeDefinitionSummary" + } + } + } + ] } }, "400": { @@ -10052,7 +11239,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ValidateQuestionTypeDefinitionData" + } + } + } + ] } }, "400": { @@ -10104,7 +11303,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.questionRes" + } + } + } + ] } }, "400": { @@ -10178,7 +11389,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -10240,7 +11451,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -10458,7 +11669,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -10703,7 +11914,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + } + ] } }, "400": { @@ -10768,7 +11994,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingSummaryRes" + } + } + } + ] } }, "400": { @@ -10826,7 +12064,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11000,7 +12238,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -11072,7 +12310,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListRolesData" + } + } + } + ] } }, "401": { @@ -11286,7 +12536,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11345,7 +12595,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11489,7 +12739,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -11680,13 +12930,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SendSingleAfroSMSReq" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { @@ -11704,7 +12966,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -11728,7 +12990,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.SettingListRes" + } + } + } + ] } }, "401": { @@ -11782,7 +13056,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.SettingListRes" + } + } + } + ] } }, "400": { @@ -11839,7 +13125,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.SettingRes" + } + } + } + ] } }, "400": { @@ -11896,7 +13194,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + } + ] } }, "400": { @@ -11957,7 +13270,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + ] } }, "400": { @@ -12021,7 +13346,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + ] } }, "401": { @@ -12083,7 +13420,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -12151,7 +13488,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -12213,6 +13550,12 @@ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -12264,7 +13607,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "400": { @@ -12339,7 +13694,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listTeamInvitationsRes" + } + } + } + ] } }, "400": { @@ -12391,7 +13758,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.TeamMemberResponse" + } + } + } + ] } }, "400": { @@ -12426,7 +13805,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.VerifyTeamInvitationRes" + } + } + } + ] } }, "400": { @@ -12472,7 +13863,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.RevokeTeamInvitationData" + } + } + } + ] } }, "400": { @@ -12904,6 +14307,12 @@ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "401": { @@ -12960,7 +14369,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InviteTeamMemberRes" + } + } + } + ] } }, "400": { @@ -13107,7 +14528,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13172,7 +14593,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13248,7 +14669,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13312,7 +14733,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InviteTeamMemberRes" + } + } + } + ] } }, "400": { @@ -13382,7 +14815,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13516,7 +14949,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13568,7 +15001,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -13680,7 +15113,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.TeamVerifyPasswordResetRes" + } + } + } + ] } } } @@ -13708,13 +15153,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.AdminProfileRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13730,9 +15187,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13769,13 +15226,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13791,9 +15248,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13832,13 +15289,28 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.UserProfileResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13854,9 +15326,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13893,19 +15365,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.UserProfileResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -13915,9 +15399,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -13956,13 +15440,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -13978,9 +15462,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -14024,13 +15508,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadProfilePictureData" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { @@ -14048,7 +15544,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -14138,13 +15634,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetAllUsersData" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -14160,9 +15668,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -14252,13 +15760,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListAccountDeletionRequestsData" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -14274,9 +15794,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -14302,6 +15822,12 @@ "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "attachment; filename=export.csv" + } } }, "400": { @@ -14511,7 +16037,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserRecentActivityFeed" + } + } + } + ] } }, "400": { @@ -14663,13 +16201,37 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "400": { @@ -14748,7 +16310,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/vimeo.OEmbedResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/vimeo.OEmbedResponse" + } + } + } + ] } }, "400": { @@ -14823,7 +16397,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.documentAdminGetSampleVideoData" + } + } + } + ] } }, "401": { @@ -14880,7 +16466,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/handlers.VimeoUploadResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoUploadResultData" + } + } + } + ] } }, "400": { @@ -14949,7 +16547,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/handlers.VimeoUploadResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoUploadResultData" + } + } + } + ] } }, "400": { @@ -15132,7 +16742,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.VimeoVideoResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoVideoResponse" + } + } + } + ] } }, "400": { @@ -15197,7 +16819,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -15302,7 +16924,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.VimeoEmbedResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoEmbedResponse" + } + } + } + ] } }, "400": { @@ -15369,10 +17003,19 @@ "200": { "description": "OK", "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.VimeoTranscodeStatusData" + } + } + } + ] } }, "400": { @@ -15469,7 +17112,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.MobileAppVersionCheckResult" + } + } + } + ] } }, "400": { @@ -15505,7 +17160,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepAssessmentsData" + } + } + } + ] } }, "400": { @@ -15557,7 +17224,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { @@ -15615,19 +17294,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.loginUserRes" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { @@ -15639,7 +17330,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -15669,7 +17360,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { @@ -15714,7 +17417,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { @@ -15752,6 +17467,12 @@ "description": "Redirect to Google authorization URL; see Location header", "schema": { "type": "string" + }, + "headers": { + "Location": { + "type": "string", + "description": "Google authorization URL" + } } }, "503": { @@ -15796,19 +17517,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -15818,9 +17539,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -15854,19 +17575,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.loginUserRes" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { @@ -15876,9 +17609,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -16137,7 +17870,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByUnitData" + } + } + } + ] } }, "400": { @@ -16524,7 +18269,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData" + } + } + } + ] } }, "400": { @@ -16661,7 +18418,7 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -16723,7 +18480,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -16787,7 +18544,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listFAQsRes" + } + } + } + ] } }, "400": { @@ -16828,7 +18597,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.faqRes" + } + } + } + ] } }, "400": { @@ -16874,7 +18655,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ProfileFieldOptionsGrouped" + } + } + } + ] } } } @@ -16902,7 +18695,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListFieldKeysData" + } + } + } + ] } } } @@ -16938,7 +18743,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadAudioData" + } + } + } + ] } }, "400": { @@ -17007,7 +18824,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -17082,7 +18911,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.presignedUploadRes" + } + } + } + ] } }, "400": { @@ -17150,7 +18991,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.RefreshFileURLData" + } + } + } + ] } }, "400": { @@ -17223,7 +19076,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.uploadMediaRes" + } + } + } + ] } }, "400": { @@ -17286,7 +19151,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetFileURLData" + } + } + } + ] } }, "400": { @@ -17583,7 +19460,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListExamPrepPracticesByLessonData" + } + } + } + ] } }, "400": { @@ -17648,7 +19537,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.GetUserNotificationResponse" } }, "400": { @@ -17694,7 +19583,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -17751,7 +19640,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteInAppNotificationsData" + } + } + } + ] } }, "400": { @@ -17799,7 +19700,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -17841,7 +19742,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { @@ -17883,7 +19784,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.CountUnreadNotificationsResponse" } }, "401": { @@ -17935,7 +19836,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -17997,7 +19910,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -18061,7 +19974,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -18119,7 +20044,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.Notification" + } + } + } + ] } }, "400": { @@ -18184,7 +20121,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.paymentRes" + } + } + } + } + ] } }, "401": { @@ -18300,7 +20252,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -18351,7 +20303,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InitiateChapaDirectChargeResponse" + } + } + } + ] } }, "400": { @@ -18414,7 +20378,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.AuthorizeChapaDirectChargeResponse" + } + } + } + ] } }, "400": { @@ -18458,7 +20434,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ChapaDirectChargeMethod" + } + } + } + } + ] } } } @@ -18549,7 +20540,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InitiateDirectPaymentResponse" + } + } + } + ] } }, "400": { @@ -18593,7 +20596,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ARIFPAYPaymentMethod" + } + } + } + } + ] } } } @@ -18632,7 +20650,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.VerifyOTPResponse" + } + } + } + ] } }, "400": { @@ -18676,7 +20706,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ChapaPaymentMethod" + } + } + } + } + ] } } } @@ -18715,7 +20760,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.InitiateSubscriptionPaymentResponse" + } + } + } + ] } }, "400": { @@ -18773,7 +20830,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.paymentRes" + } + } + } + ] } }, "400": { @@ -18844,7 +20913,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -18896,7 +20965,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.paymentRes" + } + } + } + ] } }, "400": { @@ -18954,7 +21035,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -19017,7 +21098,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.listPersonasData" + } + } + } + ] } }, "400": { @@ -19074,7 +21167,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.LmsPersona" + } + } + } + ] } }, "400": { @@ -19148,7 +21253,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ListAllExamPrepPracticesData" + } + } + } + ] } }, "400": { @@ -19205,7 +21322,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + } + } + ] } }, "400": { @@ -19289,7 +21418,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.paginatedQuestionSetItemsRes" + } + } + } + ] } }, "400": { @@ -19344,7 +21485,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.ExamPrepProgressSummary" + } + } + } + ] } }, "401": { @@ -19419,7 +21572,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -19494,7 +21647,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -19574,7 +21727,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.SubmitAudioAnswerData" + } + } + } + ] } }, "400": { @@ -19829,7 +21994,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + } + ] } }, "400": { @@ -19890,7 +22070,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + ] } }, "400": { @@ -19955,7 +22147,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + ] } }, "400": { @@ -20010,7 +22214,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.ratingRes" + } + } + } + } + ] } }, "401": { @@ -20069,7 +22288,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.ratingSummaryRes" + } + } + } + ] } }, "400": { @@ -20127,7 +22358,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -20270,7 +22501,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -20572,7 +22803,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + } + ] } }, "400": { @@ -20613,7 +22859,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.planRes" + } + } + } + ] } }, "400": { @@ -20665,7 +22923,19 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + ] } }, "400": { @@ -20728,7 +22998,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.subscriptionCheckoutRes" + } + } + } + ] } }, "400": { @@ -20805,7 +23087,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + } + ] } }, "401": { @@ -20848,7 +23145,22 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.subscriptionRes" + } + } + } + } + ] } }, "401": { @@ -20904,7 +23216,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.requestCheckoutLinkRes" + } + } + } + ] } }, "400": { @@ -20971,7 +23295,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckSubscriptionStatusData" + } + } + } + ] } }, "401": { @@ -21035,7 +23371,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21099,7 +23435,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21168,7 +23504,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21232,19 +23568,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/handlers.CheckPhoneEmailExistRes" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckPhoneEmailExistRes" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21283,7 +23631,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { @@ -21338,25 +23686,37 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.DeleteMyUserAccountData" + } + } + } + ] } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { - "description": "Forbidden", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21381,25 +23741,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "401": { - "description": "Unauthorized", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "403": { - "description": "Forbidden", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21433,19 +23793,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21479,19 +23839,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21525,19 +23885,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21571,19 +23931,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21617,19 +23977,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21657,13 +24017,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.UserProfileResponse" + "allOf": [ + { + "$ref": "#/definitions/response.APIResponse" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + ] } }, "400": { - "description": "Bad Request", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } }, "401": { @@ -21679,9 +24051,9 @@ } }, "500": { - "description": "Internal Server Error", + "description": "Plain-text error returned by the handler or authentication middleware", "schema": { - "$ref": "#/definitions/response.APIResponse" + "type": "string" } } } @@ -21715,19 +24087,31 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.loginUserRes" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21771,13 +24155,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.APIResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.UploadProfilePictureData" + } + } + } + ] } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { @@ -21795,7 +24191,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/response.APIResponse" + "$ref": "#/definitions/domain.ErrorResponse" } } } @@ -21832,7 +24228,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckProfileCompletedData" + } + } + } + ] } }, "400": { @@ -21894,7 +24302,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.CheckUserPendingData" + } + } + } + ] } }, "400": { @@ -22037,7 +24457,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/vimeo.OEmbedResponse" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/vimeo.OEmbedResponse" + } + } + } + ] } }, "400": { @@ -22101,7 +24533,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Response" + "allOf": [ + { + "$ref": "#/definitions/domain.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handlers.GetSampleVideoData" + } + } + } + ] } }, "500": { @@ -22204,6 +24648,17 @@ } }, "definitions": { + "domain.ARIFPAYPaymentMethod": { + "type": "object", + "properties": { + "ID": { + "type": "integer" + }, + "Name": { + "type": "string" + } + } + }, "domain.AcceptTeamInvitationReq": { "type": "object", "required": [ @@ -22256,6 +24711,57 @@ } } }, + "domain.AccountDeletionRequest": { + "type": "object", + "properties": { + "DeletionCancelledAt": { + "type": "string" + }, + "DeletionRequestedAt": { + "type": "string" + }, + "DeletionScheduledAt": { + "type": "string" + }, + "DeletionState": { + "$ref": "#/definitions/domain.AccountDeletionState" + }, + "Email": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "PhoneNumber": { + "type": "string" + }, + "Role": { + "$ref": "#/definitions/domain.Role" + }, + "Status": { + "$ref": "#/definitions/domain.UserStatus" + }, + "UserID": { + "type": "integer" + } + } + }, + "domain.AccountDeletionState": { + "type": "string", + "enum": [ + "PENDING", + "DUE", + "CANCELLED" + ], + "x-enum-varnames": [ + "AccountDeletionStatePending", + "AccountDeletionStateDue", + "AccountDeletionStateCancelled" + ] + }, "domain.AdminExamPrepCatalogCourseLearningEntry": { "type": "object", "properties": { @@ -23203,6 +25709,20 @@ } } }, + "domain.AuthorizeChapaDirectChargeResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, "domain.BulkAccountsByRoleRequest": { "type": "object", "properties": { @@ -23211,6 +25731,60 @@ } } }, + "domain.BulkDeactivateAccountsByRoleResult": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "team_members_deactivated": { + "type": "integer" + }, + "users_deactivated": { + "type": "integer" + } + } + }, + "domain.BulkReactivateAccountsByRoleResult": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "team_members_reactivated": { + "type": "integer" + }, + "users_reactivated": { + "type": "integer" + } + } + }, + "domain.ChapaDirectChargeMethod": { + "type": "object", + "properties": { + "auth_type": { + "description": "\"ussd\" or \"otp\"", + "type": "string" + }, + "display_name": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "domain.ChapaPaymentMethod": { + "type": "object", + "properties": { + "display_name": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, "domain.ChapaWebhookPayload": { "type": "object", "properties": { @@ -23894,7 +26468,10 @@ "type": "object", "additionalProperties": true }, - "value": {} + "value": { + "description": "Component-specific JSON value selected by kind: string, number, boolean, object, array, or null. Use the component catalog and definition schema to interpret it.", + "x-json-types": "string|number|boolean|object|array|null" + } } }, "domain.DynamicQuestionPayload": { @@ -24387,6 +26964,99 @@ } } }, + "domain.InitiateChapaDirectChargeResponse": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "auth_type": { + "description": "ussd | otp", + "type": "string" + }, + "chapa_reference": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "portal_html": { + "type": "string" + }, + "request_id": { + "description": "OTP flows only", + "type": "string" + }, + "requires_authorize": { + "type": "boolean" + }, + "session_id": { + "description": "tx_ref for verify polling", + "type": "string" + } + } + }, + "domain.InitiateDirectPaymentResponse": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "currency": { + "type": "string" + }, + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "requires_otp": { + "type": "boolean" + }, + "session_id": { + "type": "string" + } + } + }, + "domain.InitiateSubscriptionPaymentResponse": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "free_enrollment": { + "type": "boolean" + }, + "payment_id": { + "type": "integer" + }, + "payment_url": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + } + } + }, "domain.InviteTeamMemberReq": { "type": "object", "required": [ @@ -24402,6 +27072,23 @@ } } }, + "domain.InviteTeamMemberRes": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "invitation_id": { + "type": "integer" + }, + "team_member_id": { + "type": "integer" + } + } + }, "domain.LMSEntityAccess": { "type": "object", "properties": { @@ -24453,6 +27140,37 @@ } } }, + "domain.LmsPersona": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "gender": { + "description": "Gender matches learner-style free text (nullable); always present in JSON for stable list payloads.", + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "profile_picture": { + "description": "ProfilePicture is always serialized (null when not set); clients rely on stable keys in list payloads.", + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "domain.LogEntry": { "type": "object", "properties": { @@ -24517,6 +27235,92 @@ } } }, + "domain.MobileAppVersionCheckResult": { + "type": "object", + "properties": { + "client_version_code": { + "type": "integer" + }, + "force_update": { + "type": "boolean" + }, + "latest_version_code": { + "type": "integer" + }, + "latest_version_name": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "release_notes": { + "type": "string" + }, + "store_url": { + "type": "string" + }, + "update_available": { + "type": "boolean" + }, + "update_type": { + "type": "string" + } + } + }, + "domain.Notification": { + "type": "object", + "properties": { + "delivery_channel": { + "$ref": "#/definitions/domain.DeliveryChannel" + }, + "delivery_status": { + "$ref": "#/definitions/domain.NotificationDeliveryStatus" + }, + "error_severity": { + "$ref": "#/definitions/domain.NotificationErrorSeverity" + }, + "expires": { + "type": "string" + }, + "id": { + "type": "string" + }, + "image": { + "type": "string" + }, + "is_read": { + "type": "boolean" + }, + "level": { + "$ref": "#/definitions/domain.NotificationLevel" + }, + "metadata": { + "description": "Free-form notification metadata supplied by the sending application. Keys are application-defined.", + "type": "object" + }, + "payload": { + "$ref": "#/definitions/domain.NotificationPayload" + }, + "priority": { + "type": "integer" + }, + "receiver_type": { + "$ref": "#/definitions/domain.ReceiverType" + }, + "reciever": { + "$ref": "#/definitions/domain.NotificationRecieverSide" + }, + "recipient_id": { + "type": "integer" + }, + "timestamp": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/domain.NotificationType" + } + } + }, "domain.NotificationDeliveryScheme": { "type": "string", "enum": [ @@ -24528,6 +27332,19 @@ "NotificationDeliverySchemeSingle" ] }, + "domain.NotificationDeliveryStatus": { + "type": "string", + "enum": [ + "pending", + "sent", + "failed" + ], + "x-enum-varnames": [ + "DeliveryStatusPending", + "DeliveryStatusSent", + "DeliveryStatusFailed" + ] + }, "domain.NotificationErrorSeverity": { "type": "string", "enum": [ @@ -24699,6 +27516,62 @@ "PracticeAuthoringProfileIELTSSharedStimulus" ] }, + "domain.PracticeByQuestionTypeDefinition": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "exam_prep_lesson_id": { + "type": "integer" + }, + "exam_prep_parents": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPracticeParent" + } + }, + "matching_question_count": { + "type": "integer" + }, + "parents": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PracticeParent" + } + }, + "persona_id": { + "type": "integer" + }, + "practice_id": { + "type": "integer" + }, + "practice_kind": { + "type": "string" + }, + "publish_status": { + "$ref": "#/definitions/domain.PracticePublishStatus" + }, + "question_set_id": { + "type": "integer" + }, + "quick_tips": { + "type": "string" + }, + "story_description": { + "type": "string" + }, + "story_image": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "domain.PracticeParent": { "type": "object", "properties": { @@ -24741,6 +27614,49 @@ } } }, + "domain.PracticesByQuestionTypeDefinitionSummary": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PracticeByQuestionTypeDefinition" + } + }, + "question_type_definition_id": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "domain.ProfileFieldOptionItem": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, + "domain.ProfileFieldOptionsGrouped": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ProfileFieldOptionItem" + } + } + }, "domain.PublicCatalogPage": { "type": "object", "properties": { @@ -24897,6 +27813,168 @@ } } }, + "domain.QuestionSetQuestionTypeCount": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "display_name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "question_type_definition_id": { + "type": "integer" + } + } + }, + "domain.QuestionSetQuestionTypesSummary": { + "type": "object", + "properties": { + "question_set_id": { + "type": "integer" + }, + "question_types": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionSetQuestionTypeCount" + } + }, + "total_questions": { + "type": "integer" + } + } + }, + "domain.QuestionTypeDefinition": { + "type": "object", + "properties": { + "CreatedAt": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "DisplayName": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "IsSystem": { + "type": "boolean" + }, + "Key": { + "type": "string" + }, + "ResponseComponentKinds": { + "type": "array", + "items": { + "type": "string" + } + }, + "ResponseSchema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.DynamicElementDefinition" + } + }, + "Status": { + "type": "string" + }, + "StimulusComponentKinds": { + "type": "array", + "items": { + "type": "string" + } + }, + "StimulusSchema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.DynamicElementDefinition" + } + }, + "UpdatedAt": { + "type": "string" + }, + "group_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "domain.QuestionTypeDefinitionGroup": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.QuestionTypeDefinitionGroupDetail": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "definitions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + }, + "description": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.ReceiverType": { + "type": "string", + "enum": [ + "user", + "team_member" + ], + "x-enum-varnames": [ + "ReceiverTypeUser", + "ReceiverTypeTeamMember" + ] + }, "domain.RecentActivityCourseRef": { "type": "object", "properties": { @@ -24980,6 +28058,20 @@ } } }, + "domain.RenderedEmail": { + "type": "object", + "properties": { + "html": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, "domain.ReorderIDsRequest": { "type": "object", "properties": { @@ -25005,11 +28097,14 @@ "domain.Response": { "type": "object", "properties": { - "data": {}, "message": { "type": "string" }, - "metadata": {}, + "metadata": { + "description": "Optional endpoint-specific metadata; null unless the operation documents a concrete metadata schema.", + "type": "object", + "x-nullable": true + }, "status_code": { "type": "integer" }, @@ -25091,6 +28186,15 @@ } } }, + "domain.SMSProvider": { + "type": "string", + "enum": [ + "afro_message" + ], + "x-enum-varnames": [ + "AfroMessage" + ] + }, "domain.SaveSettingListReq": { "type": "object", "properties": { @@ -25162,6 +28266,103 @@ } } }, + "domain.ScheduledNotification": { + "type": "object", + "properties": { + "attempt_count": { + "type": "integer" + }, + "cancelled_at": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/domain.DeliveryChannel" + }, + "created_at": { + "type": "string" + }, + "created_by": { + "description": "team_members.id of the staff actor who scheduled the job", + "type": "integer" + }, + "email_template_slug": { + "type": "string" + }, + "email_template_variables": { + "description": "Free-form template variable object. Keys are defined by the selected email template.", + "type": "object" + }, + "html": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "processing_started_at": { + "type": "string" + }, + "scheduled_at": { + "type": "string" + }, + "sent_at": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/domain.ScheduledNotificationStatus" + }, + "target_raw": { + "description": "Optional extra targets: phones and emails arrays, team_member_ids array, team_role, level, and type strings.", + "type": "object" + }, + "target_role": { + "type": "string" + }, + "target_team_member_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "target_team_role": { + "type": "string" + }, + "target_user_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.ScheduledNotificationStatus": { + "type": "string", + "enum": [ + "pending", + "processing", + "sent", + "failed", + "cancelled" + ], + "x-enum-varnames": [ + "ScheduledStatusPending", + "ScheduledStatusProcessing", + "ScheduledStatusSent", + "ScheduledStatusFailed", + "ScheduledStatusCancelled" + ] + }, "domain.SetRolePermissionsReq": { "type": "object", "required": [ @@ -25176,6 +28377,91 @@ } } }, + "domain.SettingListRes": { + "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": { + "$ref": "#/definitions/domain.SMSProvider" + }, + "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.SettingRes": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, "domain.TeamMemberLoginReq": { "type": "object", "required": [ @@ -25345,6 +28631,18 @@ } } }, + "domain.TeamVerifyPasswordResetRes": { + "type": "object", + "properties": { + "reason": { + "description": "missing | invalid | used | expired", + "type": "string" + }, + "valid": { + "type": "boolean" + } + } + }, "domain.UpdateCourseInput": { "type": "object", "properties": { @@ -25938,6 +29236,32 @@ } } }, + "domain.UserPersona": { + "type": "object", + "properties": { + "DisplayOrder": { + "type": "integer" + }, + "FirstName": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "LastName": { + "type": "string" + }, + "NickName": { + "type": "string" + }, + "ProfilePictureURL": { + "type": "string" + }, + "Role": { + "type": "string" + } + } + }, "domain.UserProfileResponse": { "type": "object", "properties": { @@ -26164,6 +29488,23 @@ } } }, + "domain.VerifyOTPResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "payment_id": { + "type": "integer" + }, + "success": { + "type": "boolean" + }, + "transaction_id": { + "type": "string" + } + } + }, "domain.VerifyOtpReq": { "type": "object", "required": [ @@ -26181,6 +29522,29 @@ } } }, + "domain.VerifyTeamInvitationRes": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "needs_profile_setup": { + "type": "boolean" + }, + "status": { + "type": "string" + }, + "team_role": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + } + }, "domain.VideoEngagementHeartbeatInput": { "type": "object", "required": [ @@ -26267,47 +29631,23 @@ } } }, - "handlers.AdminProfileRes": { + "handlers.AddQuestionToSetData": { "type": "object", "properties": { - "created_at": { - "type": "string" + "associated_question_id": { + "type": "integer" }, - "email": { - "type": "string" - }, - "email_verified": { - "type": "boolean" - }, - "first_name": { - "type": "string" + "display_order": { + "type": "integer" }, "id": { "type": "integer" }, - "last_login": { - "type": "string" + "question_id": { + "type": "integer" }, - "last_name": { - "type": "string" - }, - "phone_number": { - "type": "string" - }, - "phone_verified": { - "type": "boolean" - }, - "role": { - "$ref": "#/definitions/domain.Role" - }, - "suspended": { - "type": "boolean" - }, - "suspended_at": { - "type": "string" - }, - "updated_at": { - "type": "string" + "set_id": { + "type": "integer" } } }, @@ -26379,6 +29719,41 @@ } } }, + "handlers.CheckProfileCompletedData": { + "type": "object", + "properties": { + "is_profile_completed": { + "type": "boolean" + }, + "profile_completion_percentage": { + "type": "integer" + } + } + }, + "handlers.CheckSubscriptionStatusData": { + "type": "object", + "properties": { + "has_active_subscription": { + "type": "boolean" + } + } + }, + "handlers.CheckUserPendingData": { + "type": "object", + "properties": { + "is_pending": { + "type": "boolean" + } + } + }, + "handlers.CountUnreadNotificationsResponse": { + "type": "object", + "properties": { + "unread": { + "type": "integer" + } + } + }, "handlers.CreateAdminReq": { "type": "object", "properties": { @@ -26447,20 +29822,353 @@ } } }, - "handlers.LoginAdminRes": { + "handlers.DeleteEmailTemplateData": { "type": "object", "properties": { - "access_token": { + "id": { + "type": "integer" + } + } + }, + "handlers.DeleteFAQData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.DeleteInAppNotificationsData": { + "type": "object", + "properties": { + "deleted_count": { + "type": "integer" + }, + "requested_ids": { + "type": "integer" + } + } + }, + "handlers.DeleteMyUserAccountData": { + "type": "object", + "properties": { + "can_cancel_until_at": { "type": "string" }, - "refresh_token": { + "grace_period_days": { + "type": "integer" + }, + "scheduled_purge_at": { + "type": "string" + } + } + }, + "handlers.DeleteQuestionTypeDefinitionData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.DeleteQuestionTypeDefinitionGroupData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.GetAllNotificationsResponse": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Notification" + } + }, + "page": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.GetAllUsersData": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.UserProfileResponse" + } + } + } + }, + "handlers.GetFileURLData": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "handlers.GetSampleVideoData": { + "type": "object", + "properties": { + "iframe": { "type": "string" }, - "role": { + "video": { + "$ref": "#/definitions/handlers.VimeoVideoResponse" + } + } + }, + "handlers.GetUserNotificationResponse": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Notification" + } + }, + "offset": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.LinkExamPrepAssessmentData": { + "type": "object", + "properties": { + "assessment": { + "$ref": "#/definitions/handlers.RawQuestionSetResponse" + }, + "parent_id": { + "type": "integer" + }, + "parent_kind": { "type": "string" } } }, + "handlers.ListAccountDeletionRequestsData": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.AccountDeletionRequest" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "handlers.ListAllExamPrepPracticesData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListExamPrepAssessmentsData": { + "type": "object", + "properties": { + "assessments": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.RawQuestionSetResponse" + } + } + } + }, + "handlers.ListExamPrepPracticesByCatalogCourseData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListExamPrepPracticesByLessonData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListExamPrepPracticesByUnitData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "practices": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ExamPrepPractice" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.ListFieldKeysData": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handlers.ListRolesData": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.RoleRecord" + } + }, + "total": { + "type": "integer" + } + } + }, + "handlers.ListScheduledNotificationsResponse": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "scheduled_notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ScheduledNotification" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.MessageAPIResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success", + "error" + ] + }, + "timestamp": { + "type": "string" + } + } + }, + "handlers.MessageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "metadata": { + "description": "Always null for message-only domain responses.", + "allOf": [ + { + "$ref": "#/definitions/handlers.NullResponseValue" + } + ], + "x-nullable": true + }, + "status_code": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, "handlers.NotificationDispatchResponse": { "type": "object", "properties": { @@ -26481,6 +30189,77 @@ } } }, + "handlers.NullResponseValue": { + "description": "Reserved metadata value. Always null; no object properties are returned.", + "type": "object" + }, + "handlers.PurgeDueDeletedUsersData": { + "type": "object", + "properties": { + "batch_limit": { + "type": "integer" + }, + "deleted_count": { + "type": "integer" + } + } + }, + "handlers.RawQuestionSetResponse": { + "type": "object", + "properties": { + "BannerImage": { + "type": "string" + }, + "CreatedAt": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "IntroVideoURL": { + "type": "string" + }, + "OwnerID": { + "type": "integer" + }, + "OwnerType": { + "type": "string" + }, + "PassingScore": { + "type": "integer" + }, + "Persona": { + "type": "string" + }, + "SetType": { + "type": "string" + }, + "ShuffleQuestions": { + "type": "boolean" + }, + "Status": { + "type": "string" + }, + "TimeLimitMinutes": { + "type": "integer" + }, + "Title": { + "type": "string" + }, + "UpdatedAt": { + "type": "string" + }, + "UserPersonas": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.UserPersona" + } + } + } + }, "handlers.ReferralCodeData": { "type": "object", "required": [ @@ -26649,6 +30428,20 @@ } } }, + "handlers.RefreshFileURLData": { + "type": "object", + "properties": { + "expires_in": { + "type": "integer" + }, + "object_key": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, "handlers.RegisterCodeReq": { "type": "object", "properties": { @@ -26721,6 +30514,14 @@ } } }, + "handlers.RevokeTeamInvitationData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, "handlers.SearchUserByNameOrPhoneReq": { "type": "object", "properties": { @@ -26732,6 +30533,80 @@ } } }, + "handlers.SendBulkEmailData": { + "type": "object", + "properties": { + "failed": { + "type": "integer" + }, + "sent": { + "type": "integer" + }, + "team_member_recipients": { + "type": "integer" + }, + "total_recipients": { + "type": "integer" + }, + "user_recipients": { + "type": "integer" + } + } + }, + "handlers.SendBulkInAppNotificationData": { + "type": "object", + "properties": { + "failed": { + "type": "integer" + }, + "sent": { + "type": "integer" + }, + "team_member_recipients": { + "type": "integer" + }, + "total_recipients": { + "type": "integer" + }, + "user_recipients": { + "type": "integer" + } + } + }, + "handlers.SendBulkPushNotificationData": { + "type": "object", + "properties": { + "devices_targeted": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "sent": { + "type": "integer" + }, + "target_users": { + "type": "integer" + } + } + }, + "handlers.SendBulkSMSData": { + "type": "object", + "properties": { + "failed": { + "type": "integer" + }, + "sent": { + "type": "integer" + }, + "total_recipients": { + "type": "integer" + } + } + }, "handlers.SendSingleAfroSMSReq": { "type": "object", "required": [ @@ -26749,6 +30624,43 @@ } } }, + "handlers.SendTestPushNotificationData": { + "type": "object", + "properties": { + "devices_count": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "message": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "handlers.SubmitAudioAnswerData": { + "type": "object", + "properties": { + "audio_url": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "question_id": { + "type": "integer" + }, + "question_set_id": { + "type": "integer" + } + } + }, "handlers.UnregisterDeviceToken.Request": { "type": "object", "required": [ @@ -26760,6 +30672,44 @@ } } }, + "handlers.UpdateQuestionTypeDefinitionData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "handlers.UploadAudioData": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "object_key": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "handlers.UploadProfilePictureData": { + "type": "object", + "properties": { + "profile_picture_url": { + "type": "string" + } + } + }, + "handlers.ValidateQuestionTypeDefinitionData": { + "type": "object", + "properties": { + "valid": { + "type": "boolean" + } + } + }, "handlers.VimeoEmbedResponse": { "type": "object", "properties": { @@ -26774,22 +30724,33 @@ } } }, - "handlers.VimeoUploadResponse": { + "handlers.VimeoTranscodeStatusData": { "type": "object", "properties": { - "link": { - "type": "string" - }, "status": { "type": "string" }, - "upload_link": { + "video_id": { + "type": "string" + } + } + }, + "handlers.VimeoUploadResultData": { + "type": "object", + "properties": { + "Link": { "type": "string" }, - "uri": { + "Status": { "type": "string" }, - "vimeo_id": { + "URI": { + "type": "string" + }, + "UploadLink": { + "type": "string" + }, + "VimeoID": { "type": "string" } } @@ -26867,6 +30828,74 @@ } } }, + "handlers.activityLogListRes": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.activityLogRes" + } + }, + "offset": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.activityLogRes": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "actor_email": { + "type": "string" + }, + "actor_id": { + "type": "integer" + }, + "actor_kind": { + "type": "string" + }, + "actor_name": { + "type": "string" + }, + "actor_role": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "ip_address": { + "type": "string" + }, + "message": { + "type": "string" + }, + "metadata": { + "description": "Free-form event metadata; keys depend on action and resource_type. Null when the event has no metadata.", + "type": "object" + }, + "resource_id": { + "type": "integer" + }, + "resource_type": { + "type": "string" + }, + "user_agent": { + "type": "string" + } + } + }, "handlers.addQuestionToSetReq": { "type": "object", "required": [ @@ -26918,6 +30947,152 @@ } } }, + "handlers.adminPaymentListItemRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "nonce": { + "type": "string" + }, + "paid_at": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "plan_category": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + }, + "transaction_id": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_email": { + "type": "string" + }, + "user_first_name": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "user_last_name": { + "type": "string" + } + } + }, + "handlers.adminPaymentRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "nonce": { + "type": "string" + }, + "paid_at": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "payment_url": { + "type": "string" + }, + "plan_category": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + }, + "transaction_id": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_email": { + "type": "string" + }, + "user_first_name": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "user_last_name": { + "type": "string" + } + } + }, + "handlers.apiIndexResponse": { + "type": "object", + "properties": { + "admin_api": { + "type": "string", + "example": "/api/v1/admin" + }, + "client_api": { + "type": "string", + "example": "/api/v1" + } + } + }, "handlers.applyReferralReq": { "type": "object", "required": [ @@ -27009,6 +31184,23 @@ } } }, + "handlers.componentCatalogRes": { + "type": "object", + "properties": { + "response_component_kinds": { + "type": "array", + "items": { + "type": "string" + } + }, + "stimulus_component_kinds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "handlers.courseListData": { "type": "object", "properties": { @@ -27419,6 +31611,116 @@ } } }, + "handlers.documentAdminGetSampleVideoData": { + "type": "object", + "properties": { + "iframe": { + "type": "string" + }, + "video": { + "$ref": "#/definitions/handlers.VimeoVideoResponse" + } + } + }, + "handlers.emailTemplateRes": { + "type": "object", + "properties": { + "body_html": { + "type": "string" + }, + "body_text": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_system": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "variables": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "handlers.faqRes": { + "type": "object", + "properties": { + "answer": { + "type": "string" + }, + "category": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "question": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "handlers.fieldOptionRes": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "display_order": { + "type": "integer" + }, + "field_key": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "handlers.initiateChapaDirectPaymentReq": { "type": "object", "required": [ @@ -27558,6 +31860,184 @@ } } }, + "handlers.listAdminPaymentsRes": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.adminPaymentListItemRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listEmailTemplatesRes": { + "type": "object", + "properties": { + "templates": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.emailTemplateRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listFAQsRes": { + "type": "object", + "properties": { + "faqs": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.faqRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listFieldOptionsRes": { + "type": "object", + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.fieldOptionRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listMobileAppVersionsRes": { + "type": "object", + "properties": { + "total_count": { + "type": "integer" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.mobileAppVersionRes" + } + } + } + }, + "handlers.listPersonasData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "personas": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.LmsPersona" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionSetsRes": { + "type": "object", + "properties": { + "question_sets": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.questionSetRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionTypeDefinitionGroupsData": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" + } + }, + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionTypeDefinitionsData": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "question_type_definitions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.QuestionTypeDefinition" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listQuestionsRes": { + "type": "object", + "properties": { + "questions": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.questionRes" + } + }, + "total_count": { + "type": "integer" + } + } + }, + "handlers.listTeamInvitationsRes": { + "type": "object", + "properties": { + "invitations": { + "type": "array", + "items": { + "$ref": "#/definitions/handlers.teamInvitationListItem" + } + }, + "total_count": { + "type": "integer" + } + } + }, "handlers.loginUserRes": { "type": "object", "properties": { @@ -27591,6 +32071,44 @@ } } }, + "handlers.mobileAppVersionRes": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "min_supported_version_code": { + "type": "integer" + }, + "platform": { + "type": "string" + }, + "release_notes": { + "type": "string" + }, + "status": { + "type": "string" + }, + "store_url": { + "type": "string" + }, + "update_type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "version_code": { + "type": "integer" + }, + "version_name": { + "type": "string" + } + } + }, "handlers.optionInput": { "type": "object", "required": [ @@ -27651,6 +32169,94 @@ } } }, + "handlers.paymentRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "paid_at": { + "type": "string" + }, + "payment_method": { + "type": "string" + }, + "payment_url": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "subscription_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } + }, + "handlers.planRes": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "description": { + "type": "string" + }, + "duration_unit": { + "type": "string" + }, + "duration_value": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "is_active": { + "type": "boolean" + }, + "is_free": { + "type": "boolean" + }, + "is_lifetime": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "price": { + "type": "number" + } + } + }, "handlers.presignedUploadReq": { "type": "object", "properties": { @@ -27668,6 +32274,32 @@ } } }, + "handlers.presignedUploadRes": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "media_type": { + "type": "string" + }, + "object_key": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "upload_url": { + "type": "string" + } + } + }, "handlers.previewEmailTemplateReq": { "type": "object", "properties": { @@ -27956,6 +32588,46 @@ } } }, + "handlers.ratingRes": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "review": { + "type": "string" + }, + "stars": { + "type": "integer" + }, + "target_id": { + "type": "integer" + }, + "target_type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "handlers.ratingSummaryRes": { + "type": "object", + "properties": { + "average_stars": { + "type": "number" + }, + "total_count": { + "type": "integer" + } + } + }, "handlers.refreshFileURLReq": { "type": "object", "properties": { @@ -27992,6 +32664,30 @@ } } }, + "handlers.requestCheckoutLinkRes": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "destination_hint": { + "type": "string" + } + } + }, + "handlers.serviceInfoResponse": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Welcome to Rezina Backend API" + }, + "version": { + "type": "string", + "example": "1.0.1" + } + } + }, "handlers.shortAnswerInput": { "type": "object", "required": [ @@ -28083,6 +32779,126 @@ } } }, + "handlers.subscriptionCheckoutRes": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "currency": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "free_enrollment": { + "type": "boolean" + }, + "payment_id": { + "type": "integer" + }, + "payment_url": { + "type": "string" + }, + "session_id": { + "type": "string" + }, + "subscription": { + "$ref": "#/definitions/handlers.subscriptionRes" + }, + "subscription_id": { + "type": "integer" + } + } + }, + "handlers.subscriptionRes": { + "type": "object", + "properties": { + "auto_renew": { + "type": "boolean" + }, + "category": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "duration_unit": { + "type": "string" + }, + "duration_value": { + "type": "integer" + }, + "expires_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_lifetime": { + "type": "boolean" + }, + "payment_method": { + "type": "string" + }, + "payment_reference": { + "type": "string" + }, + "plan_id": { + "type": "integer" + }, + "plan_name": { + "type": "string" + }, + "price": { + "type": "number" + }, + "starts_at": { + "type": "string" + }, + "status": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "handlers.teamInvitationListItem": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "email": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "team_member_id": { + "type": "integer" + }, + "team_role": { + "type": "string" + } + } + }, "handlers.teamMemberLoginRes": { "type": "object", "properties": { @@ -28411,6 +33227,58 @@ } } }, + "handlers.uploadMediaRes": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "embed_url": { + "type": "string" + }, + "media_type": { + "type": "string" + }, + "object_key": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "url": { + "type": "string" + }, + "vimeo_id": { + "type": "string" + } + } + }, + "handlers.userPersonaRes": { + "type": "object", + "properties": { + "display_order": { + "type": "integer" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "type": "string" + }, + "nick_name": { + "type": "string" + }, + "profile_picture_url": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, "handlers.validateQuestionTypeDefinitionReq": { "type": "object", "properties": { @@ -28446,11 +33314,13 @@ "response.APIResponse": { "type": "object", "properties": { - "data": {}, "message": { "type": "string" }, - "metadata": {}, + "metadata": { + "description": "Optional endpoint-specific metadata; omitted when there is no metadata.", + "type": "object" + }, "page": { "type": "integer" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ebbc1086..7d29f635 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,4 +1,11 @@ definitions: + domain.ARIFPAYPaymentMethod: + properties: + ID: + type: integer + Name: + type: string + type: object domain.AcceptTeamInvitationReq: properties: bio: @@ -35,6 +42,41 @@ definitions: - password - token type: object + domain.AccountDeletionRequest: + properties: + DeletionCancelledAt: + type: string + DeletionRequestedAt: + type: string + DeletionScheduledAt: + type: string + DeletionState: + $ref: '#/definitions/domain.AccountDeletionState' + Email: + type: string + FirstName: + type: string + LastName: + type: string + PhoneNumber: + type: string + Role: + $ref: '#/definitions/domain.Role' + Status: + $ref: '#/definitions/domain.UserStatus' + UserID: + type: integer + type: object + domain.AccountDeletionState: + enum: + - PENDING + - DUE + - CANCELLED + type: string + x-enum-varnames: + - AccountDeletionStatePending + - AccountDeletionStateDue + - AccountDeletionStateCancelled domain.AdminExamPrepCatalogCourseLearningEntry: properties: chapters: @@ -663,11 +705,55 @@ definitions: users_who_replayed: type: integer type: object + domain.AuthorizeChapaDirectChargeResponse: + properties: + message: + type: string + payment_id: + type: integer + success: + type: boolean + type: object domain.BulkAccountsByRoleRequest: properties: exclude_team_member_id: type: integer type: object + domain.BulkDeactivateAccountsByRoleResult: + properties: + role: + type: string + team_members_deactivated: + type: integer + users_deactivated: + type: integer + type: object + domain.BulkReactivateAccountsByRoleResult: + properties: + role: + type: string + team_members_reactivated: + type: integer + users_reactivated: + type: integer + type: object + domain.ChapaDirectChargeMethod: + properties: + auth_type: + description: '"ussd" or "otp"' + type: string + display_name: + type: string + name: + type: string + type: object + domain.ChapaPaymentMethod: + properties: + display_name: + type: string + name: + type: string + type: object domain.ChapaWebhookPayload: properties: amount: @@ -1168,7 +1254,11 @@ definitions: meta: additionalProperties: true type: object - value: {} + value: + description: 'Component-specific JSON value selected by kind: string, number, + boolean, object, array, or null. Use the component catalog and definition + schema to interpret it.' + x-json-types: string|number|boolean|object|array|null type: object domain.DynamicQuestionPayload: properties: @@ -1494,6 +1584,68 @@ definitions: $ref: '#/definitions/domain.DynamicElementInstance' type: array type: object + domain.InitiateChapaDirectChargeResponse: + properties: + amount: + type: number + auth_type: + description: ussd | otp + type: string + chapa_reference: + type: string + currency: + type: string + expires_at: + type: string + message: + type: string + payment_id: + type: integer + portal_html: + type: string + request_id: + description: OTP flows only + type: string + requires_authorize: + type: boolean + session_id: + description: tx_ref for verify polling + type: string + type: object + domain.InitiateDirectPaymentResponse: + properties: + amount: + type: number + currency: + type: string + message: + type: string + payment_id: + type: integer + requires_otp: + type: boolean + session_id: + type: string + type: object + domain.InitiateSubscriptionPaymentResponse: + properties: + amount: + type: number + currency: + type: string + expires_at: + type: string + free_enrollment: + type: boolean + payment_id: + type: integer + payment_url: + type: string + session_id: + type: string + subscription_id: + type: integer + type: object domain.InviteTeamMemberReq: properties: email: @@ -1504,6 +1656,17 @@ definitions: - email - team_role type: object + domain.InviteTeamMemberRes: + properties: + email: + type: string + expires_at: + type: string + invitation_id: + type: integer + team_member_id: + type: integer + type: object domain.LMSEntityAccess: properties: completed_count: @@ -1539,6 +1702,29 @@ definitions: - parent_kind - question_set_id type: object + domain.LmsPersona: + properties: + created_at: + type: string + description: + type: string + gender: + description: Gender matches learner-style free text (nullable); always present + in JSON for stable list payloads. + type: string + id: + type: integer + is_active: + type: boolean + name: + type: string + profile_picture: + description: ProfilePicture is always serialized (null when not set); clients + rely on stable keys in list payloads. + type: string + updated_at: + type: string + type: object domain.LogEntry: properties: caller: @@ -1581,6 +1767,64 @@ definitions: phone_number: type: string type: object + domain.MobileAppVersionCheckResult: + properties: + client_version_code: + type: integer + force_update: + type: boolean + latest_version_code: + type: integer + latest_version_name: + type: string + platform: + type: string + release_notes: + type: string + store_url: + type: string + update_available: + type: boolean + update_type: + type: string + type: object + domain.Notification: + properties: + delivery_channel: + $ref: '#/definitions/domain.DeliveryChannel' + delivery_status: + $ref: '#/definitions/domain.NotificationDeliveryStatus' + error_severity: + $ref: '#/definitions/domain.NotificationErrorSeverity' + expires: + type: string + id: + type: string + image: + type: string + is_read: + type: boolean + level: + $ref: '#/definitions/domain.NotificationLevel' + metadata: + description: Free-form notification metadata supplied by the sending application. + Keys are application-defined. + type: object + payload: + $ref: '#/definitions/domain.NotificationPayload' + priority: + type: integer + receiver_type: + $ref: '#/definitions/domain.ReceiverType' + reciever: + $ref: '#/definitions/domain.NotificationRecieverSide' + recipient_id: + type: integer + timestamp: + type: string + type: + $ref: '#/definitions/domain.NotificationType' + type: object domain.NotificationDeliveryScheme: enum: - bulk @@ -1589,6 +1833,16 @@ definitions: x-enum-varnames: - NotificationDeliverySchemeBulk - NotificationDeliverySchemeSingle + domain.NotificationDeliveryStatus: + enum: + - pending + - sent + - failed + type: string + x-enum-varnames: + - DeliveryStatusPending + - DeliveryStatusSent + - DeliveryStatusFailed domain.NotificationErrorSeverity: enum: - low @@ -1722,6 +1976,43 @@ definitions: x-enum-varnames: - PracticeAuthoringProfileStandalone - PracticeAuthoringProfileIELTSSharedStimulus + domain.PracticeByQuestionTypeDefinition: + properties: + created_at: + type: string + exam_prep_lesson_id: + type: integer + exam_prep_parents: + items: + $ref: '#/definitions/domain.ExamPrepPracticeParent' + type: array + matching_question_count: + type: integer + parents: + items: + $ref: '#/definitions/domain.PracticeParent' + type: array + persona_id: + type: integer + practice_id: + type: integer + practice_kind: + type: string + publish_status: + $ref: '#/definitions/domain.PracticePublishStatus' + question_set_id: + type: integer + quick_tips: + type: string + story_description: + type: string + story_image: + type: string + title: + type: string + updated_at: + type: string + type: object domain.PracticeParent: properties: parent_id: @@ -1750,6 +2041,34 @@ definitions: $ref: '#/definitions/domain.DynamicElementInstance' type: array type: object + domain.PracticesByQuestionTypeDefinitionSummary: + properties: + limit: + type: integer + offset: + type: integer + practices: + items: + $ref: '#/definitions/domain.PracticeByQuestionTypeDefinition' + type: array + question_type_definition_id: + type: integer + total_count: + type: integer + type: object + domain.ProfileFieldOptionItem: + properties: + code: + type: string + label: + type: string + type: object + domain.ProfileFieldOptionsGrouped: + additionalProperties: + items: + $ref: '#/definitions/domain.ProfileFieldOptionItem' + type: array + type: object domain.PublicCatalogPage: properties: courses: @@ -1853,6 +2172,113 @@ definitions: title: type: string type: object + domain.QuestionSetQuestionTypeCount: + properties: + count: + type: integer + display_name: + type: string + key: + type: string + question_type_definition_id: + type: integer + type: object + domain.QuestionSetQuestionTypesSummary: + properties: + question_set_id: + type: integer + question_types: + items: + $ref: '#/definitions/domain.QuestionSetQuestionTypeCount' + type: array + total_questions: + type: integer + type: object + domain.QuestionTypeDefinition: + properties: + CreatedAt: + type: string + Description: + type: string + DisplayName: + type: string + ID: + type: integer + IsSystem: + type: boolean + Key: + type: string + ResponseComponentKinds: + items: + type: string + type: array + ResponseSchema: + items: + $ref: '#/definitions/domain.DynamicElementDefinition' + type: array + Status: + type: string + StimulusComponentKinds: + items: + type: string + type: array + StimulusSchema: + items: + $ref: '#/definitions/domain.DynamicElementDefinition' + type: array + UpdatedAt: + type: string + group_ids: + items: + type: integer + type: array + type: object + domain.QuestionTypeDefinitionGroup: + properties: + created_at: + type: string + description: + type: string + display_order: + type: integer + id: + type: integer + name: + type: string + status: + type: string + updated_at: + type: string + type: object + domain.QuestionTypeDefinitionGroupDetail: + properties: + created_at: + type: string + definitions: + items: + $ref: '#/definitions/domain.QuestionTypeDefinition' + type: array + description: + type: string + display_order: + type: integer + id: + type: integer + name: + type: string + status: + type: string + updated_at: + type: string + type: object + domain.ReceiverType: + enum: + - user + - team_member + type: string + x-enum-varnames: + - ReceiverTypeUser + - ReceiverTypeTeamMember domain.RecentActivityCourseRef: properties: id: @@ -1907,6 +2333,15 @@ definitions: example: ABCDEF0123456789 type: string type: object + domain.RenderedEmail: + properties: + html: + type: string + subject: + type: string + text: + type: string + type: object domain.ReorderIDsRequest: properties: ordered_ids: @@ -1923,10 +2358,13 @@ definitions: type: object domain.Response: properties: - data: {} message: type: string - metadata: {} + metadata: + description: Optional endpoint-specific metadata; null unless the operation + documents a concrete metadata schema. + type: object + x-nullable: true status_code: type: integer success: @@ -1984,6 +2422,12 @@ definitions: updated_at: type: string type: object + domain.SMSProvider: + enum: + - afro_message + type: string + x-enum-varnames: + - AfroMessage domain.SaveSettingListReq: properties: amount_for_bet_referral: @@ -2031,6 +2475,76 @@ definitions: welcome_bonus_multiplier: type: number type: object + domain.ScheduledNotification: + properties: + attempt_count: + type: integer + cancelled_at: + type: string + channel: + $ref: '#/definitions/domain.DeliveryChannel' + created_at: + type: string + created_by: + description: team_members.id of the staff actor who scheduled the job + type: integer + email_template_slug: + type: string + email_template_variables: + description: Free-form template variable object. Keys are defined by the selected + email template. + type: object + html: + type: string + id: + type: integer + last_error: + type: string + message: + type: string + processing_started_at: + type: string + scheduled_at: + type: string + sent_at: + type: string + status: + $ref: '#/definitions/domain.ScheduledNotificationStatus' + target_raw: + description: 'Optional extra targets: phones and emails arrays, team_member_ids + array, team_role, level, and type strings.' + type: object + target_role: + type: string + target_team_member_ids: + items: + type: integer + type: array + target_team_role: + type: string + target_user_ids: + items: + type: integer + type: array + title: + type: string + updated_at: + type: string + type: object + domain.ScheduledNotificationStatus: + enum: + - pending + - processing + - sent + - failed + - cancelled + type: string + x-enum-varnames: + - ScheduledStatusPending + - ScheduledStatusProcessing + - ScheduledStatusSent + - ScheduledStatusFailed + - ScheduledStatusCancelled domain.SetRolePermissionsReq: properties: permission_ids: @@ -2040,6 +2554,62 @@ definitions: required: - permission_ids type: object + domain.SettingListRes: + 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: + $ref: '#/definitions/domain.SMSProvider' + 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.SettingRes: + properties: + key: + type: string + updated_at: + type: string + value: + type: string + type: object domain.TeamMemberLoginReq: properties: email: @@ -2159,6 +2729,14 @@ definitions: required: - email type: object + domain.TeamVerifyPasswordResetRes: + properties: + reason: + description: missing | invalid | used | expired + type: string + valid: + type: boolean + type: object domain.UpdateCourseInput: properties: access_tier: @@ -2568,6 +3146,23 @@ definitions: region: type: string type: object + domain.UserPersona: + properties: + DisplayOrder: + type: integer + FirstName: + type: string + ID: + type: integer + LastName: + type: string + NickName: + type: string + ProfilePictureURL: + type: string + Role: + type: string + type: object domain.UserProfileResponse: properties: active_subscriptions: @@ -2724,6 +3319,17 @@ definitions: total_users: type: integer type: object + domain.VerifyOTPResponse: + properties: + message: + type: string + payment_id: + type: integer + success: + type: boolean + transaction_id: + type: string + type: object domain.VerifyOtpReq: properties: email: @@ -2735,6 +3341,21 @@ definitions: required: - otp type: object + domain.VerifyTeamInvitationRes: + properties: + email: + type: string + expires_at: + type: string + needs_profile_setup: + type: boolean + status: + type: string + team_role: + type: string + valid: + type: boolean + type: object domain.VideoEngagementHeartbeatInput: properties: content_id: @@ -2792,34 +3413,18 @@ definitions: uuid: type: string type: object - handlers.AdminProfileRes: + handlers.AddQuestionToSetData: properties: - created_at: - type: string - email: - type: string - email_verified: - type: boolean - first_name: - type: string + associated_question_id: + type: integer + display_order: + type: integer id: type: integer - last_login: - type: string - last_name: - type: string - phone_number: - type: string - phone_verified: - type: boolean - role: - $ref: '#/definitions/domain.Role' - suspended: - type: boolean - suspended_at: - type: string - updated_at: - type: string + question_id: + type: integer + set_id: + type: integer type: object handlers.AdminRes: properties: @@ -2866,6 +3471,28 @@ definitions: phone_number_exist: type: boolean type: object + handlers.CheckProfileCompletedData: + properties: + is_profile_completed: + type: boolean + profile_completion_percentage: + type: integer + type: object + handlers.CheckSubscriptionStatusData: + properties: + has_active_subscription: + type: boolean + type: object + handlers.CheckUserPendingData: + properties: + is_pending: + type: boolean + type: object + handlers.CountUnreadNotificationsResponse: + properties: + unread: + type: integer + type: object handlers.CreateAdminReq: properties: email: @@ -2913,15 +3540,229 @@ definitions: - file_size - name type: object - handlers.LoginAdminRes: + handlers.DeleteEmailTemplateData: properties: - access_token: + id: + type: integer + type: object + handlers.DeleteFAQData: + properties: + id: + type: integer + type: object + handlers.DeleteInAppNotificationsData: + properties: + deleted_count: + type: integer + requested_ids: + type: integer + type: object + handlers.DeleteMyUserAccountData: + properties: + can_cancel_until_at: type: string - refresh_token: + grace_period_days: + type: integer + scheduled_purge_at: type: string - role: + type: object + handlers.DeleteQuestionTypeDefinitionData: + properties: + id: + type: integer + type: object + handlers.DeleteQuestionTypeDefinitionGroupData: + properties: + id: + type: integer + type: object + handlers.GetAllNotificationsResponse: + properties: + limit: + type: integer + notifications: + items: + $ref: '#/definitions/domain.Notification' + type: array + page: + type: integer + total_count: + type: integer + type: object + handlers.GetAllUsersData: + properties: + total: + type: integer + users: + items: + $ref: '#/definitions/domain.UserProfileResponse' + type: array + type: object + handlers.GetFileURLData: + properties: + url: type: string type: object + handlers.GetSampleVideoData: + properties: + iframe: + type: string + video: + $ref: '#/definitions/handlers.VimeoVideoResponse' + type: object + handlers.GetUserNotificationResponse: + properties: + limit: + type: integer + notifications: + items: + $ref: '#/definitions/domain.Notification' + type: array + offset: + type: integer + total_count: + type: integer + type: object + handlers.LinkExamPrepAssessmentData: + properties: + assessment: + $ref: '#/definitions/handlers.RawQuestionSetResponse' + parent_id: + type: integer + parent_kind: + type: string + type: object + handlers.ListAccountDeletionRequestsData: + properties: + items: + items: + $ref: '#/definitions/domain.AccountDeletionRequest' + type: array + page: + type: integer + page_size: + type: integer + total: + type: integer + type: object + handlers.ListAllExamPrepPracticesData: + properties: + limit: + type: integer + offset: + type: integer + practices: + items: + $ref: '#/definitions/domain.ExamPrepPractice' + type: array + total_count: + type: integer + type: object + handlers.ListExamPrepAssessmentsData: + properties: + assessments: + items: + $ref: '#/definitions/handlers.RawQuestionSetResponse' + type: array + type: object + handlers.ListExamPrepPracticesByCatalogCourseData: + properties: + limit: + type: integer + offset: + type: integer + practices: + items: + $ref: '#/definitions/domain.ExamPrepPractice' + type: array + total_count: + type: integer + type: object + handlers.ListExamPrepPracticesByLessonData: + properties: + limit: + type: integer + offset: + type: integer + practices: + items: + $ref: '#/definitions/domain.ExamPrepPractice' + type: array + total_count: + type: integer + type: object + handlers.ListExamPrepPracticesByUnitData: + properties: + limit: + type: integer + offset: + type: integer + practices: + items: + $ref: '#/definitions/domain.ExamPrepPractice' + type: array + total_count: + type: integer + type: object + handlers.ListFieldKeysData: + properties: + fields: + items: + type: string + type: array + type: object + handlers.ListRolesData: + properties: + page: + type: integer + page_size: + type: integer + roles: + items: + $ref: '#/definitions/domain.RoleRecord' + type: array + total: + type: integer + type: object + handlers.ListScheduledNotificationsResponse: + properties: + limit: + type: integer + page: + type: integer + scheduled_notifications: + items: + $ref: '#/definitions/domain.ScheduledNotification' + type: array + total_count: + type: integer + type: object + handlers.MessageAPIResponse: + properties: + message: + type: string + status: + enum: + - success + - error + type: string + timestamp: + type: string + type: object + handlers.MessageResponse: + properties: + message: + type: string + metadata: + allOf: + - $ref: '#/definitions/handlers.NullResponseValue' + description: Always null for message-only domain responses. + x-nullable: true + status_code: + type: integer + success: + type: boolean + type: object handlers.NotificationDispatchResponse: properties: message: @@ -2935,6 +3776,53 @@ definitions: recipient_count: type: integer type: object + handlers.NullResponseValue: + description: Reserved metadata value. Always null; no object properties are returned. + type: object + handlers.PurgeDueDeletedUsersData: + properties: + batch_limit: + type: integer + deleted_count: + type: integer + type: object + handlers.RawQuestionSetResponse: + properties: + BannerImage: + type: string + CreatedAt: + type: string + Description: + type: string + ID: + type: integer + IntroVideoURL: + type: string + OwnerID: + type: integer + OwnerType: + type: string + PassingScore: + type: integer + Persona: + type: string + SetType: + type: string + ShuffleQuestions: + type: boolean + Status: + type: string + TimeLimitMinutes: + type: integer + Title: + type: string + UpdatedAt: + type: string + UserPersonas: + items: + $ref: '#/definitions/domain.UserPersona' + type: array + type: object handlers.ReferralCodeData: properties: code: @@ -3055,6 +3943,15 @@ definitions: $ref: '#/definitions/handlers.ReferralCommissionItem' type: array type: object + handlers.RefreshFileURLData: + properties: + expires_in: + type: integer + object_key: + type: string + url: + type: string + type: object handlers.RegisterCodeReq: properties: email: @@ -3106,6 +4003,11 @@ definitions: - otp - password type: object + handlers.RevokeTeamInvitationData: + properties: + id: + type: integer + type: object handlers.SearchUserByNameOrPhoneReq: properties: query: @@ -3113,6 +4015,54 @@ definitions: role: $ref: '#/definitions/domain.Role' type: object + handlers.SendBulkEmailData: + properties: + failed: + type: integer + sent: + type: integer + team_member_recipients: + type: integer + total_recipients: + type: integer + user_recipients: + type: integer + type: object + handlers.SendBulkInAppNotificationData: + properties: + failed: + type: integer + sent: + type: integer + team_member_recipients: + type: integer + total_recipients: + type: integer + user_recipients: + type: integer + type: object + handlers.SendBulkPushNotificationData: + properties: + devices_targeted: + type: integer + failed: + type: integer + image: + type: string + sent: + type: integer + target_users: + type: integer + type: object + handlers.SendBulkSMSData: + properties: + failed: + type: integer + sent: + type: integer + total_recipients: + type: integer + type: object handlers.SendSingleAfroSMSReq: properties: message: @@ -3125,6 +4075,30 @@ definitions: - message - recipient type: object + handlers.SendTestPushNotificationData: + properties: + devices_count: + type: integer + image: + type: string + message: + type: string + title: + type: string + type: object + handlers.SubmitAudioAnswerData: + properties: + audio_url: + type: string + created_at: + type: string + id: + type: integer + question_id: + type: integer + question_set_id: + type: integer + type: object handlers.UnregisterDeviceToken.Request: properties: device_token: @@ -3132,6 +4106,30 @@ definitions: required: - device_token type: object + handlers.UpdateQuestionTypeDefinitionData: + properties: + id: + type: integer + type: object + handlers.UploadAudioData: + properties: + content_type: + type: string + object_key: + type: string + url: + type: string + type: object + handlers.UploadProfilePictureData: + properties: + profile_picture_url: + type: string + type: object + handlers.ValidateQuestionTypeDefinitionData: + properties: + valid: + type: boolean + type: object handlers.VimeoEmbedResponse: properties: embed_html: @@ -3141,17 +4139,24 @@ definitions: video_id: type: string type: object - handlers.VimeoUploadResponse: + handlers.VimeoTranscodeStatusData: properties: - link: - type: string status: type: string - upload_link: + video_id: type: string - uri: + type: object + handlers.VimeoUploadResultData: + properties: + Link: type: string - vimeo_id: + Status: + type: string + URI: + type: string + UploadLink: + type: string + VimeoID: type: string type: object handlers.VimeoVideoResponse: @@ -3202,6 +4207,52 @@ definitions: total_pages: type: integer type: object + handlers.activityLogListRes: + properties: + limit: + type: integer + logs: + items: + $ref: '#/definitions/handlers.activityLogRes' + type: array + offset: + type: integer + total_count: + type: integer + type: object + handlers.activityLogRes: + properties: + action: + type: string + actor_email: + type: string + actor_id: + type: integer + actor_kind: + type: string + actor_name: + type: string + actor_role: + type: string + created_at: + type: string + id: + type: integer + ip_address: + type: string + message: + type: string + metadata: + description: Free-form event metadata; keys depend on action and resource_type. + Null when the event has no metadata. + type: object + resource_id: + type: integer + resource_type: + type: string + user_agent: + type: string + type: object handlers.addQuestionToSetReq: properties: associated_question_id: @@ -3240,6 +4291,103 @@ definitions: required: - plan_id type: object + handlers.adminPaymentListItemRes: + properties: + amount: + type: number + created_at: + type: string + currency: + type: string + expires_at: + type: string + id: + type: integer + nonce: + type: string + paid_at: + type: string + payment_method: + type: string + plan_category: + type: string + plan_id: + type: integer + plan_name: + type: string + session_id: + type: string + status: + type: string + subscription_id: + type: integer + transaction_id: + type: string + updated_at: + type: string + user_email: + type: string + user_first_name: + type: string + user_id: + type: integer + user_last_name: + type: string + type: object + handlers.adminPaymentRes: + properties: + amount: + type: number + created_at: + type: string + currency: + type: string + expires_at: + type: string + id: + type: integer + nonce: + type: string + paid_at: + type: string + payment_method: + type: string + payment_url: + type: string + plan_category: + type: string + plan_id: + type: integer + plan_name: + type: string + session_id: + type: string + status: + type: string + subscription_id: + type: integer + transaction_id: + type: string + updated_at: + type: string + user_email: + type: string + user_first_name: + type: string + user_id: + type: integer + user_last_name: + type: string + type: object + handlers.apiIndexResponse: + properties: + admin_api: + example: /api/v1/admin + type: string + client_api: + example: /api/v1 + type: string + type: object handlers.applyReferralReq: properties: code: @@ -3301,6 +4449,17 @@ definitions: object_key: type: string type: object + handlers.componentCatalogRes: + properties: + response_component_kinds: + items: + type: string + type: array + stimulus_component_kinds: + items: + type: string + type: array + type: object handlers.courseListData: properties: courses: @@ -3579,6 +4738,78 @@ definitions: - display_name - key type: object + handlers.documentAdminGetSampleVideoData: + properties: + iframe: + type: string + video: + $ref: '#/definitions/handlers.VimeoVideoResponse' + type: object + handlers.emailTemplateRes: + properties: + body_html: + type: string + body_text: + type: string + created_at: + type: string + id: + type: integer + is_system: + type: boolean + name: + type: string + slug: + type: string + status: + type: string + subject: + type: string + updated_at: + type: string + variables: + items: + type: string + type: array + type: object + handlers.faqRes: + properties: + answer: + type: string + category: + type: string + created_at: + type: string + display_order: + type: integer + id: + type: integer + question: + type: string + status: + type: string + updated_at: + type: string + type: object + handlers.fieldOptionRes: + properties: + code: + type: string + created_at: + type: string + display_order: + type: integer + field_key: + type: string + id: + type: integer + label: + type: string + status: + type: string + updated_at: + type: string + type: object handlers.initiateChapaDirectPaymentReq: properties: email: @@ -3673,6 +4904,121 @@ definitions: total_count: type: integer type: object + handlers.listAdminPaymentsRes: + properties: + limit: + type: integer + offset: + type: integer + payments: + items: + $ref: '#/definitions/handlers.adminPaymentListItemRes' + type: array + total_count: + type: integer + type: object + handlers.listEmailTemplatesRes: + properties: + templates: + items: + $ref: '#/definitions/handlers.emailTemplateRes' + type: array + total_count: + type: integer + type: object + handlers.listFAQsRes: + properties: + faqs: + items: + $ref: '#/definitions/handlers.faqRes' + type: array + total_count: + type: integer + type: object + handlers.listFieldOptionsRes: + properties: + options: + items: + $ref: '#/definitions/handlers.fieldOptionRes' + type: array + total_count: + type: integer + type: object + handlers.listMobileAppVersionsRes: + properties: + total_count: + type: integer + versions: + items: + $ref: '#/definitions/handlers.mobileAppVersionRes' + type: array + type: object + handlers.listPersonasData: + properties: + limit: + type: integer + offset: + type: integer + personas: + items: + $ref: '#/definitions/domain.LmsPersona' + type: array + total_count: + type: integer + type: object + handlers.listQuestionSetsRes: + properties: + question_sets: + items: + $ref: '#/definitions/handlers.questionSetRes' + type: array + total_count: + type: integer + type: object + handlers.listQuestionTypeDefinitionGroupsData: + properties: + groups: + items: + $ref: '#/definitions/domain.QuestionTypeDefinitionGroup' + type: array + limit: + type: integer + offset: + type: integer + total_count: + type: integer + type: object + handlers.listQuestionTypeDefinitionsData: + properties: + limit: + type: integer + offset: + type: integer + question_type_definitions: + items: + $ref: '#/definitions/domain.QuestionTypeDefinition' + type: array + total_count: + type: integer + type: object + handlers.listQuestionsRes: + properties: + questions: + items: + $ref: '#/definitions/handlers.questionRes' + type: array + total_count: + type: integer + type: object + handlers.listTeamInvitationsRes: + properties: + invitations: + items: + $ref: '#/definitions/handlers.teamInvitationListItem' + type: array + total_count: + type: integer + type: object handlers.loginUserRes: properties: access_token: @@ -3695,6 +5041,31 @@ definitions: required: - refresh_token type: object + handlers.mobileAppVersionRes: + properties: + created_at: + type: string + id: + type: integer + min_supported_version_code: + type: integer + platform: + type: string + release_notes: + type: string + status: + type: string + store_url: + type: string + update_type: + type: string + updated_at: + type: string + version_code: + type: integer + version_name: + type: string + type: object handlers.optionInput: properties: is_correct: @@ -3734,6 +5105,64 @@ definitions: total_count: type: integer type: object + handlers.paymentRes: + properties: + amount: + type: number + created_at: + type: string + currency: + type: string + expires_at: + type: string + id: + type: integer + paid_at: + type: string + payment_method: + type: string + payment_url: + type: string + plan_id: + type: integer + plan_name: + type: string + session_id: + type: string + status: + type: string + subscription_id: + type: integer + user_id: + type: integer + type: object + handlers.planRes: + properties: + category: + type: string + created_at: + type: string + currency: + type: string + description: + type: string + duration_unit: + type: string + duration_value: + type: integer + id: + type: integer + is_active: + type: boolean + is_free: + type: boolean + is_lifetime: + type: boolean + name: + type: string + price: + type: number + type: object handlers.presignedUploadReq: properties: content_type: @@ -3745,6 +5174,23 @@ definitions: media_type: type: string type: object + handlers.presignedUploadRes: + properties: + content_type: + type: string + expires_in: + type: integer + media_type: + type: string + object_key: + type: string + provider: + type: string + reference: + type: string + upload_url: + type: string + type: object handlers.previewEmailTemplateReq: properties: variables: @@ -3935,6 +5381,32 @@ definitions: total_count: type: integer type: object + handlers.ratingRes: + properties: + created_at: + type: string + id: + type: integer + review: + type: string + stars: + type: integer + target_id: + type: integer + target_type: + type: string + updated_at: + type: string + user_id: + type: integer + type: object + handlers.ratingSummaryRes: + properties: + average_stars: + type: number + total_count: + type: integer + type: object handlers.refreshFileURLReq: properties: reference: @@ -3959,6 +5431,22 @@ definitions: plan_id: type: integer type: object + handlers.requestCheckoutLinkRes: + properties: + channel: + type: string + destination_hint: + type: string + type: object + handlers.serviceInfoResponse: + properties: + message: + example: Welcome to Rezina Backend API + type: string + version: + example: 1.0.1 + type: string + type: object handlers.shortAnswerInput: properties: acceptable_answer: @@ -4020,6 +5508,85 @@ definitions: - plan_id - provider type: object + handlers.subscriptionCheckoutRes: + properties: + amount: + type: number + currency: + type: string + expires_at: + type: string + free_enrollment: + type: boolean + payment_id: + type: integer + payment_url: + type: string + session_id: + type: string + subscription: + $ref: '#/definitions/handlers.subscriptionRes' + subscription_id: + type: integer + type: object + handlers.subscriptionRes: + properties: + auto_renew: + type: boolean + category: + type: string + created_at: + type: string + currency: + type: string + duration_unit: + type: string + duration_value: + type: integer + expires_at: + type: string + id: + type: integer + is_lifetime: + type: boolean + payment_method: + type: string + payment_reference: + type: string + plan_id: + type: integer + plan_name: + type: string + price: + type: number + starts_at: + type: string + status: + type: string + user_id: + type: integer + type: object + handlers.teamInvitationListItem: + properties: + created_at: + type: string + email: + type: string + expires_at: + type: string + first_name: + type: string + id: + type: integer + last_name: + type: string + status: + type: string + team_member_id: + type: integer + team_role: + type: string + type: object handlers.teamMemberLoginRes: properties: access_token: @@ -4240,6 +5807,40 @@ definitions: required: - commission_percent type: object + handlers.uploadMediaRes: + properties: + content_type: + type: string + embed_url: + type: string + media_type: + type: string + object_key: + type: string + provider: + type: string + url: + type: string + vimeo_id: + type: string + type: object + handlers.userPersonaRes: + properties: + display_order: + type: integer + first_name: + type: string + id: + type: integer + last_name: + type: string + nick_name: + type: string + profile_picture_url: + type: string + role: + type: string + type: object handlers.validateQuestionTypeDefinitionReq: properties: response_component_kinds: @@ -4263,10 +5864,12 @@ definitions: type: object response.APIResponse: properties: - data: {} message: type: string - metadata: {} + metadata: + description: Optional endpoint-specific metadata; omitted when there is no + metadata. + type: object page: type: integer status: @@ -4332,6 +5935,30 @@ info: title: Rezina API version: 1.0.1 paths: + /: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/handlers.serviceInfoResponse' + summary: Service welcome and version + tags: + - discovery + /api/v1/: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/handlers.apiIndexResponse' + summary: Discover the admin and customer API roots + tags: + - discovery /api/v1/admin/activity-logs: get: description: Returns a filtered, paginated list of activity logs @@ -4380,7 +6007,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.activityLogListRes' + type: object "400": description: Bad Request schema: @@ -4418,7 +6050,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.activityLogRes' + type: object "400": description: Bad Request schema: @@ -4449,6 +6086,10 @@ paths: responses: "200": description: CSV export; filename is supplied in Content-Disposition + headers: + Content-Disposition: + description: attachment; filename=export.csv + type: string schema: type: file "400": @@ -4505,24 +6146,34 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.AdminRes' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + items: + $ref: '#/definitions/handlers.AdminRes' + type: array + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Account audience, status, permission, or subscription does not allow this operation schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Get all Admins @@ -4545,24 +6196,27 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Account audience, status, permission, or subscription does not allow this operation schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Create Admin @@ -4585,24 +6239,32 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.AdminRes' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.AdminRes' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Account audience, status, permission, or subscription does not allow this operation schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Get admin by id @@ -4631,24 +6293,27 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Account audience, status, permission, or subscription does not allow this operation schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Update Admin @@ -4683,7 +6348,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.BulkDeactivateAccountsByRoleResult' + type: object "400": description: Bad Request schema: @@ -4739,7 +6409,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.BulkReactivateAccountsByRoleResult' + type: object "400": description: Bad Request schema: @@ -4850,7 +6525,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listMobileAppVersionsRes' + type: object "400": description: Bad Request schema: @@ -4889,7 +6569,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.mobileAppVersionRes' + type: object "400": description: Bad Request schema: @@ -4926,7 +6611,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -4966,7 +6651,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.mobileAppVersionRes' + type: object "400": description: Bad Request schema: @@ -5014,7 +6704,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.mobileAppVersionRes' + type: object "400": description: Bad Request schema: @@ -5049,7 +6744,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepAssessmentsData' + type: object "400": description: Invalid request schema: @@ -5084,7 +6784,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.LinkExamPrepAssessmentData' + type: object "400": description: Invalid request schema: @@ -5129,7 +6834,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -5174,23 +6879,31 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.LoginAdminRes' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Access denied schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string summary: Login user tags: - auth @@ -5212,23 +6925,31 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.LoginAdminRes' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Access denied schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string summary: Login super-admin tags: - auth @@ -5362,7 +7083,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -5411,7 +7132,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepPracticesByUnitData' + type: object "400": description: Invalid request schema: @@ -5453,7 +7179,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -5598,7 +7329,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -5942,7 +7673,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -5991,7 +7722,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData' + type: object "400": description: Invalid request schema: @@ -6033,7 +7769,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -6070,7 +7811,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -6212,7 +7953,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -6252,7 +7993,7 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -6292,7 +8033,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -6341,7 +8082,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listEmailTemplatesRes' + type: object "400": description: Bad Request schema: @@ -6381,7 +8127,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.emailTemplateRes' + type: object "400": description: Bad Request schema: @@ -6419,7 +8170,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.DeleteEmailTemplateData' + type: object "400": description: Bad Request schema: @@ -6460,7 +8216,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.emailTemplateRes' + type: object "400": description: Bad Request schema: @@ -6509,7 +8270,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.emailTemplateRes' + type: object "400": description: Bad Request schema: @@ -6559,7 +8325,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.RenderedEmail' + type: object "400": description: Bad Request schema: @@ -6601,7 +8372,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.emailTemplateRes' + type: object "400": description: Bad Request schema: @@ -6651,7 +8427,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.RenderedEmail' + type: object "400": description: Bad Request schema: @@ -6704,7 +8485,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listFAQsRes' + type: object "400": description: Bad Request schema: @@ -6744,7 +8530,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.faqRes' + type: object "400": description: Bad Request schema: @@ -6782,7 +8573,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.DeleteFAQData' + type: object "400": description: Bad Request schema: @@ -6823,7 +8619,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.faqRes' + type: object "400": description: Bad Request schema: @@ -6872,7 +8673,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.faqRes' + type: object "400": description: Bad Request schema: @@ -6924,7 +8730,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listFieldOptionsRes' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -6955,7 +8766,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.fieldOptionRes' + type: object "400": description: Invalid request schema: @@ -6988,7 +8804,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -7028,7 +8844,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.fieldOptionRes' + type: object "400": description: Invalid request schema: @@ -7068,7 +8889,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.fieldOptionRes' + type: object "400": description: Invalid request schema: @@ -7103,7 +8929,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.UploadAudioData' + type: object "400": description: Invalid request schema: @@ -7149,7 +8980,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.uploadMediaRes' + type: object "400": description: Invalid request schema: @@ -7199,7 +9035,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.presignedUploadRes' + type: object "400": description: Invalid request schema: @@ -7243,7 +9084,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.RefreshFileURLData' + type: object "400": description: Invalid request schema: @@ -7291,7 +9137,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.uploadMediaRes' + type: object "400": description: Invalid request schema: @@ -7332,7 +9183,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.GetFileURLData' + type: object "400": description: Invalid request schema: @@ -7373,11 +9229,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.PurgeDueDeletedUsersData' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -7388,9 +9250,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Purge due account deletions @@ -7455,7 +9318,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -7543,7 +9406,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -7634,7 +9497,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -7783,7 +9646,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepPracticesByLessonData' + type: object "400": description: Invalid request schema: @@ -7866,7 +9734,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -7904,7 +9772,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.GetUserNotificationResponse' "400": description: Invalid request schema: @@ -7942,7 +9810,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -7984,7 +9852,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.Notification' + type: object "400": description: Bad Request schema: @@ -8025,7 +9898,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.Notification' + type: object "400": description: Invalid request schema: @@ -8063,7 +9941,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.Notification' + type: object "400": description: Invalid request schema: @@ -8129,7 +10012,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.GetAllNotificationsResponse' "400": description: Invalid request schema: @@ -8216,11 +10099,21 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.SendBulkEmailData' + type: object "201": description: Scheduled notification created when scheduled_at is provided schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ScheduledNotification' + type: object "400": description: Bad Request schema: @@ -8288,11 +10181,21 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.SendBulkInAppNotificationData' + type: object "201": description: Scheduled notification created when scheduled_at is provided schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ScheduledNotification' + type: object "400": description: Bad Request schema: @@ -8350,11 +10253,21 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.SendBulkPushNotificationData' + type: object "201": description: Scheduled notification created when scheduled_at is provided schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ScheduledNotification' + type: object "400": description: Bad Request schema: @@ -8412,11 +10325,21 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.SendBulkSMSData' + type: object "201": description: Scheduled notification created when scheduled_at is provided schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ScheduledNotification' + type: object "400": description: Bad Request schema: @@ -8498,7 +10421,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.DeleteInAppNotificationsData' + type: object "400": description: Bad Request schema: @@ -8529,7 +10457,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -8556,7 +10484,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -8612,7 +10540,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.ListScheduledNotificationsResponse' "400": description: Bad Request schema: @@ -8650,7 +10578,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ScheduledNotification' + type: object "400": description: Bad Request schema: @@ -8688,7 +10621,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ScheduledNotification' + type: object "400": description: Bad Request schema: @@ -8753,7 +10691,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -8800,7 +10738,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.SendTestPushNotificationData' + type: object "400": description: Bad Request schema: @@ -8831,7 +10774,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.CountUnreadNotificationsResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -8932,7 +10875,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listAdminPaymentsRes' + type: object "400": description: Bad Request schema: @@ -8981,7 +10929,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.adminPaymentRes' + type: object "400": description: Invalid request schema: @@ -9016,6 +10969,10 @@ paths: responses: "200": description: CSV export; filename is supplied in Content-Disposition + headers: + Content-Disposition: + description: attachment; filename=export.csv + type: string schema: type: file "400": @@ -9058,7 +11015,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listPersonasData' + type: object "400": description: Invalid request schema: @@ -9097,7 +11059,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.LmsPersona' + type: object "400": description: Invalid request schema: @@ -9134,7 +11101,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -9170,7 +11137,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.LmsPersona' + type: object "400": description: Invalid request schema: @@ -9216,7 +11188,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.LmsPersona' + type: object "400": description: Invalid request schema: @@ -9265,7 +11242,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListAllExamPrepPracticesData' + type: object "400": description: Invalid request schema: @@ -9302,7 +11284,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -9339,7 +11326,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -9379,7 +11366,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -9425,7 +11417,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -9468,7 +11465,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.quizFullData' + type: object "400": description: Bad Request schema: @@ -9518,7 +11520,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.quizFullData' + type: object "400": description: Bad Request schema: @@ -9565,7 +11572,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -9616,7 +11628,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -9668,7 +11685,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listQuestionSetsRes' + type: object "400": description: Bad Request schema: @@ -9709,7 +11731,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.questionSetRes' + type: object "400": description: Bad Request schema: @@ -9747,7 +11774,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -9784,7 +11811,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.questionSetRes' + type: object "400": description: Bad Request schema: @@ -9829,7 +11861,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -9871,7 +11903,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.userPersonaRes' + type: array + type: object "400": description: Bad Request schema: @@ -9916,7 +11955,7 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -9959,7 +11998,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -9999,7 +12038,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.QuestionSetQuestionTypesSummary' + type: object "400": description: Bad Request schema: @@ -10100,7 +12144,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.AddQuestionToSetData' + type: object "400": description: Bad Request schema: @@ -10143,7 +12192,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -10194,7 +12243,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -10237,7 +12286,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.questionSetRes' + type: array + type: object "400": description: Bad Request schema: @@ -10292,7 +12348,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listQuestionsRes' + type: object "400": description: Bad Request schema: @@ -10334,7 +12395,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.questionRes' + type: object "400": description: Bad Request schema: @@ -10372,7 +12438,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -10409,7 +12475,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.questionRes' + type: object "400": description: Bad Request schema: @@ -10459,7 +12530,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -10496,7 +12567,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.componentCatalogRes' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -10536,7 +12612,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listQuestionsRes' + type: object "400": description: Bad Request schema: @@ -10582,7 +12663,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listQuestionTypeDefinitionGroupsData' + type: object "400": description: Invalid request schema: @@ -10621,7 +12707,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.QuestionTypeDefinitionGroup' + type: object "400": description: Invalid request schema: @@ -10654,7 +12745,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.DeleteQuestionTypeDefinitionGroupData' + type: object "400": description: Invalid request schema: @@ -10690,7 +12786,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.QuestionTypeDefinitionGroupDetail' + type: object "400": description: Invalid request schema: @@ -10738,7 +12839,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.QuestionTypeDefinitionGroup' + type: object "400": description: Invalid request schema: @@ -10789,7 +12895,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listQuestionTypeDefinitionsData' + type: object "400": description: Bad Request schema: @@ -10834,7 +12945,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.QuestionTypeDefinition' + type: object "400": description: Bad Request schema: @@ -10875,7 +12991,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.DeleteQuestionTypeDefinitionData' + type: object "400": description: Bad Request schema: @@ -10911,7 +13032,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.QuestionTypeDefinition' + type: object "400": description: Bad Request schema: @@ -10957,7 +13083,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.UpdateQuestionTypeDefinitionData' + type: object "400": description: Bad Request schema: @@ -11011,7 +13142,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.PracticesByQuestionTypeDefinitionSummary' + type: object "400": description: Bad Request schema: @@ -11057,7 +13193,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ValidateQuestionTypeDefinitionData' + type: object "400": description: Bad Request schema: @@ -11092,7 +13233,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -11348,7 +13489,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.ratingRes' + type: array + type: object "400": description: Bad Request schema: @@ -11386,7 +13534,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -11429,7 +13577,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ratingSummaryRes' + type: object "400": description: Bad Request schema: @@ -11537,7 +13690,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -11584,7 +13737,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListRolesData' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -11665,7 +13823,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -11758,7 +13916,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -11850,7 +14008,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -11975,11 +14133,16 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.SendSingleAfroSMSReq' + type: object "400": description: Bad Request schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -11992,7 +14155,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] summary: Send single SMS via AfroMessage @@ -12006,7 +14169,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/domain.SettingListRes' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -12041,7 +14209,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/domain.SettingListRes' + type: object "400": description: Invalid request schema: @@ -12078,7 +14251,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/domain.SettingRes' + type: object "400": description: Invalid request schema: @@ -12115,7 +14293,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.planRes' + type: array + type: object "400": description: Bad Request schema: @@ -12155,7 +14340,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.planRes' + type: object "400": description: Bad Request schema: @@ -12197,7 +14387,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -12242,7 +14432,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.planRes' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -12283,7 +14478,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -12330,7 +14525,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.subscriptionRes' + type: object "400": description: Bad Request schema: @@ -12365,6 +14565,10 @@ paths: responses: "200": description: CSV export; filename is supplied in Content-Disposition + headers: + Content-Disposition: + description: attachment; filename=export.csv + type: string schema: type: file "400": @@ -12407,7 +14611,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listTeamInvitationsRes' + type: object "400": description: Invalid request schema: @@ -12442,7 +14651,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.RevokeTeamInvitationData' + type: object "400": description: Invalid request schema: @@ -12480,7 +14694,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.TeamMemberResponse' + type: object "400": description: Invalid request schema: @@ -12503,7 +14722,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.VerifyTeamInvitationRes' + type: object "400": description: Invalid request schema: @@ -12771,7 +14995,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -12867,7 +15091,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -12916,7 +15140,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -12958,7 +15182,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.InviteTeamMemberRes' + type: object "400": description: Bad Request schema: @@ -13004,7 +15233,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -13038,6 +15267,10 @@ paths: responses: "200": description: CSV export; filename is supplied in Content-Disposition + headers: + Content-Disposition: + description: attachment; filename=export.csv + type: string schema: type: file "401": @@ -13077,7 +15310,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.InviteTeamMemberRes' + type: object "400": description: Bad Request schema: @@ -13163,7 +15401,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -13198,7 +15436,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -13269,7 +15507,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.TeamVerifyPasswordResetRes' + type: object summary: Verify team password reset link tags: - team @@ -13295,11 +15538,16 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.UploadProfilePictureData' + type: object "400": description: Bad Request schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -13312,7 +15560,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] summary: Upload profile picture @@ -13329,11 +15577,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.AdminProfileRes' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/domain.UserProfileResponse' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -13344,9 +15598,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Get user profile @@ -13369,11 +15624,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -13384,9 +15640,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Delete user by ID @@ -13410,11 +15667,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.UserProfileResponse' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + items: + $ref: '#/definitions/domain.UserProfileResponse' + type: array + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -13425,9 +15690,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Search for user using name or phone @@ -13450,24 +15716,32 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.UserProfileResponse' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/domain.UserProfileResponse' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Account audience, status, permission, or subscription does not allow this operation schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Get user by id @@ -13491,11 +15765,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -13506,9 +15781,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Update user status @@ -13569,11 +15845,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.GetAllUsersData' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -13584,9 +15866,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Get all users @@ -13674,7 +15957,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.UserRecentActivityFeed' + type: object "400": description: Bad Request schema: @@ -13776,11 +16064,21 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.subscriptionRes' + type: object "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.subscriptionRes' + type: object "400": description: Bad Request schema: @@ -13860,11 +16158,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.ListAccountDeletionRequestsData' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -13875,9 +16179,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: List account deletion requests @@ -13891,6 +16196,10 @@ paths: responses: "200": description: CSV export; filename is supplied in Content-Disposition + headers: + Content-Disposition: + description: attachment; filename=export.csv + type: string schema: type: file "400": @@ -13971,7 +16280,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/vimeo.OEmbedResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/vimeo.OEmbedResponse' + type: object "400": description: Bad Request schema: @@ -14022,7 +16336,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.documentAdminGetSampleVideoData' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -14059,7 +16378,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/handlers.VimeoUploadResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.VimeoUploadResultData' + type: object "400": description: Bad Request schema: @@ -14104,7 +16428,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/handlers.VimeoUploadResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.VimeoUploadResultData' + type: object "400": description: Bad Request schema: @@ -14224,7 +16553,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -14267,7 +16596,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.VimeoVideoResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.VimeoVideoResponse' + type: object "400": description: Bad Request schema: @@ -14337,7 +16671,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.VimeoEmbedResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.VimeoEmbedResponse' + type: object "400": description: Bad Request schema: @@ -14381,9 +16720,12 @@ paths: "200": description: OK schema: - additionalProperties: - type: string - type: object + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.VimeoTranscodeStatusData' + type: object "400": description: Bad Request schema: @@ -14452,7 +16794,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.MobileAppVersionCheckResult' + type: object "400": description: Bad Request schema: @@ -14472,7 +16819,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepAssessmentsData' + type: object "400": description: Invalid request schema: @@ -14510,7 +16862,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": description: Invalid request schema: @@ -14548,15 +16905,20 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.loginUserRes' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": description: Bad Request schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "403": description: Access denied schema: @@ -14564,7 +16926,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' summary: Login user tags: - auth @@ -14583,7 +16945,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": description: Invalid request schema: @@ -14612,7 +16979,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": description: Invalid request schema: @@ -14635,6 +17007,10 @@ paths: responses: "302": description: Redirect to Google authorization URL; see Location header + headers: + Location: + description: Google authorization URL + type: string schema: type: string "503": @@ -14662,24 +17038,27 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Account audience, status, permission, or subscription does not allow this operation schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Logout user @@ -14703,23 +17082,31 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.loginUserRes' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": description: Access denied schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string summary: Refresh token tags: - auth @@ -14882,7 +17269,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepPracticesByUnitData' + type: object "400": description: Invalid request schema: @@ -15125,7 +17517,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData' + type: object "400": description: Invalid request schema: @@ -15211,7 +17608,7 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -15251,7 +17648,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -15296,7 +17693,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listFAQsRes' + type: object "400": description: Bad Request schema: @@ -15323,7 +17725,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.faqRes' + type: object "400": description: Bad Request schema: @@ -15354,7 +17761,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ProfileFieldOptionsGrouped' + type: object summary: List field options for client dropdowns tags: - field-options @@ -15373,7 +17785,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListFieldKeysData' + type: object summary: List distinct field keys tags: - field-options @@ -15393,7 +17810,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.UploadAudioData' + type: object "400": description: Invalid request schema: @@ -15439,7 +17861,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.uploadMediaRes' + type: object "400": description: Invalid request schema: @@ -15489,7 +17916,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.presignedUploadRes' + type: object "400": description: Invalid request schema: @@ -15533,7 +17965,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.RefreshFileURLData' + type: object "400": description: Invalid request schema: @@ -15581,7 +18018,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.uploadMediaRes' + type: object "400": description: Invalid request schema: @@ -15622,7 +18064,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.GetFileURLData' + type: object "400": description: Invalid request schema: @@ -15808,7 +18255,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListExamPrepPracticesByLessonData' + type: object "400": description: Invalid request schema: @@ -15839,7 +18291,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -15877,7 +18329,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.GetUserNotificationResponse' "400": description: Invalid request schema: @@ -15915,7 +18367,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -15957,7 +18409,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.Notification' + type: object "400": description: Bad Request schema: @@ -15998,7 +18455,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.Notification' + type: object "400": description: Invalid request schema: @@ -16036,7 +18498,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.Notification' + type: object "400": description: Invalid request schema: @@ -16078,7 +18545,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.DeleteInAppNotificationsData' + type: object "400": description: Bad Request schema: @@ -16109,7 +18581,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -16136,7 +18608,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -16163,7 +18635,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.CountUnreadNotificationsResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -16202,7 +18674,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.paymentRes' + type: array + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -16236,7 +18715,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.paymentRes' + type: object "400": description: Invalid request schema: @@ -16274,7 +18758,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -16354,7 +18838,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -16385,7 +18869,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.InitiateChapaDirectChargeResponse' + type: object "400": description: Bad Request schema: @@ -16427,7 +18916,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.AuthorizeChapaDirectChargeResponse' + type: object "400": description: Bad Request schema: @@ -16460,7 +18954,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/domain.ChapaDirectChargeMethod' + type: array + type: object summary: Get Chapa direct charge payment methods tags: - payments @@ -16517,7 +19018,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.InitiateDirectPaymentResponse' + type: object "400": description: Bad Request schema: @@ -16549,7 +19055,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/domain.ARIFPAYPaymentMethod' + type: array + type: object summary: Get direct payment methods tags: - payments @@ -16572,7 +19085,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.VerifyOTPResponse' + type: object "400": description: Bad Request schema: @@ -16604,7 +19122,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/domain.ChapaPaymentMethod' + type: array + type: object summary: Get Chapa payment methods tags: - payments @@ -16626,7 +19151,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.InitiateSubscriptionPaymentResponse' + type: object "400": description: Bad Request schema: @@ -16664,7 +19194,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.paymentRes' + type: object "400": description: Bad Request schema: @@ -16715,7 +19250,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -16753,7 +19288,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.listPersonasData' + type: object "400": description: Invalid request schema: @@ -16790,7 +19330,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.LmsPersona' + type: object "400": description: Invalid request schema: @@ -16839,7 +19384,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ListAllExamPrepPracticesData' + type: object "400": description: Invalid request schema: @@ -16876,7 +19426,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepPractice' + type: object "400": description: Invalid request schema: @@ -16933,7 +19488,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.paginatedQuestionSetItemsRes' + type: object "400": description: Bad Request schema: @@ -16970,7 +19530,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/domain.ExamPrepProgressSummary' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -17020,7 +19585,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -17070,7 +19635,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -17122,7 +19687,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.SubmitAudioAnswerData' + type: object "400": description: Invalid request schema: @@ -17285,7 +19855,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.ratingRes' + type: array + type: object "400": description: Bad Request schema: @@ -17325,7 +19902,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ratingRes' + type: object "400": description: Bad Request schema: @@ -17363,7 +19945,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -17406,7 +19988,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ratingRes' + type: object "400": description: Bad Request schema: @@ -17442,7 +20029,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.ratingRes' + type: array + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -17481,7 +20075,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.ratingSummaryRes' + type: object "400": description: Bad Request schema: @@ -17577,7 +20176,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request or ineligible referral schema: @@ -17777,7 +20376,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.planRes' + type: array + type: object "400": description: Bad Request schema: @@ -17804,7 +20410,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.planRes' + type: object "400": description: Invalid request schema: @@ -17836,7 +20447,12 @@ paths: "201": description: Created schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.subscriptionRes' + type: object "400": description: Bad Request schema: @@ -17882,7 +20498,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -17924,7 +20540,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Invalid request schema: @@ -17970,7 +20586,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.subscriptionCheckoutRes' + type: object "400": description: Bad Request schema: @@ -18021,7 +20642,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.subscriptionRes' + type: array + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -18050,7 +20678,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + items: + $ref: '#/definitions/handlers.subscriptionRes' + type: array + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -18088,7 +20723,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.requestCheckoutLinkRes' + type: object "400": description: Bad Request schema: @@ -18132,7 +20772,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.CheckSubscriptionStatusData' + type: object "401": description: Missing, invalid, or expired Bearer token schema: @@ -18169,7 +20814,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -18218,11 +20863,16 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.UploadProfilePictureData' + type: object "400": description: Bad Request schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "401": description: Missing, invalid, or expired Bearer token schema: @@ -18235,7 +20885,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' security: - Bearer: [] summary: Upload profile picture @@ -18259,7 +20909,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.CheckProfileCompletedData' + type: object "400": description: Bad Request schema: @@ -18303,7 +20958,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.CheckUserPendingData' + type: object "400": description: Bad Request schema: @@ -18337,15 +20997,22 @@ paths: "200": description: OK schema: - $ref: '#/definitions/handlers.CheckPhoneEmailExistRes' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.CheckPhoneEmailExistRes' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string summary: Check if phone number or email exist tags: - user @@ -18367,7 +21034,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: @@ -18403,19 +21070,27 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/handlers.DeleteMyUserAccountData' + type: object "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": - description: Forbidden + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Request deletion of my account @@ -18430,19 +21105,22 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "401": - description: Unauthorized + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "403": - description: Forbidden + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Cancel my account deletion request @@ -18469,15 +21147,15 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' summary: Register user tags: - user @@ -18499,15 +21177,15 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageResponse' "400": description: Bad Request schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' summary: Resend OTP tags: - otp @@ -18529,15 +21207,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string summary: Reset password tags: - user @@ -18559,15 +21239,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string summary: Send register code tags: - user @@ -18590,15 +21272,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/handlers.MessageAPIResponse' "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string summary: Send reset code tags: - user @@ -18613,11 +21297,17 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.UserProfileResponse' + allOf: + - $ref: '#/definitions/response.APIResponse' + - properties: + data: + $ref: '#/definitions/domain.UserProfileResponse' + type: object "400": - description: Bad Request + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string "401": description: Missing, invalid, or expired Bearer token schema: @@ -18628,9 +21318,10 @@ paths: schema: type: string "500": - description: Internal Server Error + description: Plain-text error returned by the handler or authentication + middleware schema: - $ref: '#/definitions/response.APIResponse' + type: string security: - Bearer: [] summary: Get user profile @@ -18654,15 +21345,20 @@ paths: "200": description: OK schema: - $ref: '#/definitions/response.APIResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.loginUserRes' + type: object "400": description: Bad Request schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' "500": description: Internal Server Error schema: - $ref: '#/definitions/response.APIResponse' + $ref: '#/definitions/domain.ErrorResponse' summary: Verify OTP tags: - user @@ -18743,7 +21439,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/vimeo.OEmbedResponse' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/vimeo.OEmbedResponse' + type: object "400": description: Bad Request schema: @@ -18787,7 +21488,12 @@ paths: "200": description: OK schema: - $ref: '#/definitions/domain.Response' + allOf: + - $ref: '#/definitions/domain.Response' + - properties: + data: + $ref: '#/definitions/handlers.GetSampleVideoData' + type: object "500": description: Internal Server Error schema: diff --git a/internal/domain/arifpay.go b/internal/domain/arifpay.go index eba277e1..eb076cf3 100644 --- a/internal/domain/arifpay.go +++ b/internal/domain/arifpay.go @@ -72,8 +72,8 @@ type ArifpayVerifyByTransactionIDRequest struct { } type ARIFPAYPaymentMethod struct { - ID int - Name string + ID int `json:"ID"` + Name string `json:"Name"` } // Direct Payment Types diff --git a/internal/domain/common.go b/internal/domain/common.go index b428847a..0c0b9ec6 100644 --- a/internal/domain/common.go +++ b/internal/domain/common.go @@ -13,10 +13,11 @@ type ResponseWDataFactory[T any] struct { type Response struct { Message string `json:"message"` - Data interface{} `json:"data,omitempty"` + Data interface{} `json:"data,omitempty" swaggerignore:"true"` Success bool `json:"success"` StatusCode int `json:"status_code"` - MetaData interface{} `json:"metadata"` + // Optional endpoint-specific metadata; null unless the operation documents a concrete metadata schema. + MetaData interface{} `json:"metadata" swaggertype:"object" extensions:"x-nullable"` } func NewResponse(message string, data interface{}) Response { diff --git a/internal/domain/notification.go b/internal/domain/notification.go index e8bd9bf6..7c5f962b 100644 --- a/internal/domain/notification.go +++ b/internal/domain/notification.go @@ -91,7 +91,8 @@ type Notification struct { Timestamp time.Time `json:"timestamp"` Expires time.Time `json:"expires"` Image string `json:"image"` - Metadata json.RawMessage `json:"metadata,omitempty"` + // Free-form notification metadata supplied by the sending application. Keys are application-defined. + Metadata json.RawMessage `json:"metadata,omitempty" swaggertype:"object"` } type CreateNotification struct { RecipientID int64 `json:"recipient_id"` @@ -107,7 +108,8 @@ type CreateNotification struct { Priority int `json:"priority,omitempty"` Expires time.Time `json:"expires"` Image string `json:"image,omitempty"` - Metadata json.RawMessage `json:"metadata,omitempty"` + // Free-form notification metadata supplied by the sending application. Keys are application-defined. + Metadata json.RawMessage `json:"metadata,omitempty" swaggertype:"object"` } type NotificationFilter struct { diff --git a/internal/domain/question_type_builder.go b/internal/domain/question_type_builder.go index 7a46c753..b425662e 100644 --- a/internal/domain/question_type_builder.go +++ b/internal/domain/question_type_builder.go @@ -10,12 +10,12 @@ import ( type StimulusComponentKind string const ( - StimulusQuestionText StimulusComponentKind = "QUESTION_TEXT" - StimulusPrepTime StimulusComponentKind = "PREP_TIME" - StimulusInstruction StimulusComponentKind = "INSTRUCTION" + StimulusQuestionText StimulusComponentKind = "QUESTION_TEXT" + StimulusPrepTime StimulusComponentKind = "PREP_TIME" + StimulusInstruction StimulusComponentKind = "INSTRUCTION" // StimulusAudioPrompt is the single stimulus-side audio kind (prompts, clips, listening passages). - StimulusAudioPrompt StimulusComponentKind = "AUDIO_PROMPT" - StimulusTextPassage StimulusComponentKind = "TEXT_PASSAGE" + StimulusAudioPrompt StimulusComponentKind = "AUDIO_PROMPT" + StimulusTextPassage StimulusComponentKind = "TEXT_PASSAGE" StimulusImage StimulusComponentKind = "IMAGE" StimulusMatchingInputs StimulusComponentKind = "MATCHING_INPUTS" StimulusSelectMissingWords StimulusComponentKind = "SELECT_MISSING_WORDS" @@ -50,9 +50,10 @@ type DynamicElementDefinition struct { } type DynamicElementInstance struct { - ID string `json:"id"` - Kind string `json:"kind"` - Value interface{} `json:"value,omitempty"` + ID string `json:"id"` + Kind string `json:"kind"` + // Component-specific JSON value selected by kind: string, number, boolean, object, array, or null. Use the component catalog and definition schema to interpret it. + Value interface{} `json:"value,omitempty" extensions:"x-json-types=string|number|boolean|object|array|null"` Meta map[string]interface{} `json:"meta,omitempty"` } diff --git a/internal/domain/question_type_definitions.go b/internal/domain/question_type_definitions.go index b3d293e9..3b149195 100644 --- a/internal/domain/question_type_definitions.go +++ b/internal/domain/question_type_definitions.go @@ -3,19 +3,19 @@ package domain import "time" type QuestionTypeDefinition struct { - ID int64 - Key string - DisplayName string - Description *string - GroupIDs *[]int64 `json:"group_ids"` - StimulusComponentKinds []string - ResponseComponentKinds []string - StimulusSchema []DynamicElementDefinition - ResponseSchema []DynamicElementDefinition - IsSystem bool - Status string - CreatedAt time.Time - UpdatedAt *time.Time + ID int64 `json:"ID"` + Key string `json:"Key"` + DisplayName string `json:"DisplayName"` + Description *string `json:"Description"` + GroupIDs *[]int64 `json:"group_ids"` + StimulusComponentKinds []string `json:"StimulusComponentKinds"` + ResponseComponentKinds []string `json:"ResponseComponentKinds"` + StimulusSchema []DynamicElementDefinition `json:"StimulusSchema"` + ResponseSchema []DynamicElementDefinition `json:"ResponseSchema"` + IsSystem bool `json:"IsSystem"` + Status string `json:"Status"` + CreatedAt time.Time `json:"CreatedAt"` + UpdatedAt *time.Time `json:"UpdatedAt"` } type CreateQuestionTypeDefinitionInput struct { diff --git a/internal/domain/questions.go b/internal/domain/questions.go index da013bc4..33bf73d2 100644 --- a/internal/domain/questions.go +++ b/internal/domain/questions.go @@ -93,22 +93,22 @@ type QuestionShortAnswer struct { } type QuestionSet struct { - ID int64 - Title string - Description *string - SetType string - OwnerType *string - OwnerID *int64 - BannerImage *string - Persona *string - TimeLimitMinutes *int32 - PassingScore *int32 - ShuffleQuestions bool - Status string - IntroVideoURL *string - UserPersonas []UserPersona - CreatedAt time.Time - UpdatedAt *time.Time + ID int64 `json:"ID"` + Title string `json:"Title"` + Description *string `json:"Description"` + SetType string `json:"SetType"` + OwnerType *string `json:"OwnerType"` + OwnerID *int64 `json:"OwnerID"` + BannerImage *string `json:"BannerImage"` + Persona *string `json:"Persona"` + TimeLimitMinutes *int32 `json:"TimeLimitMinutes"` + PassingScore *int32 `json:"PassingScore"` + ShuffleQuestions bool `json:"ShuffleQuestions"` + Status string `json:"Status"` + IntroVideoURL *string `json:"IntroVideoURL"` + UserPersonas []UserPersona `json:"UserPersonas"` + CreatedAt time.Time `json:"CreatedAt"` + UpdatedAt *time.Time `json:"UpdatedAt"` } type QuestionSetItem struct { @@ -205,11 +205,11 @@ type CreateQuestionSetInput struct { // UserPersona represents a user acting as a persona in a practice session type UserPersona struct { - ID int64 - FirstName *string - LastName *string - NickName *string - ProfilePictureURL *string - Role string - DisplayOrder int32 + ID int64 `json:"ID"` + FirstName *string `json:"FirstName"` + LastName *string `json:"LastName"` + NickName *string `json:"NickName"` + ProfilePictureURL *string `json:"ProfilePictureURL"` + Role string `json:"Role"` + DisplayOrder int32 `json:"DisplayOrder"` } diff --git a/internal/domain/scheduled_notification.go b/internal/domain/scheduled_notification.go index 7f572795..c4da351c 100644 --- a/internal/domain/scheduled_notification.go +++ b/internal/domain/scheduled_notification.go @@ -55,17 +55,19 @@ type ScheduledNotification struct { Message string `json:"message"` HTML string `json:"html,omitempty"` - EmailTemplateSlug string `json:"email_template_slug,omitempty"` - EmailTemplateVariables json.RawMessage `json:"email_template_variables,omitempty"` + EmailTemplateSlug string `json:"email_template_slug,omitempty"` + // Free-form template variable object. Keys are defined by the selected email template. + EmailTemplateVariables json.RawMessage `json:"email_template_variables,omitempty" swaggertype:"object"` ScheduledAt time.Time `json:"scheduled_at"` Status ScheduledNotificationStatus `json:"status"` - TargetUserIDs []int64 `json:"target_user_ids,omitempty"` - TargetRole string `json:"target_role,omitempty"` - TargetTeamMemberIDs []int64 `json:"target_team_member_ids,omitempty"` - TargetTeamRole string `json:"target_team_role,omitempty"` - TargetRaw json.RawMessage `json:"target_raw,omitempty"` + TargetUserIDs []int64 `json:"target_user_ids,omitempty"` + TargetRole string `json:"target_role,omitempty"` + TargetTeamMemberIDs []int64 `json:"target_team_member_ids,omitempty"` + TargetTeamRole string `json:"target_team_role,omitempty"` + // Optional extra targets: phones and emails arrays, team_member_ids array, team_role, level, and type strings. + TargetRaw json.RawMessage `json:"target_raw,omitempty" swaggertype:"object"` AttemptCount int32 `json:"attempt_count"` LastError string `json:"last_error,omitempty"` diff --git a/internal/domain/user.go b/internal/domain/user.go index e47ca3cd..ac4a9ec5 100644 --- a/internal/domain/user.go +++ b/internal/domain/user.go @@ -226,17 +226,17 @@ type AccountDeletionRequestFilter struct { } type AccountDeletionRequest struct { - UserID int64 - FirstName string - LastName string - Email string - PhoneNumber string - Role Role - Status UserStatus - DeletionRequestedAt *time.Time - DeletionScheduledAt *time.Time - DeletionCancelledAt *time.Time - DeletionState AccountDeletionState + UserID int64 `json:"UserID"` + FirstName string `json:"FirstName"` + LastName string `json:"LastName"` + Email string `json:"Email"` + PhoneNumber string `json:"PhoneNumber"` + Role Role `json:"Role"` + Status UserStatus `json:"Status"` + DeletionRequestedAt *time.Time `json:"DeletionRequestedAt"` + DeletionScheduledAt *time.Time `json:"DeletionScheduledAt"` + DeletionCancelledAt *time.Time `json:"DeletionCancelledAt"` + DeletionState AccountDeletionState `json:"DeletionState"` } type RegisterUserReq struct { diff --git a/internal/web_server/handlers/activity_logs.go b/internal/web_server/handlers/activity_logs.go index 3f3a432b..9bb00d92 100644 --- a/internal/web_server/handlers/activity_logs.go +++ b/internal/web_server/handlers/activity_logs.go @@ -12,20 +12,21 @@ import ( ) type activityLogRes struct { - ID int64 `json:"id"` - ActorID *int64 `json:"actor_id,omitempty"` - ActorRole *string `json:"actor_role,omitempty"` - ActorName *string `json:"actor_name,omitempty"` - ActorEmail *string `json:"actor_email,omitempty"` - ActorKind *string `json:"actor_kind,omitempty"` - Action string `json:"action"` - ResourceType string `json:"resource_type"` - ResourceID *int64 `json:"resource_id,omitempty"` - Message *string `json:"message,omitempty"` - Metadata json.RawMessage `json:"metadata"` - IPAddress *string `json:"ip_address,omitempty"` - UserAgent *string `json:"user_agent,omitempty"` - CreatedAt time.Time `json:"created_at"` + ID int64 `json:"id"` + ActorID *int64 `json:"actor_id,omitempty"` + ActorRole *string `json:"actor_role,omitempty"` + ActorName *string `json:"actor_name,omitempty"` + ActorEmail *string `json:"actor_email,omitempty"` + ActorKind *string `json:"actor_kind,omitempty"` + Action string `json:"action"` + ResourceType string `json:"resource_type"` + ResourceID *int64 `json:"resource_id,omitempty"` + Message *string `json:"message,omitempty"` + // Free-form event metadata; keys depend on action and resource_type. Null when the event has no metadata. + Metadata json.RawMessage `json:"metadata" swaggertype:"object"` + IPAddress *string `json:"ip_address,omitempty"` + UserAgent *string `json:"user_agent,omitempty"` + CreatedAt time.Time `json:"created_at"` } type activityLogListRes struct { @@ -48,7 +49,7 @@ type activityLogListRes struct { // @Param before query string false "Filter logs before this RFC3339 timestamp" // @Param limit query int false "Limit" default(20) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=activityLogListRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/activity-logs [get] @@ -165,7 +166,7 @@ func (h *Handler) GetActivityLogs(c *fiber.Ctx) error { // @Tags activity-logs // @Produce json // @Param id path int true "Activity Log ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=activityLogRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/activity-logs/{id} [get] diff --git a/internal/web_server/handlers/admin.go b/internal/web_server/handlers/admin.go index 6ba8fb02..5d65e18d 100644 --- a/internal/web_server/handlers/admin.go +++ b/internal/web_server/handlers/admin.go @@ -32,10 +32,10 @@ type CreateAdminReq struct { // @Accept json // @Produce json // @Param manger body CreateAdminReq true "Create admin" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/admins [post] // @Security Bearer // @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" @@ -170,10 +170,10 @@ type AdminRes struct { // @Produce json // @Param page query int false "Page number" // @Param page_size query int false "Page size" -// @Success 200 {object} AdminRes -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=[]AdminRes} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/admins [get] // @Security Bearer // @Param query query string false "Query" @@ -292,10 +292,10 @@ func (h *Handler) GetAllAdmins(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param id path int true "User ID" -// @Success 200 {object} AdminRes -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=AdminRes} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/admins/{id} [get] // @Security Bearer // @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" @@ -348,10 +348,10 @@ type updateAdminReq struct { // @Accept json // @Produce json // @Param admin body updateAdminReq true "Update Admin" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/admins/{id} [put] // @Security Bearer // @Param id path int64 true "Id" @@ -442,7 +442,7 @@ func (h *Handler) bulkAccountsRoleFromPath(c *fiber.Ctx) (roleKey string, ok boo // @Produce json // @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 +// @Success 200 {object} domain.Response{data=domain.BulkDeactivateAccountsByRoleResult} // @Failure 400 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse @@ -567,7 +567,7 @@ func (h *Handler) BulkDeactivateAccountsByRole(c *fiber.Ctx) error { // @Produce json // @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 +// @Success 200 {object} domain.Response{data=domain.BulkReactivateAccountsByRoleResult} // @Failure 400 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/admin_export.go b/internal/web_server/handlers/admin_export.go index 8dd7fa93..2874b492 100644 --- a/internal/web_server/handlers/admin_export.go +++ b/internal/web_server/handlers/admin_export.go @@ -110,6 +110,7 @@ func csvJSON(raw json.RawMessage) string { // @Security Bearer // @Produce text/csv // @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Header 200 {string} Content-Disposition "attachment; filename=export.csv" // @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" @@ -176,6 +177,7 @@ func (h *Handler) ExportAdminPaymentsCSV(c *fiber.Ctx) error { // @Security Bearer // @Produce text/csv // @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Header 200 {string} Content-Disposition "attachment; filename=export.csv" // @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" @@ -260,6 +262,7 @@ func (h *Handler) ExportUsersCSV(c *fiber.Ctx) error { // @Security Bearer // @Produce text/csv // @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Header 200 {string} Content-Disposition "attachment; filename=export.csv" // @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" @@ -318,6 +321,7 @@ func (h *Handler) ExportActivityLogsCSV(c *fiber.Ctx) error { // @Security Bearer // @Produce text/csv // @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Header 200 {string} Content-Disposition "attachment; filename=export.csv" // @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" @@ -385,6 +389,7 @@ func (h *Handler) ExportUserSubscriptionsCSV(c *fiber.Ctx) error { // @Security Bearer // @Produce text/csv // @Success 200 {file} file "CSV export; filename is supplied in Content-Disposition" +// @Header 200 {string} Content-Disposition "attachment; filename=export.csv" // @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" diff --git a/internal/web_server/handlers/admin_subscription_handler.go b/internal/web_server/handlers/admin_subscription_handler.go index b0974cd8..71cb6a38 100644 --- a/internal/web_server/handlers/admin_subscription_handler.go +++ b/internal/web_server/handlers/admin_subscription_handler.go @@ -33,8 +33,8 @@ func (r adminApplySubscriptionReq) recordPaymentOrDefault() bool { // @Produce json // @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 -// @Success 201 {object} domain.Response +// @Success 200 {object} domain.Response{data=subscriptionRes} +// @Success 201 {object} domain.Response{data=subscriptionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -160,7 +160,7 @@ func (h *Handler) AdminExtendOrGrantUserSubscription(c *fiber.Ctx) error { // @Tags subscriptions // @Produce json // @Param id path int true "Subscription ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=subscriptionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/arifpay.go b/internal/web_server/handlers/arifpay.go index fb434534..d8df44a7 100644 --- a/internal/web_server/handlers/arifpay.go +++ b/internal/web_server/handlers/arifpay.go @@ -52,7 +52,7 @@ type paymentRes struct { // @Accept json // @Produce json // @Param body body initiatePaymentReq true "Payment request" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.InitiateSubscriptionPaymentResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/payments/subscribe [post] @@ -112,7 +112,7 @@ func (h *Handler) InitiateSubscriptionPayment(c *fiber.Ctx) error { // @Tags payments // @Produce json // @Param session_id path string true "Session ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=paymentRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/verify/{session_id} [get] @@ -155,7 +155,7 @@ func (h *Handler) VerifyPayment(c *fiber.Ctx) error { // @Produce json // @Param limit query int false "Limit" default(20) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]paymentRes} // @Router /api/v1/payments [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -197,7 +197,7 @@ func (h *Handler) GetMyPayments(c *fiber.Ctx) error { // @Tags payments // @Produce json // @Param id path int true "Payment ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=paymentRes} // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/{id} [get] // @Security Bearer @@ -244,7 +244,7 @@ func (h *Handler) GetPaymentByID(c *fiber.Ctx) error { // @Tags payments // @Produce json // @Param id path int true "Payment ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/payments/{id}/cancel [post] // @Security Bearer @@ -469,7 +469,7 @@ type verifyOTPReq struct { // @Accept json // @Produce json // @Param body body initiateDirectPaymentReq true "Direct payment request" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.InitiateDirectPaymentResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/payments/direct [post] @@ -525,7 +525,7 @@ func (h *Handler) InitiateDirectPayment(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body verifyOTPReq true "OTP verification request" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.VerifyOTPResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/direct/verify-otp [post] @@ -586,7 +586,7 @@ func (h *Handler) VerifyDirectPaymentOTP(c *fiber.Ctx) error { // @Description Returns list of payment methods that support direct payment (OTP-based) // @Tags payments // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]domain.ARIFPAYPaymentMethod} // @Router /api/v1/payments/direct/methods [get] func (h *Handler) GetDirectPaymentMethods(c *fiber.Ctx) error { methods := h.arifpaySvc.GetDirectPaymentMethods() diff --git a/internal/web_server/handlers/auth_handler.go b/internal/web_server/handlers/auth_handler.go index ad3120a8..021ca605 100644 --- a/internal/web_server/handlers/auth_handler.go +++ b/internal/web_server/handlers/auth_handler.go @@ -37,7 +37,7 @@ 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 +// @Success 200 {object} domain.Response{data=loginUserRes} // @Produce json // @Failure 400 {object} domain.ErrorResponse "Invalid request" // @Failure 401 {object} domain.ErrorResponse "Authentication failed" @@ -108,7 +108,7 @@ 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 +// @Success 200 {object} domain.Response{data=loginUserRes} // @Failure 400 {object} domain.ErrorResponse "Invalid request" // @Failure 401 {object} domain.ErrorResponse "Authentication failed" // @Failure 500 {object} domain.ErrorResponse "Internal server error" @@ -184,6 +184,7 @@ func (h *Handler) AppleLogin(c *fiber.Ctx) error { // @Tags auth // @Router /api/v1/auth/google/login [get] // @Success 302 {string} string "Redirect to Google authorization URL; see Location header" +// @Header 302 {string} Location "Google authorization URL" // @Failure 503 {object} domain.ErrorResponse "Google OAuth is not configured" // @Produce plain func (h *Handler) GoogleLogin(c *fiber.Ctx) error { @@ -203,7 +204,7 @@ func (h *Handler) GoogleLogin(c *fiber.Ctx) error { // @Tags auth // @Router /api/v1/auth/google/callback [get] // @Param code query string false "Code" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=loginUserRes} // @Produce json // @Failure 400 {object} domain.ErrorResponse "Invalid request" // @Failure 401 {object} domain.ErrorResponse "Authentication failed" @@ -271,10 +272,10 @@ func (h *Handler) GoogleCallback(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param login body domain.LoginRequest true "Login user" -// @Success 200 {object} loginUserRes -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} domain.Response{data=loginUserRes} +// @Failure 400 {object} domain.ErrorResponse +// @Failure 401 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/auth/customer-login [post] // @Failure 403 {object} domain.ErrorResponse "Access denied" func (h *Handler) LoginUser(c *fiber.Ctx) error { @@ -421,10 +422,10 @@ type LoginAdminRes struct { // @Accept json // @Produce json // @Param login body domain.LoginRequest true "Login admin" -// @Success 200 {object} LoginAdminRes -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=loginUserRes} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/auth/admin-login [post] // @Failure 403 {string} string "Access denied" func (h *Handler) LoginAdmin(c *fiber.Ctx) error { @@ -524,10 +525,10 @@ func (h *Handler) LoginAdmin(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param login body domain.LoginRequest true "Login super-admin" -// @Success 200 {object} LoginAdminRes -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=loginUserRes} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/auth/super-login [post] // @Failure 403 {string} string "Access denied" func (h *Handler) LoginSuper(c *fiber.Ctx) error { @@ -631,10 +632,10 @@ type refreshToken struct { // @Accept json // @Produce json // @Param refresh body refreshToken true "tokens" -// @Success 200 {object} loginUserRes -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} domain.Response{data=loginUserRes} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/auth/refresh [post] // @Failure 403 {string} string "Access denied" func (h *Handler) RefreshToken(c *fiber.Ctx) error { @@ -772,10 +773,10 @@ type logoutReq struct { // @Accept json // @Produce json // @Param logout body logoutReq true "Logout user" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/auth/logout [post] // @Security Bearer // @Failure 403 {string} string "Account audience, status, permission, or subscription does not allow this operation" diff --git a/internal/web_server/handlers/chapa.go b/internal/web_server/handlers/chapa.go index 4246a612..bc3d0390 100644 --- a/internal/web_server/handlers/chapa.go +++ b/internal/web_server/handlers/chapa.go @@ -17,7 +17,7 @@ import ( // @Tags payments // @Accept json // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/payments/webhook [post] // @Accept json @@ -88,7 +88,7 @@ func (h *Handler) logChapaWebhookActivity(c *fiber.Ctx, payload domain.ChapaWebh // @Param trx_ref query string false "Transaction reference" // @Param ref_id query string false "Chapa reference ID" // @Param status query string false "Payment status" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Router /api/v1/payments/chapa/callback [get] // @Param tx_ref query string false "Tx ref" // @Failure 400 {object} domain.ErrorResponse "Invalid request" @@ -181,7 +181,7 @@ func (h *Handler) HandleChapaSuccessPage(c *fiber.Ctx) error { // @Description Returns payment methods available on Chapa checkout // @Tags payments // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]domain.ChapaPaymentMethod} // @Router /api/v1/payments/methods [get] func (h *Handler) GetChapaPaymentMethods(c *fiber.Ctx) error { return c.JSON(domain.Response{ diff --git a/internal/web_server/handlers/chapa_direct.go b/internal/web_server/handlers/chapa_direct.go index 1bb9a7a2..0cebc054 100644 --- a/internal/web_server/handlers/chapa_direct.go +++ b/internal/web_server/handlers/chapa_direct.go @@ -29,7 +29,7 @@ type authorizeChapaDirectPaymentReq struct { // @Accept json // @Produce json // @Param body body initiateChapaDirectPaymentReq true "Chapa direct charge request" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.InitiateChapaDirectChargeResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/payments/chapa/direct [post] @@ -79,7 +79,7 @@ func (h *Handler) InitiateChapaDirectPayment(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body authorizeChapaDirectPaymentReq true "Chapa direct charge authorization request" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.AuthorizeChapaDirectChargeResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/payments/chapa/direct/authorize [post] @@ -142,7 +142,7 @@ func (h *Handler) AuthorizeChapaDirectPayment(c *fiber.Ctx) error { // @Description Returns wallet methods supported by Chapa Direct Charge API (USSD push and OTP flows). // @Tags payments // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]domain.ChapaDirectChargeMethod} // @Router /api/v1/payments/chapa/direct/methods [get] func (h *Handler) GetChapaDirectPaymentMethods(c *fiber.Ctx) error { return c.JSON(domain.Response{ diff --git a/internal/web_server/handlers/chapter_quiz_operations.go b/internal/web_server/handlers/chapter_quiz_operations.go index d8d0945a..a6817be2 100644 --- a/internal/web_server/handlers/chapter_quiz_operations.go +++ b/internal/web_server/handlers/chapter_quiz_operations.go @@ -102,7 +102,7 @@ func (h *Handler) UpdateChapterQuizFull(c *fiber.Ctx) error { // @Security Bearer // @Produce json // @Param id path int true "Quiz shell ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse "Invalid request" // @Failure 401 {object} domain.ErrorResponse "Missing or invalid access token" // @Failure 403 {object} domain.ErrorResponse "Permission, subscription, or sequence access denied" @@ -143,7 +143,7 @@ func (h *Handler) GetChapterQuizQuestions(c *fiber.Ctx) error { // @Param id path int true "Quiz shell ID" // @Accept json // @Param body body domain.CompletePracticeInput false "Optional chapter scope" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse "Invalid request" // @Failure 401 {object} domain.ErrorResponse "Missing or invalid access token" // @Failure 403 {object} domain.ErrorResponse "Permission, subscription, or sequence access denied" diff --git a/internal/web_server/handlers/email_template.go b/internal/web_server/handlers/email_template.go index 1f59f6b3..e6d5d684 100644 --- a/internal/web_server/handlers/email_template.go +++ b/internal/web_server/handlers/email_template.go @@ -87,7 +87,7 @@ func mapEmailTemplateToRes(t domain.EmailTemplate) emailTemplateRes { // @Param query query string false "Search by slug, name, or subject" // @Param limit query int false "Limit (default 20)" // @Param offset query int false "Offset (default 0)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listEmailTemplatesRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates [get] @@ -149,7 +149,7 @@ func (h *Handler) ListEmailTemplatesAdmin(c *fiber.Ctx) error { // @Tags email-templates // @Produce json // @Param id path int true "Email template ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=emailTemplateRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -191,7 +191,7 @@ func (h *Handler) GetEmailTemplateByIDAdmin(c *fiber.Ctx) error { // @Tags email-templates // @Produce json // @Param slug path string true "Email template slug" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=emailTemplateRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -234,7 +234,7 @@ func (h *Handler) GetEmailTemplateBySlugAdmin(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body createEmailTemplateReq true "Create email template payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=emailTemplateRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/email-templates [post] @@ -288,7 +288,7 @@ func (h *Handler) CreateEmailTemplate(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Email template ID" // @Param body body updateEmailTemplateReq true "Update email template payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=emailTemplateRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -347,7 +347,7 @@ func (h *Handler) UpdateEmailTemplate(c *fiber.Ctx) error { // @Tags email-templates // @Produce json // @Param id path int true "Email template ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=DeleteEmailTemplateData} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -392,7 +392,7 @@ func (h *Handler) DeleteEmailTemplate(c *fiber.Ctx) error { // @Produce json // @Param slug path string true "Email template slug" // @Param body body previewEmailTemplateReq true "Preview variables" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.RenderedEmail} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -442,7 +442,7 @@ func (h *Handler) PreviewEmailTemplateBySlug(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Email template ID" // @Param body body previewEmailTemplateReq true "Preview variables" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.RenderedEmail} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/exam_prep_assessment_handler.go b/internal/web_server/handlers/exam_prep_assessment_handler.go index 5e9084bb..4264b897 100644 --- a/internal/web_server/handlers/exam_prep_assessment_handler.go +++ b/internal/web_server/handlers/exam_prep_assessment_handler.go @@ -26,7 +26,7 @@ func assessmentParentFromQuery(c *fiber.Ctx) (domain.ExamPrepAssessmentParent, e // @Router /api/v1/admin/assessments [get] // @Router /api/v1/assessments [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ListExamPrepAssessmentsData} // @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" @@ -50,7 +50,7 @@ func (h *Handler) ListExamPrepAssessments(c *fiber.Ctx) error { // @Security Bearer // @Accept json // @Param body body domain.LinkExamPrepAssessmentInput true "Request payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=LinkExamPrepAssessmentData} // @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" @@ -79,7 +79,7 @@ func (h *Handler) LinkExamPrepAssessment(c *fiber.Ctx) error { // @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 +// @Success 200 {object} MessageResponse // @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" 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 45e66d8f..6b1f30b6 100644 --- a/internal/web_server/handlers/exam_prep_catalog_course_handler.go +++ b/internal/web_server/handlers/exam_prep_catalog_course_handler.go @@ -105,7 +105,7 @@ func (h *Handler) ListExamPrepCatalogCourses(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body domain.ReorderIDsRequest true "ordered_ids: every course id exactly once" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Router /api/v1/admin/courses/reorder [put] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -257,7 +257,7 @@ func (h *Handler) UpdateExamPrepCatalogCourse(c *fiber.Ctx) error { // @Summary Delete course // @Tags learning // @Param id path int true "Course ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Router /api/v1/admin/courses/{id} [delete] // @Security Bearer // @Produce json diff --git a/internal/web_server/handlers/exam_prep_lesson_handler.go b/internal/web_server/handlers/exam_prep_lesson_handler.go index 1be88db5..2483a8c6 100644 --- a/internal/web_server/handlers/exam_prep_lesson_handler.go +++ b/internal/web_server/handlers/exam_prep_lesson_handler.go @@ -149,7 +149,7 @@ func (h *Handler) ListExamPrepLessonsByUnitModule(c *fiber.Ctx) error { // @Param chapterId path int64 true "Chapter id" // @Accept json // @Param body body domain.ReorderIDsRequest true "Request payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" @@ -321,7 +321,7 @@ func (h *Handler) UpdateExamPrepLesson(c *fiber.Ctx) error { // @Router /api/v1/admin/lessons/{id} [delete] // @Security Bearer // @Param id path int64 true "Id" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" diff --git a/internal/web_server/handlers/exam_prep_practice_handler.go b/internal/web_server/handlers/exam_prep_practice_handler.go index 84806e20..0fd5a122 100644 --- a/internal/web_server/handlers/exam_prep_practice_handler.go +++ b/internal/web_server/handlers/exam_prep_practice_handler.go @@ -16,7 +16,7 @@ import ( // @Param body body domain.CreateExamPrepPracticeInput true "Practice" // @Router /api/v1/admin/practices [post] // @Security Bearer -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=domain.ExamPrepPractice} // @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" @@ -64,7 +64,7 @@ func (h *Handler) CreateExamPrepPracticeFromInput(c *fiber.Ctx) error { // @Router /api/v1/admin/practices [get] // @Router /api/v1/practices [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ListAllExamPrepPracticesData} // @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" @@ -147,7 +147,7 @@ func (h *Handler) CreateExamPrepPractice(c *fiber.Ctx) error { // @Router /api/v1/admin/lessons/{lessonId}/practices [get] // @Router /api/v1/lessons/{lessonId}/practices [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ListExamPrepPracticesByLessonData} // @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" @@ -189,7 +189,7 @@ func (h *Handler) ListExamPrepPracticesByLesson(c *fiber.Ctx) error { // @Router /api/v1/admin/practices/{id} [get] // @Router /api/v1/practices/{id} [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ExamPrepPractice} // @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" @@ -238,7 +238,7 @@ func (h *Handler) GetExamPrepPracticeByID(c *fiber.Ctx) error { // @Param body body domain.UpdateExamPrepPracticeInput true "Fields to update" // @Router /api/v1/admin/practices/{id} [put] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ExamPrepPractice} // @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" @@ -298,7 +298,7 @@ func (h *Handler) UpdateExamPrepPractice(c *fiber.Ctx) error { // @Param body body domain.UpdateExamPrepPracticeParentsInput true "Parent links (replaces all; use empty array to detach)" // @Router /api/v1/admin/practices/{id}/parents [put] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ExamPrepPractice} // @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" @@ -362,7 +362,7 @@ func (h *Handler) UpdateExamPrepPracticeParents(c *fiber.Ctx) error { // @Param parentId path int true "Parent entity ID" // @Router /api/v1/admin/practices/{id}/parents/{parentKind}/{parentId} [delete] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ExamPrepPractice} // @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" @@ -424,7 +424,7 @@ func (h *Handler) UnlinkExamPrepPracticeParent(c *fiber.Ctx) error { // @Param id path int true "Exam prep practice ID" // @Router /api/v1/admin/practices/{id} [delete] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" @@ -522,7 +522,7 @@ func (h *Handler) listExamPrepPracticesResponse(c *fiber.Ctx, items []domain.Exa // @Param body body domain.CreateExamPrepPracticeInput true "Practice" // @Router /api/v1/admin/courses/{courseId}/practices [post] // @Security Bearer -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=domain.ExamPrepPractice} // @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" @@ -562,7 +562,7 @@ func (h *Handler) CreateExamPrepPracticeForCatalogCourse(c *fiber.Ctx) error { // @Router /api/v1/admin/courses/{courseId}/practices [get] // @Router /api/v1/courses/{courseId}/practices [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ListExamPrepPracticesByCatalogCourseData} // @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" @@ -598,7 +598,7 @@ func (h *Handler) ListExamPrepPracticesByCatalogCourse(c *fiber.Ctx) error { // @Param body body domain.CreateExamPrepPracticeInput true "Practice" // @Router /api/v1/admin/chapters/{chapterId}/practices [post] // @Security Bearer -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=domain.ExamPrepPractice} // @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" @@ -638,7 +638,7 @@ func (h *Handler) CreateExamPrepPracticeForUnit(c *fiber.Ctx) error { // @Router /api/v1/admin/chapters/{chapterId}/practices [get] // @Router /api/v1/chapters/{chapterId}/practices [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ListExamPrepPracticesByUnitData} // @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" diff --git a/internal/web_server/handlers/exam_prep_unit_handler.go b/internal/web_server/handlers/exam_prep_unit_handler.go index 3291a771..f8bab3ca 100644 --- a/internal/web_server/handlers/exam_prep_unit_handler.go +++ b/internal/web_server/handlers/exam_prep_unit_handler.go @@ -150,7 +150,7 @@ func (h *Handler) ListExamPrepUnitsByCatalogCourse(c *fiber.Ctx) error { // @Param body body domain.ReorderIDsRequest true "ordered_ids: every chapter id in this course, new order" // @Router /api/v1/admin/courses/{courseId}/chapters/reorder [put] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" @@ -321,7 +321,7 @@ func (h *Handler) UpdateExamPrepUnit(c *fiber.Ctx) error { // @Param id path int true "Chapter ID" // @Router /api/v1/admin/chapters/{id} [delete] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" diff --git a/internal/web_server/handlers/faq.go b/internal/web_server/handlers/faq.go index e186c1db..85ee7d07 100644 --- a/internal/web_server/handlers/faq.go +++ b/internal/web_server/handlers/faq.go @@ -69,7 +69,7 @@ func mapFAQToRes(f domain.FAQ) faqRes { // @Param category query string false "Filter by category" // @Param limit query int false "Limit (default 50)" // @Param offset query int false "Offset (default 0)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listFAQsRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/faqs [get] @@ -124,7 +124,7 @@ func (h *Handler) ListPublicFAQs(c *fiber.Ctx) error { // @Tags faqs // @Produce json // @Param id path int true "FAQ ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=faqRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/faqs/{id} [get] @@ -166,7 +166,7 @@ func (h *Handler) GetPublicFAQByID(c *fiber.Ctx) error { // @Param category query string false "Filter by category" // @Param limit query int false "Limit (default 20)" // @Param offset query int false "Offset (default 0)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listFAQsRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/faqs [get] @@ -228,7 +228,7 @@ func (h *Handler) ListFAQsAdmin(c *fiber.Ctx) error { // @Tags faqs // @Produce json // @Param id path int true "FAQ ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=faqRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -271,7 +271,7 @@ func (h *Handler) GetFAQByIDAdmin(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body createFAQReq true "Create FAQ payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=faqRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/faqs [post] @@ -323,7 +323,7 @@ func (h *Handler) CreateFAQ(c *fiber.Ctx) error { // @Produce json // @Param id path int true "FAQ ID" // @Param body body updateFAQReq true "Update FAQ payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=faqRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -381,7 +381,7 @@ func (h *Handler) UpdateFAQ(c *fiber.Ctx) error { // @Tags faqs // @Produce json // @Param id path int true "FAQ ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=DeleteFAQData} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/field_option.go b/internal/web_server/handlers/field_option.go index bea75a8a..fc8084b4 100644 --- a/internal/web_server/handlers/field_option.go +++ b/internal/web_server/handlers/field_option.go @@ -65,7 +65,7 @@ func mapFieldOptionToRes(o domain.ProfileFieldOption) fieldOptionRes { // @Tags field-options // @Produce json // @Param field_key query string false "Filter by field key" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ProfileFieldOptionsGrouped} // @Router /api/v1/field-options [get] func (h *Handler) ListPublicFieldOptions(c *fiber.Ctx) error { var fieldKeyPtr *string @@ -91,7 +91,7 @@ func (h *Handler) ListPublicFieldOptions(c *fiber.Ctx) error { // @Tags field-options // @Produce json // @Param active_only query bool false "If true, only keys with active options" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ListFieldKeysData} // @Router /api/v1/field-options/fields [get] func (h *Handler) ListFieldKeys(c *fiber.Ctx) error { activeOnly := c.Query("active_only", "true") == "true" @@ -117,7 +117,7 @@ func (h *Handler) ListFieldKeys(c *fiber.Ctx) error { // @Param status query string false "ACTIVE or INACTIVE" // @Param limit query int false "Limit" // @Param offset query int false "Offset" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listFieldOptionsRes} // @Router /api/v1/admin/field-options [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -159,7 +159,7 @@ func (h *Handler) ListFieldOptionsAdmin(c *fiber.Ctx) error { // @Tags field-options // @Produce json // @Param id path int true "Option ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=fieldOptionRes} // @Router /api/v1/admin/field-options/{id} [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -191,7 +191,7 @@ func (h *Handler) GetFieldOptionByIDAdmin(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body createFieldOptionReq true "Create option" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=fieldOptionRes} // @Router /api/v1/admin/field-options [post] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -239,7 +239,7 @@ func (h *Handler) CreateFieldOption(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Option ID" // @Param body body updateFieldOptionReq true "Update option" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=fieldOptionRes} // @Router /api/v1/admin/field-options/{id} [put] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -284,7 +284,7 @@ func (h *Handler) UpdateFieldOption(c *fiber.Ctx) error { // @Tags field-options // @Produce json // @Param id path int true "Option ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Router /api/v1/admin/field-options/{id} [delete] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" diff --git a/internal/web_server/handlers/file_handler.go b/internal/web_server/handlers/file_handler.go index 805759dd..92489979 100644 --- a/internal/web_server/handlers/file_handler.go +++ b/internal/web_server/handlers/file_handler.go @@ -74,7 +74,7 @@ func (h *Handler) resolveFileURL(c *fiber.Ctx, storedPath string) string { // @Summary Get presigned URL for a file // @Tags files // @Param key query string true "MinIO object key (e.g. profile_pictures/uuid.jpg)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=GetFileURLData} // @Router /api/v1/admin/files/url [get] // @Router /api/v1/files/url [get] // @Security Bearer @@ -128,7 +128,7 @@ func (h *Handler) extractObjectKeyFromReference(reference string) (string, error // @Accept json // @Produce json // @Param body body refreshFileURLReq true "reference (object key, minio://..., or existing presigned URL)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=RefreshFileURLData} // @Router /api/v1/admin/files/refresh-url [post] // @Router /api/v1/files/refresh-url [post] // @Security Bearer @@ -187,7 +187,7 @@ func (h *Handler) RefreshFileURL(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body presignedUploadReq true "Presigned upload request" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=presignedUploadRes} // @Router /api/v1/admin/files/presign-upload [post] // @Router /api/v1/files/presign-upload [post] // @Security Bearer @@ -284,7 +284,7 @@ func (h *Handler) CreatePresignedUpload(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body completePresignedUploadReq true "Complete upload request" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=uploadMediaRes} // @Router /api/v1/admin/files/complete-upload [post] // @Router /api/v1/files/complete-upload [post] // @Security Bearer @@ -412,7 +412,7 @@ func objectKeyMatchesMediaType(objectKey, mediaType string) bool { // @Accept multipart/form-data // @Param media_type formData string true "Media type: image|audio|video|pdf" // @Param file formData file true "Media file" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=uploadMediaRes} // @Router /api/v1/admin/files/upload [post] // @Router /api/v1/files/upload [post] // @Security Bearer @@ -663,7 +663,7 @@ func normalizeAndValidateMediaContentType(mediaType, contentType, fileName strin // @Tags files // @Accept multipart/form-data // @Param file formData file true "Audio file (mp3, wav, ogg, m4a, aac, webm)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=UploadAudioData} // @Router /api/v1/admin/files/audio [post] // @Router /api/v1/files/audio [post] // @Security Bearer @@ -790,7 +790,7 @@ func (h *Handler) UploadAudio(c *fiber.Ctx) error { // @Param question_id formData int true "Question ID" // @Param question_set_id formData int true "Question Set ID" // @Param file formData file true "Audio recording" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=SubmitAudioAnswerData} // @Router /api/v1/questions/audio-answer [post] // @Security Bearer // @Produce json diff --git a/internal/web_server/handlers/issue_reporting.go b/internal/web_server/handlers/issue_reporting.go index aa4ea895..1bf959dd 100644 --- a/internal/web_server/handlers/issue_reporting.go +++ b/internal/web_server/handlers/issue_reporting.go @@ -323,7 +323,7 @@ func (h *Handler) GetAllIssues(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Issue ID" // @Param body body updateIssueStatusReq true "Status update payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/issues/{id}/status [patch] @@ -393,7 +393,7 @@ func (h *Handler) UpdateIssueStatus(c *fiber.Ctx) error { // @Tags issues // @Produce json // @Param id path int true "Issue ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/issues/{id} [delete] diff --git a/internal/web_server/handlers/lms_persona_handler.go b/internal/web_server/handlers/lms_persona_handler.go index aa34a90a..fd438de7 100644 --- a/internal/web_server/handlers/lms_persona_handler.go +++ b/internal/web_server/handlers/lms_persona_handler.go @@ -23,7 +23,7 @@ type listPersonasData struct { // @Tags personas // @Accept json // @Param body body domain.CreateLmsPersonaInput true "Persona" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=domain.LmsPersona} // @Router /api/v1/admin/personas [post] // @Security Bearer // @Produce json @@ -70,7 +70,7 @@ func (h *Handler) CreatePersona(c *fiber.Ctx) error { // @Router /api/v1/admin/personas [get] // @Router /api/v1/personas [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listPersonasData} // @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" @@ -112,7 +112,7 @@ func (h *Handler) ListPersonas(c *fiber.Ctx) error { // @Router /api/v1/admin/personas/{id} [get] // @Router /api/v1/personas/{id} [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.LmsPersona} // @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" @@ -145,7 +145,7 @@ func (h *Handler) GetPersona(c *fiber.Ctx) error { // @Param body body domain.UpdateLmsPersonaInput true "Fields to update" // @Router /api/v1/admin/personas/{id} [put] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.LmsPersona} // @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" @@ -185,7 +185,7 @@ func (h *Handler) UpdatePersona(c *fiber.Ctx) error { // @Param id path int true "Persona ID" // @Router /api/v1/admin/personas/{id} [delete] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" diff --git a/internal/web_server/handlers/lms_progress_handler.go b/internal/web_server/handlers/lms_progress_handler.go index 6e2256e3..3b032cca 100644 --- a/internal/web_server/handlers/lms_progress_handler.go +++ b/internal/web_server/handlers/lms_progress_handler.go @@ -42,7 +42,7 @@ func (h *Handler) GetMyLMSProgress(c *fiber.Ctx) error { // @Description Returns progress for the course → unit → module → lesson learning hierarchy. // @Tags learning // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ExamPrepProgressSummary} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/progress-summary [get] // @Security Bearer @@ -115,7 +115,7 @@ func (h *Handler) AdminGetUserLMSLearningActivity(c *fiber.Ctx) error { // @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)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.UserRecentActivityFeed} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/mobile_app_version_handler.go b/internal/web_server/handlers/mobile_app_version_handler.go index b4f94106..4b6c579a 100644 --- a/internal/web_server/handlers/mobile_app_version_handler.go +++ b/internal/web_server/handlers/mobile_app_version_handler.go @@ -79,7 +79,7 @@ func mapMobileAppVersionToRes(v domain.MobileAppVersion) mobileAppVersionRes { // @Produce json // @Param platform query string true "Platform: ANDROID or IOS" // @Param version_code query int true "Client build number (Android versionCode / iOS build number)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.MobileAppVersionCheckResult} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/app/version/check [get] @@ -131,7 +131,7 @@ func (h *Handler) CheckMobileAppVersion(c *fiber.Ctx) error { // @Param status query string false "Filter by ACTIVE or INACTIVE" // @Param limit query int false "Limit (default 20)" // @Param offset query int false "Offset (default 0)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listMobileAppVersionsRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/app-versions [get] @@ -196,7 +196,7 @@ func (h *Handler) ListMobileAppVersionsAdmin(c *fiber.Ctx) error { // @Tags app-versions // @Produce json // @Param id path int true "App version ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=mobileAppVersionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -241,7 +241,7 @@ func (h *Handler) GetMobileAppVersionByIDAdmin(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body createMobileAppVersionReq true "App version payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=mobileAppVersionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/app-versions [post] @@ -301,7 +301,7 @@ func (h *Handler) CreateMobileAppVersion(c *fiber.Ctx) error { // @Produce json // @Param id path int true "App version ID" // @Param body body updateMobileAppVersionReq true "App version payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=mobileAppVersionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -367,7 +367,7 @@ func (h *Handler) UpdateMobileAppVersion(c *fiber.Ctx) error { // @Tags app-versions // @Produce json // @Param id path int true "App version ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/notification_handler.go b/internal/web_server/handlers/notification_handler.go index 003dba4f..f47d250b 100644 --- a/internal/web_server/handlers/notification_handler.go +++ b/internal/web_server/handlers/notification_handler.go @@ -151,7 +151,7 @@ func (w *hijackResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { // @Tags notifications // @Produce json // @Param id path int true "Notification ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.Notification} // @Failure 400 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse @@ -226,7 +226,7 @@ func (h *Handler) GetNotificationByID(c *fiber.Ctx) error { // @Router /api/v1/notifications/{id}/read [patch] // @Security Bearer // @Param id path int64 true "Id" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.Notification} // @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" @@ -272,7 +272,7 @@ func (h *Handler) MarkNotificationAsRead(c *fiber.Ctx) error { // @Router /api/v1/admin/notifications/mark-all-read [post] // @Router /api/v1/notifications/mark-all-read [post] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" @@ -315,7 +315,7 @@ func (h *Handler) MarkAllNotificationsAsRead(c *fiber.Ctx) error { // @Router /api/v1/notifications/{id}/unread [patch] // @Security Bearer // @Param id path int64 true "Id" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.Notification} // @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" @@ -361,7 +361,7 @@ func (h *Handler) MarkNotificationAsUnread(c *fiber.Ctx) error { // @Router /api/v1/admin/notifications/mark-all-unread [post] // @Router /api/v1/notifications/mark-all-unread [post] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" @@ -403,7 +403,7 @@ func (h *Handler) MarkAllNotificationsAsUnread(c *fiber.Ctx) error { // @Router /api/v1/admin/notifications [delete] // @Router /api/v1/notifications [delete] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" @@ -445,7 +445,7 @@ func (h *Handler) DeleteUserNotifications(c *fiber.Ctx) error { // @Tags notifications // @Produce json // @Param id path int true "Notification ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -509,7 +509,7 @@ func (h *Handler) DeleteInAppNotification(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body object true "Notification IDs" example({"ids":[1,2,3]}) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=DeleteInAppNotificationsData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/delete-in-app [post] @@ -756,7 +756,7 @@ func (h *Handler) CreateAndSendNotification(c *fiber.Ctx) error { // @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 +// @Success 200 {object} GetUserNotificationResponse // @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" @@ -829,7 +829,7 @@ func (h *Handler) GetUserNotification(c *fiber.Ctx) error { // @Router /api/v1/admin/notifications/unread [get] // @Router /api/v1/notifications/unread [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} CountUnreadNotificationsResponse // @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" @@ -876,7 +876,7 @@ func (h *Handler) CountUnreadNotifications(c *fiber.Ctx) error { // @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 +// @Success 200 {object} GetAllNotificationsResponse // @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" @@ -961,9 +961,9 @@ type SendSingleAfroSMSReq struct { // @Accept json // @Produce json // @Param sendSMS body SendSingleAfroSMSReq true "Send SMS request" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} domain.Response{data=SendSingleAfroSMSReq} +// @Failure 400 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/sendSMS [post] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -1036,7 +1036,7 @@ func (h *Handler) SendSingleAfroSMS(c *fiber.Ctx) error { // @Security Bearer // @Accept json // @Param body body handlers.RegisterDeviceToken.Request true "Device token and platform" -// @Success 201 {object} domain.Response +// @Success 201 {object} MessageResponse // @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" @@ -1118,7 +1118,7 @@ func (h *Handler) RegisterDeviceToken(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body object{title=string,message=string} true "Test notification content" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=SendTestPushNotificationData} // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -1224,14 +1224,14 @@ func (h *Handler) SendTestPushNotification(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body object{title=string,message=string,image=string,user_ids=[]int64,role=string,scheduled_at=string} true "Bulk push content" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=SendBulkPushNotificationData} // @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" +// @Success 201 {object} domain.Response{data=domain.ScheduledNotification} "Scheduled notification created when scheduled_at is provided" func (h *Handler) SendBulkPushNotification(c *fiber.Ctx) error { title := c.FormValue("title") message := c.FormValue("message") @@ -1435,14 +1435,14 @@ func (h *Handler) SendBulkPushNotification(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body object{message=string,user_ids=[]int64,role=string,phone_numbers=[]string,scheduled_at=string} true "Bulk SMS content" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=SendBulkSMSData} // @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" +// @Success 201 {object} domain.Response{data=domain.ScheduledNotification} "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"` @@ -1623,14 +1623,14 @@ func (h *Handler) SendBulkSMS(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body object{title=string,message=string,user_ids=[]int64,role=string,team_member_ids=[]int64,team_role=string,scheduled_at=string,type=string,level=string} true "Bulk in-app content" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=SendBulkInAppNotificationData} // @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" +// @Success 201 {object} domain.Response{data=domain.ScheduledNotification} "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"` @@ -1799,7 +1799,7 @@ func (h *Handler) SendBulkInAppNotification(c *fiber.Ctx) error { // @Tags notifications // @Produce json // @Param id path int true "Scheduled Notification ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ScheduledNotification} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/scheduled/{id} [get] @@ -1842,7 +1842,7 @@ func (h *Handler) GetScheduledNotification(c *fiber.Ctx) error { // @Param before query string false "Filter before date (RFC3339)" // @Param limit query int false "Page size" default(20) // @Param page query int false "Page number" default(1) -// @Success 200 {object} domain.Response +// @Success 200 {object} ListScheduledNotificationsResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/scheduled [get] @@ -1914,7 +1914,7 @@ func (h *Handler) ListScheduledNotifications(c *fiber.Ctx) error { // @Tags notifications // @Produce json // @Param id path int true "Scheduled Notification ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.ScheduledNotification} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/scheduled/{id}/cancel [post] @@ -1980,7 +1980,7 @@ func (h *Handler) parseEmailAttachment(c *fiber.Ctx) []*resend.Attachment { // @Tags notifications // @Accept multipart/form-data // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/send-email [post] @@ -2045,7 +2045,7 @@ func (h *Handler) SendSingleEmail(c *fiber.Ctx) error { // @Tags notifications // @Accept multipart/form-data // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=SendBulkEmailData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/notifications/bulk-email [post] @@ -2064,7 +2064,7 @@ func (h *Handler) SendSingleEmail(c *fiber.Ctx) error { // @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" +// @Success 201 {object} domain.Response{data=domain.ScheduledNotification} "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") @@ -2260,7 +2260,7 @@ func (h *Handler) SendBulkEmail(c *fiber.Ctx) error { // @Security Bearer // @Accept json // @Param body body handlers.UnregisterDeviceToken.Request true "Device token to unregister" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @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" diff --git a/internal/web_server/handlers/payments_admin.go b/internal/web_server/handlers/payments_admin.go index e0876ae1..434e5d8f 100644 --- a/internal/web_server/handlers/payments_admin.go +++ b/internal/web_server/handlers/payments_admin.go @@ -88,7 +88,7 @@ type listAdminPaymentsRes struct { // @Param max_amount query number false "Maximum amount" // @Param limit query int false "Page size" default(20) // @Param offset query int false "Page offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listAdminPaymentsRes} // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/admin/payments [get] // @Security Bearer @@ -134,7 +134,7 @@ func (h *Handler) ListAdminPayments(c *fiber.Ctx) error { // @Tags payments // @Produce json // @Param id path int true "Payment ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=adminPaymentRes} // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/payments/{id} [get] // @Security Bearer diff --git a/internal/web_server/handlers/practice_full_update_handler.go b/internal/web_server/handlers/practice_full_update_handler.go index d522a23e..8888dfd7 100644 --- a/internal/web_server/handlers/practice_full_update_handler.go +++ b/internal/web_server/handlers/practice_full_update_handler.go @@ -236,7 +236,7 @@ func (h *Handler) GetLmsPracticeFull(c *fiber.Ctx) error { // @Tags learning // @Produce json // @Param id path int true "Exam prep practice ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=quizFullData} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/practices/{id}/full [get] @@ -381,7 +381,7 @@ func (h *Handler) UpdateLmsPracticeFull(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Exam prep practice ID" // @Param body body domain.FullUpdatePracticeInput true "Full practice update payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=quizFullData} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/practices/{id}/full [put] diff --git a/internal/web_server/handlers/question_type_builder.go b/internal/web_server/handlers/question_type_builder.go index bba122d9..92c08a49 100644 --- a/internal/web_server/handlers/question_type_builder.go +++ b/internal/web_server/handlers/question_type_builder.go @@ -104,7 +104,7 @@ func parseOptionalGroupIDQuery(c *fiber.Ctx) (*int64, error) { // @Description Valid stimulus and response component kind codes for dynamic question-type definitions // @Tags questions // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=componentCatalogRes} // @Router /api/v1/admin/questions/component-catalog [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -126,7 +126,7 @@ func (h *Handler) GetQuestionTypeComponentCatalog(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body validateQuestionTypeDefinitionReq true "Stimulus and response component kinds" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ValidateQuestionTypeDefinitionData} // @Failure 400 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/validate-question-type-definition [post] // @Security Bearer @@ -161,7 +161,7 @@ func (h *Handler) ValidateQuestionTypeDefinition(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body createQuestionTypeDefinitionReq true "Question type definition payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=domain.QuestionTypeDefinition} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions [post] @@ -229,7 +229,7 @@ func (h *Handler) CreateQuestionTypeDefinition(c *fiber.Ctx) error { // @Param include_system query bool false "Include system seeded definitions" default(true) // @Param limit query int false "Page size (default 20, max 200)" default(20) // @Param offset query int false "Page offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listQuestionTypeDefinitionsData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions [get] @@ -311,7 +311,7 @@ func (h *Handler) ListQuestionTypeDefinitions(c *fiber.Ctx) error { // @Tags questions // @Produce json // @Param id path int true "Question type definition id" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.QuestionTypeDefinition} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id} [get] @@ -349,7 +349,7 @@ func (h *Handler) GetQuestionTypeDefinitionByID(c *fiber.Ctx) error { // @Param id path int true "Question type definition id" // @Param limit query int false "Limit" default(20) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.PracticesByQuestionTypeDefinitionSummary} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id}/practices [get] @@ -400,7 +400,7 @@ func (h *Handler) ListPracticesByQuestionTypeDefinition(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Question type definition id" // @Param body body updateQuestionTypeDefinitionReq true "Update question type definition payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=UpdateQuestionTypeDefinitionData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id} [put] @@ -477,7 +477,7 @@ func (h *Handler) UpdateQuestionTypeDefinition(c *fiber.Ctx) error { // @Tags questions // @Produce json // @Param id path int true "Question type definition id" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=DeleteQuestionTypeDefinitionData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definitions/{id} [delete] @@ -517,7 +517,7 @@ func (h *Handler) DeleteQuestionTypeDefinition(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body createQuestionTypeDefinitionGroupReq true "Group payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=domain.QuestionTypeDefinitionGroup} // @Router /api/v1/admin/questions/type-definition-groups [post] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -569,7 +569,7 @@ func (h *Handler) CreateQuestionTypeDefinitionGroup(c *fiber.Ctx) error { // @Param status query string false "Filter by status (ACTIVE, INACTIVE)" // @Param limit query int false "Page size (default 20, max 200)" default(20) // @Param offset query int false "Page offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listQuestionTypeDefinitionGroupsData} // @Router /api/v1/admin/questions/type-definition-groups [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -627,7 +627,7 @@ func (h *Handler) ListQuestionTypeDefinitionGroups(c *fiber.Ctx) error { // @Tags questions // @Produce json // @Param id path int true "Group id" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.QuestionTypeDefinitionGroupDetail} // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/type-definition-groups/{id} [get] // @Security Bearer @@ -671,7 +671,7 @@ func (h *Handler) GetQuestionTypeDefinitionGroupByID(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Group id" // @Param body body updateQuestionTypeDefinitionGroupReq true "Update group payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.QuestionTypeDefinitionGroup} // @Router /api/v1/admin/questions/type-definition-groups/{id} [put] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -732,7 +732,7 @@ func (h *Handler) UpdateQuestionTypeDefinitionGroup(c *fiber.Ctx) error { // @Tags questions // @Produce json // @Param id path int true "Group id" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=DeleteQuestionTypeDefinitionGroupData} // @Router /api/v1/admin/questions/type-definition-groups/{id} [delete] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" diff --git a/internal/web_server/handlers/questions.go b/internal/web_server/handlers/questions.go index 31042777..77b15d7a 100644 --- a/internal/web_server/handlers/questions.go +++ b/internal/web_server/handlers/questions.go @@ -212,7 +212,7 @@ func activityLogQuestionSummary(questionType string, stored string, payload *dom // @Accept json // @Produce json // @Param body body createQuestionReq true "Create question payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=questionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions [post] @@ -369,7 +369,7 @@ func (h *Handler) CreateQuestion(c *fiber.Ctx) error { // @Tags questions // @Produce json // @Param id path int true "Question ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=questionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/{id} [get] @@ -419,7 +419,7 @@ func (h *Handler) GetQuestionByID(c *fiber.Ctx) error { // @Param status query string false "Status filter (DRAFT, PUBLISHED, INACTIVE)" // @Param limit query int false "Limit" default(10) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listQuestionsRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions [get] @@ -485,7 +485,7 @@ func (h *Handler) ListQuestions(c *fiber.Ctx) error { // @Param q query string true "Search query" // @Param limit query int false "Limit" default(10) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listQuestionsRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/search [get] @@ -561,7 +561,7 @@ type updateQuestionReq struct { // @Produce json // @Param id path int true "Question ID" // @Param body body updateQuestionReq true "Update question payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/{id} [put] @@ -735,7 +735,7 @@ func (h *Handler) UpdateQuestion(c *fiber.Ctx) error { // @Tags questions // @Produce json // @Param id path int true "Question ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/questions/{id} [delete] @@ -858,7 +858,7 @@ func (h *Handler) enforcePracticeSequenceForStudent(c *fiber.Ctx, set domain.Que // @Accept json // @Produce json // @Param body body createQuestionSetReq true "Create question set payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=questionSetRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets [post] @@ -930,7 +930,7 @@ func (h *Handler) CreateQuestionSet(c *fiber.Ctx) error { // @Tags question-sets // @Produce json // @Param id path int true "Question Set ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=questionSetRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{id} [get] @@ -998,7 +998,7 @@ func (h *Handler) GetQuestionSetByID(c *fiber.Ctx) error { // @Param set_type query string true "Set type (PRACTICE, QUIZ, EXAM, SURVEY, CAPSTONE)" // @Param limit query int false "Limit" default(10) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listQuestionSetsRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets [get] @@ -1064,7 +1064,7 @@ func (h *Handler) GetQuestionSetsByType(c *fiber.Ctx) error { // @Produce json // @Param owner_type query string true "Owner type (SUB_COURSE, COURSE, CATEGORY, STANDALONE)" // @Param owner_id query int true "Owner ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]questionSetRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/by-owner [get] @@ -1145,7 +1145,7 @@ type updateQuestionSetReq struct { // @Produce json // @Param id path int true "Question Set ID" // @Param body body updateQuestionSetReq true "Update question set payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{id} [put] @@ -1231,7 +1231,7 @@ func (h *Handler) UpdateQuestionSet(c *fiber.Ctx) error { // @Tags question-sets // @Produce json // @Param id path int true "Question Set ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{id} [delete] @@ -1379,7 +1379,7 @@ func questionSetItemsToRes( // @Produce json // @Param setId path int true "Question Set ID" // @Param body body addQuestionToSetReq true "Add question to set payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=AddQuestionToSetData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/questions [post] @@ -1453,7 +1453,7 @@ func (h *Handler) AddQuestionToSet(c *fiber.Ctx) error { // @Tags question-set-items // @Produce json // @Param setId path int true "Question Set ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.QuestionSetQuestionTypesSummary} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -1676,7 +1676,7 @@ func (h *Handler) GetQuestionsInSet(c *fiber.Ctx) error { // @Param question_type query string false "Question type filter (e.g. AUDIO)" // @Param limit query int false "Limit" default(10) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=paginatedQuestionSetItemsRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -1787,7 +1787,7 @@ func (h *Handler) GetQuestionsByPractice(c *fiber.Ctx) error { // @Tags progression // @Produce json // @Param id path int true "Practice Question Set ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse @@ -1957,7 +1957,7 @@ func (h *Handler) CompletePractice(c *fiber.Ctx) error { // @Produce json // @Param setId path int true "Question Set ID" // @Param questionId path int true "Question ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/questions/{questionId} [delete] @@ -2020,7 +2020,7 @@ type updateQuestionOrderReq struct { // @Param setId path int true "Question Set ID" // @Param questionId path int true "Question ID" // @Param body body updateQuestionOrderReq true "Update order payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/questions/{questionId}/order [put] @@ -2107,7 +2107,7 @@ type addUserPersonaReq struct { // @Tags question-sets // @Produce json // @Param setId path int true "Question Set ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]userPersonaRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/personas [get] @@ -2159,7 +2159,7 @@ func (h *Handler) GetUserPersonasByQuestionSet(c *fiber.Ctx) error { // @Produce json // @Param setId path int true "Question Set ID" // @Param body body addUserPersonaReq true "Add user persona payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/personas [post] @@ -2215,7 +2215,7 @@ func (h *Handler) AddUserPersonaToQuestionSet(c *fiber.Ctx) error { // @Produce json // @Param setId path int true "Question Set ID" // @Param userId path int true "User ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/question-sets/{setId}/personas/{userId} [delete] diff --git a/internal/web_server/handlers/ratings.go b/internal/web_server/handlers/ratings.go index 31a32b1a..9f54eb3d 100644 --- a/internal/web_server/handlers/ratings.go +++ b/internal/web_server/handlers/ratings.go @@ -59,7 +59,7 @@ func isValidTargetType(t string) bool { // @Accept json // @Produce json // @Param body body submitRatingReq true "Submit rating payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=ratingRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/ratings [post] @@ -112,7 +112,7 @@ func (h *Handler) SubmitRating(c *fiber.Ctx) error { // @Produce json // @Param target_type query string true "Target type (app, course, sub_course)" // @Param target_id query int true "Target ID (0 for app)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ratingRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -165,7 +165,7 @@ func (h *Handler) GetMyRating(c *fiber.Ctx) error { // @Param target_id query int true "Target ID (0 for app)" // @Param limit query int false "Limit (default 20)" // @Param offset query int false "Offset (default 0)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]ratingRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/ratings [get] @@ -235,7 +235,7 @@ func (h *Handler) GetRatingsByTarget(c *fiber.Ctx) error { // @Produce json // @Param target_type query string true "Target type (app, course, sub_course)" // @Param target_id query int true "Target ID (0 for app)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ratingSummaryRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/ratings/summary [get] @@ -285,7 +285,7 @@ func (h *Handler) GetRatingSummary(c *fiber.Ctx) error { // @Description Returns all ratings submitted by the current user // @Tags ratings // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]ratingRes} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/ratings/me/all [get] // @Security Bearer @@ -319,7 +319,7 @@ func (h *Handler) GetMyRatings(c *fiber.Ctx) error { // @Tags ratings // @Produce json // @Param id path int true "Rating ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/ratings/{id} [delete] diff --git a/internal/web_server/handlers/rbac_handler.go b/internal/web_server/handlers/rbac_handler.go index e34bba19..863cccdb 100644 --- a/internal/web_server/handlers/rbac_handler.go +++ b/internal/web_server/handlers/rbac_handler.go @@ -22,7 +22,7 @@ import ( // @Param is_system query bool false "Filter by system role (true/false)" // @Param page query int false "Page number (default: 1)" // @Param page_size query int false "Page size (default: 20)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=ListRolesData} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles [get] // @Security Bearer @@ -210,7 +210,7 @@ func (h *Handler) CreateRole(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Role ID" // @Param body body domain.UpdateRoleReq true "Role update payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id} [put] @@ -289,7 +289,7 @@ func (h *Handler) UpdateRole(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param id path int true "Role ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id} [delete] @@ -345,7 +345,7 @@ func (h *Handler) DeleteRole(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Role ID" // @Param body body domain.SetRolePermissionsReq true "Permission IDs payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/roles/{id}/permissions [put] @@ -541,7 +541,7 @@ func (h *Handler) ListPermissionGroups(c *fiber.Ctx) error { // @Tags rbac // @Accept json // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/rbac/permissions/sync [post] // @Security Bearer diff --git a/internal/web_server/handlers/referal_handlers.go b/internal/web_server/handlers/referal_handlers.go index 475f30b6..56c97b5f 100644 --- a/internal/web_server/handlers/referal_handlers.go +++ b/internal/web_server/handlers/referal_handlers.go @@ -117,7 +117,7 @@ func (h *Handler) GetMyReferrals(c *fiber.Ctx) error { // @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 +// @Success 200 {object} MessageResponse // @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" diff --git a/internal/web_server/handlers/response_contracts.go b/internal/web_server/handlers/response_contracts.go new file mode 100644 index 00000000..c25d6c6f --- /dev/null +++ b/internal/web_server/handlers/response_contracts.go @@ -0,0 +1,288 @@ +package handlers + +import ( + domain "Rezina-Backend/internal/domain" + time "time" +) + +// MessageResponse is returned by operations with no data payload. Metadata is +// reserved and currently null; data is omitted by the runtime JSON encoder. +type MessageResponse struct { + Message string `json:"message"` + Success bool `json:"success"` + StatusCode int `json:"status_code"` + // Always null for message-only domain responses. + Metadata *NullResponseValue `json:"metadata" extensions:"x-nullable"` +} + +// NullResponseValue represents a reserved null field (never a populated object). +// @Description Reserved metadata value. Always null; no object properties are returned. +type NullResponseValue struct{} + +// MessageAPIResponse is the alternate envelope used by legacy account operations. +type MessageAPIResponse struct { + Status string `json:"status" enums:"success,error"` + Message string `json:"message"` + Timestamp time.Time `json:"timestamp"` +} + +// Endpoint-specific payloads mirror the JSON fields returned by handlers. + +type DeleteEmailTemplateData struct { + Id int64 `json:"id"` +} + +type RawQuestionSetResponse struct { + BannerImage *string `json:"BannerImage"` + CreatedAt time.Time `json:"CreatedAt"` + Description *string `json:"Description"` + ID int64 `json:"ID"` + IntroVideoURL *string `json:"IntroVideoURL"` + OwnerID *int64 `json:"OwnerID"` + OwnerType *string `json:"OwnerType"` + PassingScore *int32 `json:"PassingScore"` + Persona *string `json:"Persona"` + SetType string `json:"SetType"` + ShuffleQuestions bool `json:"ShuffleQuestions"` + Status string `json:"Status"` + TimeLimitMinutes *int32 `json:"TimeLimitMinutes"` + Title string `json:"Title"` + UpdatedAt *time.Time `json:"UpdatedAt"` + UserPersonas []domain.UserPersona `json:"UserPersonas"` +} + +type ListExamPrepAssessmentsData struct { + Assessments []RawQuestionSetResponse `json:"assessments"` +} + +type LinkExamPrepAssessmentData struct { + Assessment RawQuestionSetResponse `json:"assessment"` + ParentId int64 `json:"parent_id"` + ParentKind string `json:"parent_kind"` +} + +type ListAllExamPrepPracticesData struct { + Limit int `json:"limit"` + Offset int `json:"offset"` + Practices []domain.ExamPrepPractice `json:"practices"` + TotalCount int64 `json:"total_count"` +} + +type ListExamPrepPracticesByLessonData struct { + Limit int `json:"limit"` + Offset int `json:"offset"` + Practices []domain.ExamPrepPractice `json:"practices"` + TotalCount int64 `json:"total_count"` +} + +type ListExamPrepPracticesByCatalogCourseData struct { + Limit int `json:"limit"` + Offset int `json:"offset"` + Practices []domain.ExamPrepPractice `json:"practices"` + TotalCount int64 `json:"total_count"` +} + +type ListExamPrepPracticesByUnitData struct { + Limit int `json:"limit"` + Offset int `json:"offset"` + Practices []domain.ExamPrepPractice `json:"practices"` + TotalCount int64 `json:"total_count"` +} + +type DeleteFAQData struct { + Id int64 `json:"id"` +} + +type ListFieldKeysData struct { + Fields []string `json:"fields"` +} + +type GetFileURLData struct { + Url string `json:"url"` +} + +type RefreshFileURLData struct { + ExpiresIn int `json:"expires_in"` + ObjectKey string `json:"object_key"` + Url string `json:"url"` +} + +type UploadAudioData struct { + ContentType string `json:"content_type"` + ObjectKey string `json:"object_key"` + Url string `json:"url"` +} + +type SubmitAudioAnswerData struct { + AudioUrl string `json:"audio_url"` + CreatedAt time.Time `json:"created_at"` + Id int64 `json:"id"` + QuestionId int64 `json:"question_id"` + QuestionSetId int64 `json:"question_set_id"` +} + +type DeleteInAppNotificationsData struct { + DeletedCount int64 `json:"deleted_count"` + RequestedIds int `json:"requested_ids"` +} + +type GetUserNotificationResponse struct { + Limit int `json:"limit"` + Notifications []domain.Notification `json:"notifications"` + Offset int `json:"offset"` + TotalCount int64 `json:"total_count"` +} + +type CountUnreadNotificationsResponse struct { + Unread int64 `json:"unread"` +} + +type GetAllNotificationsResponse struct { + Limit int `json:"limit"` + Notifications []domain.Notification `json:"notifications"` + Page int `json:"page"` + TotalCount int64 `json:"total_count"` +} + +type SendTestPushNotificationData struct { + DevicesCount int `json:"devices_count"` + Image string `json:"image"` + Message string `json:"message"` + Title string `json:"title"` +} + +type SendBulkPushNotificationData struct { + DevicesTargeted int `json:"devices_targeted"` + Failed int `json:"failed"` + Image string `json:"image"` + Sent int `json:"sent"` + TargetUsers int `json:"target_users"` +} + +type SendBulkSMSData struct { + Failed int `json:"failed"` + Sent int `json:"sent"` + TotalRecipients int `json:"total_recipients"` +} + +type SendBulkInAppNotificationData struct { + Failed int `json:"failed"` + Sent int `json:"sent"` + TeamMemberRecipients int `json:"team_member_recipients"` + TotalRecipients int `json:"total_recipients"` + UserRecipients int `json:"user_recipients"` +} + +type ListScheduledNotificationsResponse struct { + Limit int `json:"limit"` + Page int `json:"page"` + ScheduledNotifications []domain.ScheduledNotification `json:"scheduled_notifications"` + TotalCount int64 `json:"total_count"` +} + +type SendBulkEmailData struct { + Failed int `json:"failed"` + Sent int `json:"sent"` + TeamMemberRecipients int `json:"team_member_recipients"` + TotalRecipients int `json:"total_recipients"` + UserRecipients int `json:"user_recipients"` +} + +type ValidateQuestionTypeDefinitionData struct { + Valid bool `json:"valid"` +} + +type UpdateQuestionTypeDefinitionData struct { + Id int64 `json:"id"` +} + +type DeleteQuestionTypeDefinitionData struct { + Id int64 `json:"id"` +} + +type DeleteQuestionTypeDefinitionGroupData struct { + Id int64 `json:"id"` +} + +type AddQuestionToSetData struct { + AssociatedQuestionId *int64 `json:"associated_question_id"` + DisplayOrder int32 `json:"display_order"` + Id int64 `json:"id"` + QuestionId int64 `json:"question_id"` + SetId int64 `json:"set_id"` +} + +type ListRolesData struct { + Page int64 `json:"page"` + PageSize int64 `json:"page_size"` + Roles []domain.RoleRecord `json:"roles"` + Total int64 `json:"total"` +} + +type CheckSubscriptionStatusData struct { + HasActiveSubscription bool `json:"has_active_subscription"` +} + +type documentAdminGetSampleVideoData struct { + Iframe string `json:"iframe"` + Video VimeoVideoResponse `json:"video"` +} + +type RevokeTeamInvitationData struct { + Id int64 `json:"id"` +} + +type CheckProfileCompletedData struct { + IsProfileCompleted bool `json:"is_profile_completed"` + ProfileCompletionPercentage int `json:"profile_completion_percentage"` +} + +type CheckUserPendingData struct { + IsPending bool `json:"is_pending"` +} + +type GetAllUsersData struct { + Total int64 `json:"total"` + Users []domain.UserProfileResponse `json:"users"` +} + +type ListAccountDeletionRequestsData struct { + Items []domain.AccountDeletionRequest `json:"items"` + Page int64 `json:"page"` + PageSize int64 `json:"page_size"` + Total int64 `json:"total"` +} + +type DeleteMyUserAccountData struct { + CanCancelUntilAt time.Time `json:"can_cancel_until_at"` + GracePeriodDays int `json:"grace_period_days"` + ScheduledPurgeAt time.Time `json:"scheduled_purge_at"` +} + +type PurgeDueDeletedUsersData struct { + BatchLimit int32 `json:"batch_limit"` + DeletedCount int64 `json:"deleted_count"` +} + +type UploadProfilePictureData struct { + ProfilePictureUrl string `json:"profile_picture_url"` +} + +type GetSampleVideoData struct { + Iframe string `json:"iframe"` + Video VimeoVideoResponse `json:"video"` +} + +// VimeoUploadResultData preserves the raw service result's existing JSON names. +type VimeoUploadResultData struct { + VimeoID string `json:"VimeoID"` + URI string `json:"URI"` + Link string `json:"Link"` + UploadLink string `json:"UploadLink"` + Status string `json:"Status"` +} + +type VimeoTranscodeStatusData struct { + VideoID string `json:"video_id"` + Status string `json:"status"` +} diff --git a/internal/web_server/handlers/response_contracts_test.go b/internal/web_server/handlers/response_contracts_test.go new file mode 100644 index 00000000..4ec0efec --- /dev/null +++ b/internal/web_server/handlers/response_contracts_test.go @@ -0,0 +1,49 @@ +package handlers + +import ( + "encoding/json" + "reflect" + "testing" + + "Rezina-Backend/internal/domain" + vimeoservice "Rezina-Backend/internal/services/vimeo" + "Rezina-Backend/internal/web_server/response" +) + +func responseJSONFields(t *testing.T, value any) map[string]any { + t.Helper() + raw, err := json.Marshal(value) + if err != nil { + t.Fatal(err) + } + var fields map[string]any + if err = json.Unmarshal(raw, &fields); err != nil { + t.Fatal(err) + } + return fields +} + +// Documentation-only payloads must preserve existing wire names, including the +// PascalCase fields returned by raw service/domain structs. This prevents a +// documentation improvement from silently advertising a new JSON API contract. +func TestResponseDocumentationMatchesRuntimeJSONFields(t *testing.T) { + for _, tc := range []struct { + name string + runtime, documented any + }{ + {"message domain envelope", domain.Response{}, MessageResponse{}}, + {"message legacy envelope", response.APIResponse{}, MessageAPIResponse{}}, + {"raw assessment question set", domain.QuestionSet{}, RawQuestionSetResponse{}}, + {"raw Vimeo upload result", vimeoservice.UploadResult{}, VimeoUploadResultData{}}, + {"notification count", map[string]int{"unread": 0}, CountUnreadNotificationsResponse{}}, + {"video status", map[string]string{"video_id": "", "status": ""}, VimeoTranscodeStatusData{}}, + } { + t.Run(tc.name, func(t *testing.T) { + runtime := responseJSONFields(t, tc.runtime) + documented := responseJSONFields(t, tc.documented) + if !reflect.DeepEqual(runtime, documented) { + t.Fatalf("runtime JSON=%v; documented JSON=%v", runtime, documented) + } + }) + } +} diff --git a/internal/web_server/handlers/settings_handler.go b/internal/web_server/handlers/settings_handler.go index 4b6b7999..35fb1886 100644 --- a/internal/web_server/handlers/settings_handler.go +++ b/internal/web_server/handlers/settings_handler.go @@ -17,7 +17,7 @@ import ( // @Tags settings // @Router /api/v1/admin/settings [get] // @Security Bearer -// @Success 200 {object} domain.Response +// @Success 200 {object} response.APIResponse{data=domain.SettingListRes} // @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" @@ -46,7 +46,7 @@ func (h *Handler) GetGlobalSettingList(c *fiber.Ctx) error { // @Router /api/v1/admin/settings/{key} [get] // @Security Bearer // @Param key path string true "Key" -// @Success 200 {object} domain.Response +// @Success 200 {object} response.APIResponse{data=domain.SettingRes} // @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" @@ -85,7 +85,7 @@ func (h *Handler) GetGlobalSettingByKey(c *fiber.Ctx) error { // @Security Bearer // @Accept json // @Param body body domain.SaveSettingListReq true "Request payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} response.APIResponse{data=domain.SettingListRes} // @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" diff --git a/internal/web_server/handlers/subscription_checkout_link.go b/internal/web_server/handlers/subscription_checkout_link.go index e7c820ca..e0c9a739 100644 --- a/internal/web_server/handlers/subscription_checkout_link.go +++ b/internal/web_server/handlers/subscription_checkout_link.go @@ -31,7 +31,7 @@ type requestCheckoutLinkRes struct { // @Accept json // @Produce json // @Param body body requestCheckoutLinkReq false "Optional plan or category for deep link" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=requestCheckoutLinkRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 409 {object} domain.ErrorResponse // @Failure 429 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/subscriptions.go b/internal/web_server/handlers/subscriptions.go index cd08631f..a1f99f26 100644 --- a/internal/web_server/handlers/subscriptions.go +++ b/internal/web_server/handlers/subscriptions.go @@ -117,7 +117,7 @@ type autoRenewReq struct { // @Accept json // @Produce json // @Param body body createPlanReq true "Create plan payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=planRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/subscription-plans [post] @@ -207,7 +207,7 @@ func (h *Handler) CreateSubscriptionPlan(c *fiber.Ctx) error { // @Produce json // @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 +// @Success 200 {object} domain.Response{data=[]planRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/subscription-plans [get] @@ -254,7 +254,7 @@ func (h *Handler) ListSubscriptionPlans(c *fiber.Ctx) error { // @Tags subscriptions // @Produce json // @Param id path int true "Plan ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=planRes} // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/subscription-plans/{id} [get] // @Failure 400 {object} domain.ErrorResponse "Invalid request" @@ -291,7 +291,7 @@ func (h *Handler) GetSubscriptionPlan(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Plan ID" // @Param body body updatePlanReq true "Update plan payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/subscription-plans/{id} [put] @@ -398,7 +398,7 @@ func (h *Handler) UpdateSubscriptionPlan(c *fiber.Ctx) error { // @Tags subscriptions // @Produce json // @Param id path int true "Plan ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/subscription-plans/{id} [delete] // @Security Bearer @@ -458,7 +458,7 @@ func (h *Handler) DeleteSubscriptionPlan(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body subscribeReq true "Subscribe payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=subscriptionRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @deprecated Use POST /api/v1/payments/subscribe for user subscriptions with payment @@ -529,7 +529,7 @@ func (h *Handler) Subscribe(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body subscribeWithPaymentReq true "Subscribe with payment payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=subscriptionCheckoutRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 409 {object} domain.ErrorResponse "User already has active subscription" // @Failure 500 {object} domain.ErrorResponse @@ -644,7 +644,7 @@ func (h *Handler) SubscribeWithPayment(c *fiber.Ctx) error { // @Description Returns all active subscriptions for the authenticated user (one per plan category) // @Tags subscriptions // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]subscriptionRes} // @Router /api/v1/subscriptions/me [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -684,7 +684,7 @@ func (h *Handler) GetMySubscription(c *fiber.Ctx) error { // @Produce json // @Param limit query int false "Limit" default(20) // @Param offset query int false "Offset" default(0) -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=[]subscriptionRes} // @Router /api/v1/subscriptions/history [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -725,7 +725,7 @@ func (h *Handler) GetMySubscriptionHistory(c *fiber.Ctx) error { // @Description Returns whether the authenticated user has an active subscription // @Tags subscriptions // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=CheckSubscriptionStatusData} // @Router /api/v1/subscriptions/status [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -761,7 +761,7 @@ func (h *Handler) CheckSubscriptionStatus(c *fiber.Ctx) error { // @Tags subscriptions // @Produce json // @Param id path int true "Subscription ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/subscriptions/{id}/cancel [post] // @Security Bearer @@ -819,7 +819,7 @@ func (h *Handler) CancelSubscription(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Subscription ID" // @Param body body autoRenewReq true "Auto-renew payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/subscriptions/{id}/auto-renew [put] // @Security Bearer diff --git a/internal/web_server/handlers/swagger_admin_shared.go b/internal/web_server/handlers/swagger_admin_shared.go index 2b8336ca..461da9bb 100644 --- a/internal/web_server/handlers/swagger_admin_shared.go +++ b/internal/web_server/handlers/swagger_admin_shared.go @@ -10,7 +10,7 @@ package handlers // @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 +// @Success 200 {object} domain.Response{data=[]planRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -25,7 +25,7 @@ func documentAdminListSubscriptionPlans() {} // @Tags subscriptions // @Produce json // @Param id path int true "Plan ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=planRes} // @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" @@ -42,7 +42,7 @@ func documentAdminGetSubscriptionPlan() {} // @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 +// @Success 200 {object} domain.Response{data=documentAdminGetSampleVideoData} // @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" @@ -59,7 +59,7 @@ func documentAdminGetSampleVideo() {} // @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 +// @Success 200 {object} domain.Response{data=vimeo.OEmbedResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" diff --git a/internal/web_server/handlers/swagger_service_info.go b/internal/web_server/handlers/swagger_service_info.go new file mode 100644 index 00000000..0855477f --- /dev/null +++ b/internal/web_server/handlers/swagger_service_info.go @@ -0,0 +1,30 @@ +package handlers + +// Documentation-only declarations for the anonymous service discovery handlers +// registered in routes.go. These functions are not runtime handlers. + +type serviceInfoResponse struct { + Message string `json:"message" example:"Welcome to Rezina Backend API"` + Version string `json:"version" example:"1.0.1"` +} + +type apiIndexResponse struct { + AdminAPI string `json:"admin_api" example:"/api/v1/admin"` + ClientAPI string `json:"client_api" example:"/api/v1"` +} + +// documentServiceInfo godoc +// @Summary Service welcome and version +// @Tags discovery +// @Produce json +// @Success 200 {object} serviceInfoResponse +// @Router / [get] +func documentServiceInfo() {} + +// documentAPIIndex godoc +// @Summary Discover the admin and customer API roots +// @Tags discovery +// @Produce json +// @Success 200 {object} apiIndexResponse +// @Router /api/v1/ [get] +func documentAPIIndex() {} diff --git a/internal/web_server/handlers/team_handler.go b/internal/web_server/handlers/team_handler.go index 28b72745..f1374f69 100644 --- a/internal/web_server/handlers/team_handler.go +++ b/internal/web_server/handlers/team_handler.go @@ -500,7 +500,7 @@ func (h *Handler) GetAllTeamMembers(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Team Member ID" // @Param body body domain.UpdateTeamMemberReq true "Team member update payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse @@ -590,7 +590,7 @@ func (h *Handler) UpdateTeamMember(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Team Member ID" // @Param body body domain.UpdateTeamMemberStatusReq true "Status update payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse @@ -691,7 +691,7 @@ func (h *Handler) UpdateTeamMemberStatus(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param id path int true "Team Member ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 403 {object} domain.ErrorResponse @@ -789,7 +789,7 @@ func (h *Handler) GetTeamMemberStats(c *fiber.Ctx) error { // @Produce json // @Param id path int true "Team Member ID" // @Param body body changePasswordReq true "Password change payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/team_invitation_handler.go b/internal/web_server/handlers/team_invitation_handler.go index 3f5ad4e5..36a08264 100644 --- a/internal/web_server/handlers/team_invitation_handler.go +++ b/internal/web_server/handlers/team_invitation_handler.go @@ -56,7 +56,7 @@ func mapTeamInvitationListItem(row domain.TeamInvitationWithMember) teamInvitati // @Accept json // @Produce json // @Param body body domain.InviteTeamMemberReq true "Invite payload" -// @Success 201 {object} domain.Response +// @Success 201 {object} domain.Response{data=domain.InviteTeamMemberRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/invite [post] @@ -115,7 +115,7 @@ func (h *Handler) InviteTeamMember(c *fiber.Ctx) error { // @Tags team // @Produce json // @Param id path int true "Team member ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.InviteTeamMemberRes} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Router /api/v1/admin/team/members/{id}/resend-invite [post] @@ -163,7 +163,7 @@ func (h *Handler) ResendTeamInvitation(c *fiber.Ctx) error { // @Param status query string false "pending, accepted, expired, or revoked" // @Param limit query int false "Limit (default 20)" // @Param offset query int false "Offset (default 0)" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=listTeamInvitationsRes} // @Router /api/v1/admin/team/invitations [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -208,7 +208,7 @@ func (h *Handler) ListTeamInvitations(c *fiber.Ctx) error { // @Tags team // @Produce json // @Param id path int true "Invitation ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=RevokeTeamInvitationData} // @Router /api/v1/admin/team/invitations/{id}/revoke [post] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -242,7 +242,7 @@ func (h *Handler) RevokeTeamInvitation(c *fiber.Ctx) error { // @Tags team // @Produce json // @Param token query string true "Invitation token" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.VerifyTeamInvitationRes} // @Router /api/v1/admin/team/invitations/verify [get] // @Failure 400 {object} domain.ErrorResponse "Invalid request" // @Failure 500 {object} domain.ErrorResponse "Internal server error" @@ -276,7 +276,7 @@ func (h *Handler) VerifyTeamInvitation(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body domain.AcceptTeamInvitationReq true "Accept invitation payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.TeamMemberResponse} // @Router /api/v1/admin/team/invitations/accept [post] // @Failure 400 {object} domain.ErrorResponse "Invalid request" func (h *Handler) AcceptTeamInvitation(c *fiber.Ctx) error { diff --git a/internal/web_server/handlers/team_password_reset_handler.go b/internal/web_server/handlers/team_password_reset_handler.go index 5572ed54..3a36fec8 100644 --- a/internal/web_server/handlers/team_password_reset_handler.go +++ b/internal/web_server/handlers/team_password_reset_handler.go @@ -15,7 +15,7 @@ import ( // @Produce json // @Param email query string true "Team member email" // @Param otp query string true "Reset OTP from the email link" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=domain.TeamVerifyPasswordResetRes} // @Router /api/v1/admin/team/verifyResetCode [get] func (h *Handler) VerifyTeamPasswordReset(c *fiber.Ctx) error { email := c.Query("email") @@ -35,7 +35,7 @@ func (h *Handler) VerifyTeamPasswordReset(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body domain.TeamSendPasswordResetReq true "Email" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -72,7 +72,7 @@ func (h *Handler) SendTeamPasswordReset(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body domain.TeamResetPasswordReq true "Reset payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse diff --git a/internal/web_server/handlers/user.go b/internal/web_server/handlers/user.go index 9d583412..6ad75ede 100644 --- a/internal/web_server/handlers/user.go +++ b/internal/web_server/handlers/user.go @@ -59,7 +59,7 @@ func (h *Handler) GetUserSummary(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param user_id path int true "User ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=CheckProfileCompletedData} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -115,7 +115,7 @@ func (h *Handler) CheckProfileCompleted(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body domain.UpdateUserReq true "Update user payload" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -196,7 +196,7 @@ func (h *Handler) UpdateUser(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param knowledge_level body domain.UpdateKnowledgeLevelReq true "Knowledge level" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 401 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse @@ -252,9 +252,9 @@ func (h *Handler) UpdateUserKnowledgeLevel(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param resendOtp body domain.ResendOtpReq true "Resend OTP" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageResponse +// @Failure 400 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/user/resend-otp [post] func (h *Handler) ResendOtp(c *fiber.Ctx) error { var req domain.ResendOtpReq @@ -390,7 +390,7 @@ func (h *Handler) ResendOtp(c *fiber.Ctx) error { // @Tags user // @Accept json // @Produce json -// @Success 200 {object} domain.Response +// @Success 200 {object} domain.Response{data=CheckUserPendingData} // @Failure 400 {object} domain.ErrorResponse // @Failure 404 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse @@ -449,9 +449,9 @@ func (h *Handler) CheckUserPending(c *fiber.Ctx) error { // @Param country query string false "Country filter (case-insensitive match on stored value)" // @Param region query string false "Region filter (case-insensitive match on stored value)" // @Param subscription_status query string false "Derived subscription filter: ACTIVE, PENDING, or Unsubscribed (matches response subscription_status semantics)" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=GetAllUsersData} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/users [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -599,9 +599,9 @@ func (h *Handler) GetAllUsers(c *fiber.Ctx) error { // @Param scheduled_after query string false "Scheduled after (RFC3339)" // @Param page query int false "Page number (default 1)" // @Param page_size query int false "Page size (default 10, max 100)" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=ListAccountDeletionRequestsData} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/users/deletion-requests [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -686,9 +686,9 @@ func (h *Handler) ListAccountDeletionRequests(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param body body object true "Status update payload" example({"user_id": 1, "status": "ACTIVE"}) -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/user/status [patch] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -747,9 +747,9 @@ func (h *Handler) UpdateUserStatus(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param verifyOtp body domain.VerifyOtpReq true "Verify OTP" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} domain.Response{data=loginUserRes} +// @Failure 400 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/user/verify-otp [post] func (h *Handler) VerifyOtp(c *fiber.Ctx) error { var req domain.VerifyOtpReq @@ -933,9 +933,9 @@ type CheckPhoneEmailExistRes struct { // @Accept json // @Produce json // @Param checkPhoneEmailExist body CheckPhoneEmailExistReq true "Check phone number or email exist" -// @Success 200 {object} CheckPhoneEmailExistRes -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=CheckPhoneEmailExistRes} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/user/checkPhoneEmailExist [post] func (h *Handler) CheckPhoneEmailExist(c *fiber.Ctx) error { // companyID := c.Locals("company_id").(domain.ValidInt64) @@ -991,9 +991,9 @@ type RegisterCodeReq struct { // @Accept json // @Produce json // @Param registerCode body RegisterCodeReq true "Send register code" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/user/sendRegisterCode [post] func (h *Handler) SendRegisterCode(c *fiber.Ctx) error { // companyID := c.Locals("company_id").(domain.ValidInt64) @@ -1051,9 +1051,9 @@ func (h *Handler) SendRegisterCode(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param registerUser body domain.RegisterUserReq true "Register user" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageResponse +// @Failure 400 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse // @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 { @@ -1183,9 +1183,9 @@ type ResetCodeReq struct { // @Accept json // @Produce json // @Param resetCode body ResetCodeReq true "Send reset code" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/user/sendResetCode [post] func (h *Handler) SendResetCode(c *fiber.Ctx) error { var req ResetCodeReq @@ -1318,9 +1318,9 @@ type ResetPasswordReq struct { // @Accept json // @Produce json // @Param resetPassword body ResetPasswordReq true "Reset password" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/user/resetPassword [post] func (h *Handler) ResetPassword(c *fiber.Ctx) error { var req ResetPasswordReq @@ -1389,9 +1389,9 @@ func (h *Handler) ResetTenantPassword(c *fiber.Ctx) error { // @Tags user // @Accept json // @Produce json -// @Success 200 {object} domain.UserProfileResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=domain.UserProfileResponse} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/user/user-profile [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -1513,9 +1513,9 @@ type AdminProfileRes struct { // @Tags user // @Accept json // @Produce json -// @Success 200 {object} AdminProfileRes -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=domain.UserProfileResponse} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/user/admin-profile [get] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -1647,9 +1647,9 @@ type SearchUserByNameOrPhoneReq struct { // @Accept json // @Produce json // @Param searchUserByNameOrPhone body SearchUserByNameOrPhoneReq true "Search for using his name or phone" -// @Success 200 {object} domain.UserProfileResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=[]domain.UserProfileResponse} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/user/search [post] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -1785,10 +1785,10 @@ func (h *Handler) SearchUserByNameOrPhone(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param id path int true "User ID" -// @Success 200 {object} domain.UserProfileResponse -// @Failure 400 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=domain.UserProfileResponse} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @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" @@ -1906,9 +1906,9 @@ func (h *Handler) GetUserByID(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param id path int true "User ID" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/user/delete/{id} [delete] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -1969,10 +1969,10 @@ const ( // @Description Starts account deletion with grace period before permanent purge // @Tags user // @Produce json -// @Success 200 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 403 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=DeleteMyUserAccountData} +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 403 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/user/me [delete] // @Security Bearer func (h *Handler) DeleteMyUserAccount(c *fiber.Ctx) error { @@ -2022,10 +2022,10 @@ func (h *Handler) DeleteMyUserAccount(c *fiber.Ctx) error { // @Description Cancels a pending self-deletion request during grace period // @Tags user // @Produce json -// @Success 200 {object} response.APIResponse -// @Failure 401 {object} response.APIResponse -// @Failure 403 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} MessageAPIResponse +// @Failure 401 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 403 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/user/me/deletion/cancel [post] // @Security Bearer func (h *Handler) CancelMyUserAccountDeletion(c *fiber.Ctx) error { @@ -2070,9 +2070,9 @@ func (h *Handler) CancelMyUserAccountDeletion(c *fiber.Ctx) error { // @Tags user // @Produce json // @Param limit query int false "Max users to purge in one run (default 100, max 1000)" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} response.APIResponse{data=PurgeDueDeletedUsersData} +// @Failure 400 {string} string "Plain-text error returned by the handler or authentication middleware" +// @Failure 500 {string} string "Plain-text error returned by the handler or authentication middleware" // @Router /api/v1/admin/internal/users/purge-due-deletions [post] // @Security Bearer // @Failure 401 {string} string "Missing, invalid, or expired Bearer token" @@ -2123,9 +2123,9 @@ type UpdateUserSuspendRes struct { // @Produce json // @Param id path int true "User ID" // @Param file formData file true "Image file (jpg|png|webp)" -// @Success 200 {object} response.APIResponse -// @Failure 400 {object} response.APIResponse -// @Failure 500 {object} response.APIResponse +// @Success 200 {object} domain.Response{data=UploadProfilePictureData} +// @Failure 400 {object} domain.ErrorResponse +// @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/user/{id}/profile-picture [post] // @Router /api/v1/user/{id}/profile-picture [post] // @Security Bearer diff --git a/internal/web_server/handlers/vimeo.go b/internal/web_server/handlers/vimeo.go index 77fc97ba..093d51a5 100644 --- a/internal/web_server/handlers/vimeo.go +++ b/internal/web_server/handlers/vimeo.go @@ -192,7 +192,7 @@ func (h *Handler) ListVimeoVideos(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param video_id path string true "Vimeo Video ID" -// @Success 200 {object} VimeoVideoResponse +// @Success 200 {object} domain.Response{data=VimeoVideoResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id} [get] @@ -239,7 +239,7 @@ func (h *Handler) GetVimeoVideo(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param request body CreatePullUploadRequest true "Pull Upload Request" -// @Success 201 {object} VimeoUploadResponse +// @Success 201 {object} domain.Response{data=VimeoUploadResultData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/uploads/pull [post] @@ -300,7 +300,7 @@ func (h *Handler) CreatePullUpload(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param request body CreateTusUploadRequest true "TUS Upload Request" -// @Success 201 {object} VimeoUploadResponse +// @Success 201 {object} domain.Response{data=VimeoUploadResultData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/uploads/tus [post] @@ -367,7 +367,7 @@ func (h *Handler) CreateTusUpload(c *fiber.Ctx) error { // @Param loop query bool false "Loop video" // @Param muted query bool false "Mute video" // @Param background query bool false "Background mode (no controls)" -// @Success 200 {object} VimeoEmbedResponse +// @Success 200 {object} domain.Response{data=VimeoEmbedResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id}/embed [get] @@ -437,7 +437,7 @@ func (h *Handler) GetEmbedCode(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param video_id path string true "Vimeo Video ID" -// @Success 200 {object} domain.Response +// @Success 200 {object} MessageResponse // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id} [delete] @@ -485,7 +485,7 @@ func (h *Handler) DeleteVimeoVideo(c *fiber.Ctx) error { // @Accept json // @Produce json // @Param video_id path string true "Vimeo Video ID" -// @Success 200 {object} map[string]string +// @Success 200 {object} domain.Response{data=VimeoTranscodeStatusData} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/admin/vimeo/videos/{video_id}/status [get] @@ -537,7 +537,7 @@ func (h *Handler) GetTranscodeStatus(c *fiber.Ctx) error { // @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 +// @Success 200 {object} domain.Response{data=GetSampleVideoData} // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/vimeo/sample [get] // @Failure 503 {object} domain.ErrorResponse "Service unavailable" @@ -581,7 +581,7 @@ func (h *Handler) GetSampleVideo(c *fiber.Ctx) error { // @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 +// @Success 200 {object} domain.Response{data=vimeo.OEmbedResponse} // @Failure 400 {object} domain.ErrorResponse // @Failure 500 {object} domain.ErrorResponse // @Router /api/v1/vimeo/oembed [get] diff --git a/internal/web_server/response/res.go b/internal/web_server/response/res.go index 496a14fe..16960699 100644 --- a/internal/web_server/response/res.go +++ b/internal/web_server/response/res.go @@ -14,10 +14,11 @@ const ( ) type APIResponse struct { - Status Status `json:"status"` - Message string `json:"message"` - Data interface{} `json:"data,omitempty"` - Metadata interface{} `json:"metadata,omitempty"` + Status Status `json:"status"` + Message string `json:"message"` + Data interface{} `json:"data,omitempty" swaggerignore:"true"` + // Optional endpoint-specific metadata; omitted when there is no metadata. + Metadata interface{} `json:"metadata,omitempty" swaggertype:"object"` Page *int `json:"page,omitempty"` Total *int `json:"total,omitempty"` Timestamp time.Time `json:"timestamp"` diff --git a/internal/web_server/swagger_contract_test.go b/internal/web_server/swagger_contract_test.go index b0e9e8a5..a6ff1e2e 100644 --- a/internal/web_server/swagger_contract_test.go +++ b/internal/web_server/swagger_contract_test.go @@ -102,6 +102,8 @@ func registeredSwaggerContracts(t *testing.T) []swaggerRouteContract { }) } result = append(result, swaggerRouteContract{Method: "get", Path: "/payment/success", Handler: "HandleChapaSuccessPage"}) + result = append(result, swaggerRouteContract{Method: "get", Path: "/", Handler: "documentServiceInfo"}) + result = append(result, swaggerRouteContract{Method: "get", Path: "/api/v1/", Handler: "documentAPIIndex"}) return result } diff --git a/internal/web_server/swagger_response_schema_test.go b/internal/web_server/swagger_response_schema_test.go new file mode 100644 index 00000000..437276df --- /dev/null +++ b/internal/web_server/swagger_response_schema_test.go @@ -0,0 +1,140 @@ +package httpserver + +import ( + "encoding/json" + "fmt" + "strconv" + "strings" + "testing" + + "Rezina-Backend/docs" +) + +// Swagger 2 uses allOf to specialize a shared response envelope. Resolve those +// overrides before inspecting data, so an empty base interface cannot hide an +// undocumented response and a typed override is not mistaken for an empty field. +func responseSchemaObject(t *testing.T, spec, schema map[string]any, seen map[string]bool) map[string]any { + t.Helper() + if reference, ok := schema["$ref"].(string); ok { + if seen[reference] { + return map[string]any{"type": "object", "description": "Recursive schema reference"} + } + seen[reference] = true + definitions := spec["definitions"].(map[string]any) + definition, ok := definitions[strings.TrimPrefix(reference, "#/definitions/")].(map[string]any) + if !ok { + t.Fatalf("missing response schema %s", reference) + } + return responseSchemaObject(t, spec, definition, seen) + } + result := map[string]any{} + merge := func(part map[string]any) { + for key, value := range part { + if key == "properties" { + properties, _ := result[key].(map[string]any) + if properties == nil { + properties = map[string]any{} + result[key] = properties + } + for name, property := range value.(map[string]any) { + properties[name] = property + } + } else { + result[key] = value + } + } + } + if parts, ok := schema["allOf"].([]any); ok { + for _, part := range parts { + merge(responseSchemaObject(t, spec, part.(map[string]any), cloneSchemaSeen(seen))) + } + } + merge(schema) + delete(result, "allOf") + return result +} + +func cloneSchemaSeen(source map[string]bool) map[string]bool { + result := map[string]bool{} + for k, v := range source { + result[k] = v + } + return result +} + +func checkResponseSchemaDetail(t *testing.T, spec, schema map[string]any, path string, seen map[string]bool) { + t.Helper() + schema = responseSchemaObject(t, spec, schema, seen) + kind, _ := schema["type"].(string) + description, _ := schema["description"].(string) + if kind == "" { + // Dynamic question components are intentionally polymorphic. Their allowed + // JSON types and kind-dependent interpretation must be explicit. + if schema["x-json-types"] != nil && description != "" { + return + } + t.Errorf("%s: response field has no type or documented JSON variants", path) + return + } + if kind == "array" { + items, ok := schema["items"].(map[string]any) + if !ok { + t.Errorf("%s: array has no item schema", path) + return + } + checkResponseSchemaDetail(t, spec, items, path+"[]", cloneSchemaSeen(seen)) + } + if kind == "object" { + properties, _ := schema["properties"].(map[string]any) + additional, hasAdditional := schema["additionalProperties"] + if len(properties) == 0 && !hasAdditional && description == "" { + t.Errorf("%s: object has no fields or documented extension semantics", path) + } + if values, ok := additional.(map[string]any); ok { + if len(values) == 0 { + if description == "" { + t.Errorf("%s: arbitrary JSON dictionary needs a description", path) + } + } else { + checkResponseSchemaDetail(t, spec, values, path+"{}", cloneSchemaSeen(seen)) + } + } + for name, property := range properties { + checkResponseSchemaDetail(t, spec, property.(map[string]any), path+"."+name, cloneSchemaSeen(seen)) + } + } +} + +func TestEveryAPIResponseHasDetailedSchema(t *testing.T) { + var spec map[string]any + if err := json.Unmarshal([]byte(docs.SwaggerInfo.ReadDoc()), &spec); err != nil { + t.Fatal(err) + } + for path, raw := range spec["paths"].(map[string]any) { + for method, value := range raw.(map[string]any) { + operation := value.(map[string]any) + for code, value := range operation["responses"].(map[string]any) { + status, err := strconv.Atoi(code) + if err != nil { + t.Fatal(err) + } + // Redirects and protocol upgrades are described by status/headers, + // rather than pretending that they return a JSON document. + if status < 200 || (status >= 300 && status < 400) || status == 204 { + continue + } + t.Run(fmt.Sprintf("%s %s %s", method, path, code), func(t *testing.T) { + response := value.(map[string]any) + schema, ok := response["schema"].(map[string]any) + if !ok { + t.Fatal("response is missing its schema") + } + if status < 300 && (schema["$ref"] == "#/definitions/domain.Response" || schema["$ref"] == "#/definitions/response.APIResponse") { + t.Fatal("success uses an unspecialized generic response envelope") + } + checkResponseSchemaDetail(t, spec, schema, "response", map[string]bool{}) + }) + } + } + } +}