Yimaru-BackEnd/docs/swagger.json

3641 lines
122 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "This is server for Yimaru.",
"title": "Yimaru API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0.1"
},
"paths": {
"/api/v1/admin": {
"get": {
"description": "Get all Admins",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Get all Admins",
"parameters": [
{
"type": "integer",
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "Page size",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.AdminRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
},
"post": {
"description": "Create Admin",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Create Admin",
"parameters": [
{
"description": "Create admin",
"name": "manger",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CreateAdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/admin/{id}": {
"get": {
"description": "Get a single admin by id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Get admin by id",
"parameters": [
{
"type": "integer",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.AdminRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
},
"put": {
"description": "Update Admin",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Update Admin",
"parameters": [
{
"description": "Update Admin",
"name": "admin",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.updateAdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/assessment/questions": {
"get": {
"description": "Returns all active questions used for initial knowledge assessment",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"assessment"
],
"summary": "Get active initial assessment questions",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.AssessmentQuestion"
}
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
},
"post": {
"description": "Creates a new question for the initial knowledge assessment",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"assessment"
],
"summary": "Create assessment question",
"parameters": [
{
"description": "Assessment question payload",
"name": "question",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.AssessmentQuestion"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.AssessmentQuestion"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/auth/logout": {
"post": {
"description": "Logout user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Logout user",
"parameters": [
{
"description": "Logout user",
"name": "logout",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.logoutReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/auth/refresh": {
"post": {
"description": "Refresh token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Refresh token",
"parameters": [
{
"description": "tokens",
"name": "refresh",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.refreshToken"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.loginUserRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/course-categories": {
"get": {
"description": "Returns all active course categories",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "List active course categories",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.CourseCategory"
}
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
},
"post": {
"description": "Creates a new course category",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create course category",
"parameters": [
{
"description": "Course category payload",
"name": "category",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CourseCategory"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.CourseCategory"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/course-categories/{category_id}/courses": {
"get": {
"description": "Returns courses under a given category",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "List courses by category",
"parameters": [
{
"type": "integer",
"description": "Category ID",
"name": "category_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.Course"
}
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/course-categories/{id}": {
"get": {
"description": "Get course category by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Get course category",
"parameters": [
{
"type": "integer",
"description": "Category ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.CourseCategory"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
},
"put": {
"description": "Updates a course category",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Update course category",
"parameters": [
{
"type": "integer",
"description": "Category ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Course category payload",
"name": "category",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CourseCategory"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.CourseCategory"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/course-categories/{id}/deactivate": {
"post": {
"description": "Deactivates a course category",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Deactivate course category",
"parameters": [
{
"type": "integer",
"description": "Category ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/courses": {
"get": {
"description": "Returns all active courses",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "List active courses",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.Course"
}
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
},
"post": {
"description": "Creates a new course",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create course",
"parameters": [
{
"description": "Course payload",
"name": "course",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.Course"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Course"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/courses/{course_id}/programs": {
"get": {
"tags": [
"courses"
],
"summary": "List programs by course",
"parameters": [
{
"type": "integer",
"description": "Course ID",
"name": "course_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.Program"
}
}
}
}
]
}
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create program",
"parameters": [
{
"description": "Program payload",
"name": "program",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.Program"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Program"
}
}
}
]
}
}
}
}
},
"/api/v1/courses/{id}": {
"get": {
"description": "Get course by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Get course",
"parameters": [
{
"type": "integer",
"description": "Course ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Course"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
},
"put": {
"description": "Updates a course",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Update course",
"parameters": [
{
"type": "integer",
"description": "Course ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Course payload",
"name": "course",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.Course"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Course"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/courses/{id}/deactivate": {
"post": {
"description": "Deactivates a course",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Deactivate course",
"parameters": [
{
"type": "integer",
"description": "Course ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/levels": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create level",
"parameters": [
{
"description": "Level payload",
"name": "level",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.Level"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Level"
}
}
}
]
}
}
}
}
},
"/api/v1/levels/{level_id}/modules": {
"get": {
"tags": [
"courses"
],
"summary": "List modules by level",
"parameters": [
{
"type": "integer",
"description": "Level ID",
"name": "level_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.Module"
}
}
}
}
]
}
}
}
}
},
"/api/v1/logs": {
"get": {
"description": "Fetches application logs from MongoDB with pagination, level filtering, and search",
"produces": [
"application/json"
],
"tags": [
"Logs"
],
"summary": "Retrieve application logs with filtering and pagination",
"parameters": [
{
"type": "string",
"description": "Filter logs by level (debug, info, warn, error, dpanic, panic, fatal)",
"name": "level",
"in": "query"
},
{
"type": "string",
"description": "Search term to match against message or fields",
"name": "search",
"in": "query"
},
{
"type": "integer",
"default": 1,
"description": "Page number for pagination (default: 1)",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 50,
"description": "Number of items per page (default: 50, max: 100)",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "Paginated list of application logs",
"schema": {
"$ref": "#/definitions/domain.LogResponse"
}
},
"400": {
"description": "Invalid request parameters",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/module-videos": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create module video",
"parameters": [
{
"description": "Module video payload",
"name": "video",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.ModuleVideo"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ModuleVideo"
}
}
}
]
}
}
}
}
},
"/api/v1/modules": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create module",
"parameters": [
{
"description": "Module payload",
"name": "module",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.Module"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Module"
}
}
}
]
}
}
}
}
},
"/api/v1/practice-questions": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create practice question",
"parameters": [
{
"description": "Practice question payload",
"name": "question",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.PracticeQuestion"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.PracticeQuestion"
}
}
}
]
}
}
}
}
},
"/api/v1/practices": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courses"
],
"summary": "Create practice",
"parameters": [
{
"description": "Practice payload",
"name": "practice",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.Practice"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Practice"
}
}
}
]
}
}
}
}
},
"/api/v1/sendSMS": {
"post": {
"description": "Sends an SMS message to a single phone number using AfroMessage",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Send single SMS via AfroMessage",
"parameters": [
{
"description": "Send SMS request",
"name": "sendSMS",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SendSingleAfroSMSReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/super-login": {
"post": {
"description": "Login super-admin",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Login super-admin",
"parameters": [
{
"description": "Login super-admin",
"name": "login",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.loginAdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.LoginAdminRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/t-approver/{id}": {
"get": {
"description": "Get a single admin by id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Get admin by id",
"parameters": [
{
"type": "integer",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.AdminRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
},
"put": {
"description": "Update Admin",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Update Admin",
"parameters": [
{
"description": "Update Admin",
"name": "admin",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.updateAdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/tenant": {
"get": {
"description": "Check if phone number or email exist",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Check if phone number or email exist",
"parameters": [
{
"description": "Check phone number or email exist",
"name": "checkPhoneEmailExist",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CheckPhoneEmailExistReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.CheckPhoneEmailExistRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/user/delete/{id}": {
"delete": {
"description": "Delete a user by their ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Delete user by ID",
"parameters": [
{
"type": "integer",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/user/resetPassword": {
"post": {
"description": "Reset password",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Reset password",
"parameters": [
{
"description": "Reset password",
"name": "resetPassword",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ResetPasswordReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/user/search": {
"post": {
"description": "Search for user using name or phone",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Search for user using name or phone",
"parameters": [
{
"description": "Search for using his name or phone",
"name": "searchUserByNameOrPhone",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SearchUserByNameOrPhoneReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.UserProfileResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/user/sendResetCode": {
"post": {
"description": "Send reset code",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Send reset code",
"parameters": [
{
"description": "Send reset code",
"name": "resetCode",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ResetCodeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/user/single/{id}": {
"get": {
"description": "Get a single user by id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Get user by id",
"parameters": [
{
"type": "integer",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.UserProfileResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/user/verify-otp": {
"post": {
"description": "Verify OTP for registration or other actions",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Verify OTP",
"parameters": [
{
"description": "Verify OTP",
"name": "verifyOtp",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.VerifyOtpReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/user/{user_name}/is-unique": {
"get": {
"description": "Returns whether the specified user_name is available (unique)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Check if user_name is unique",
"parameters": [
{
"type": "string",
"description": "User Name",
"name": "user_name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/admin-login": {
"post": {
"description": "Login user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Login user",
"parameters": [
{
"description": "Login admin",
"name": "login",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.loginAdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.LoginAdminRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/assessment/submit": {
"post": {
"description": "Evaluates user responses, calculates knowledge level, updates user profile, and sends notification",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"assessment"
],
"summary": "Submit initial knowledge assessment",
"parameters": [
{
"type": "integer",
"description": "User ID",
"name": "user_id",
"in": "path",
"required": true
},
{
"description": "Assessment responses",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.SubmitAssessmentReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/otp/resend": {
"post": {
"description": "Resend OTP if the previous one is expired",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"otp"
],
"summary": "Resend OTP",
"parameters": [
{
"description": "Resend OTP",
"name": "resendOtp",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.ResendOtpReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user-login": {
"post": {
"description": "Login user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Login user",
"parameters": [
{
"description": "Login user",
"name": "login",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.loginUserReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.loginUserRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/admin-profile": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Get user profile",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Get user profile",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.AdminProfileRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/checkPhoneEmailExist": {
"post": {
"description": "Check if phone number or email exist",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Check if phone number or email exist",
"parameters": [
{
"description": "Check phone number or email exist",
"name": "checkPhoneEmailExist",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CheckPhoneEmailExistReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.CheckPhoneEmailExistRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/knowledge-level": {
"put": {
"description": "Updates the knowledge level of the specified user after initial assessment",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Update user's knowledge level",
"parameters": [
{
"type": "integer",
"description": "User ID",
"name": "user_id",
"in": "path",
"required": true
},
{
"description": "Knowledge level",
"name": "knowledge_level",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.UpdateKnowledgeLevelReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/register": {
"post": {
"description": "Register user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Register user",
"parameters": [
{
"description": "Register user",
"name": "registerUser",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.RegisterUserReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/resetPassword": {
"post": {
"description": "Reset tenant password",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Reset tenant password",
"parameters": [
{
"description": "Reset password",
"name": "resetPassword",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ResetPasswordReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/sendRegisterCode": {
"post": {
"description": "Send register code",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Send register code",
"parameters": [
{
"description": "Send register code",
"name": "registerCode",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.RegisterCodeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/sendResetCode": {
"post": {
"description": "Send reset code",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Send reset code",
"parameters": [
{
"description": "Send reset code",
"name": "resetCode",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ResetCodeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/user-profile": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Get user profile",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Get user profile",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.UserProfileResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/{tenant_slug}/user/{user_name}/is-pending": {
"get": {
"description": "Returns whether the specified user has a status of \"pending\"",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Check if user status is pending",
"parameters": [
{
"type": "string",
"description": "User Name",
"name": "user_name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
}
}
},
"definitions": {
"domain.AssessmentOption": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"isCorrect": {
"type": "boolean"
},
"optionText": {
"type": "string"
}
}
},
"domain.AssessmentQuestion": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"difficultyLevel": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"options": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.AssessmentOption"
}
},
"questionType": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"domain.Course": {
"type": "object",
"properties": {
"categoryID": {
"type": "integer",
"format": "int64"
},
"description": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"isActive": {
"type": "boolean"
},
"title": {
"type": "string"
}
}
},
"domain.CourseCategory": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"isActive": {
"type": "boolean"
},
"name": {
"description": "\"Learning English\", \"Other Courses\"",
"type": "string"
}
}
},
"domain.ErrorResponse": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"domain.Level": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"isActive": {
"type": "boolean"
},
"levelIndex": {
"description": "1,2,3...",
"type": "integer"
},
"numberOfModules": {
"type": "integer"
},
"numberOfPractices": {
"type": "integer"
},
"numberOfVideos": {
"type": "integer"
},
"programID": {
"type": "integer",
"format": "int64"
},
"title": {
"description": "\"Beginner\", \"Level 1\"",
"type": "string"
}
}
},
"domain.LogEntry": {
"type": "object",
"properties": {
"caller": {
"type": "string"
},
"env": {
"type": "string"
},
"fields": {
"type": "object",
"additionalProperties": true
},
"level": {
"type": "string"
},
"message": {
"type": "string"
},
"service": {
"type": "string"
},
"stacktrace": {
"type": "string"
},
"timestamp": {
"type": "string"
}
}
},
"domain.LogResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.LogEntry"
}
},
"message": {
"type": "string"
},
"pagination": {
"$ref": "#/definitions/domain.Pagination"
}
}
},
"domain.Module": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"isActive": {
"type": "boolean"
},
"levelID": {
"type": "integer",
"format": "int64"
},
"order": {
"type": "integer"
},
"title": {
"type": "string"
}
}
},
"domain.ModuleVideo": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"duration": {
"description": "seconds",
"type": "integer"
},
"id": {
"type": "integer",
"format": "int64"
},
"instructorId": {
"type": "string"
},
"isActive": {
"type": "boolean"
},
"moduleID": {
"type": "integer",
"format": "int64"
},
"publishSettings": {
"$ref": "#/definitions/domain.PublishSettings"
},
"resolution": {
"description": "\"720p\", \"1080p\"",
"type": "string"
},
"thumbnail": {
"type": "string"
},
"title": {
"type": "string"
},
"videoURL": {
"type": "string"
}
}
},
"domain.OtpMedium": {
"type": "string",
"enum": [
"email",
"sms"
],
"x-enum-varnames": [
"OtpMediumEmail",
"OtpMediumSms"
]
},
"domain.Pagination": {
"type": "object",
"properties": {
"current_page": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"total": {
"type": "integer"
},
"total_pages": {
"type": "integer"
}
}
},
"domain.Practice": {
"type": "object",
"properties": {
"bannerImage": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"isActive": {
"type": "boolean"
},
"ownerID": {
"type": "integer",
"format": "int64"
},
"ownerType": {
"description": "\"LEVEL\" | \"MODULE\"",
"type": "string"
},
"persona": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"domain.PracticeQuestion": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"practiceID": {
"type": "integer",
"format": "int64"
},
"question": {
"type": "string"
},
"questionVoicePrompt": {
"type": "string"
},
"sampleAnswer": {
"type": "string"
},
"sampleAnswerVoicePrompt": {
"type": "string"
},
"tips": {
"type": "string"
},
"type": {
"description": "MCQ, TRUE_FALSE, SHORT",
"type": "string"
}
}
},
"domain.Program": {
"type": "object",
"properties": {
"courseID": {
"type": "integer",
"format": "int64"
},
"description": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"isActive": {
"type": "boolean"
},
"order": {
"description": "ordering inside course",
"type": "integer"
},
"thumbnail": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"domain.PublishSettings": {
"type": "object",
"properties": {
"isPublished": {
"type": "boolean"
},
"publishDate": {
"type": "string"
},
"visibility": {
"description": "\"public\", \"private\", \"unlisted\"",
"type": "string"
}
}
},
"domain.RegisterUserReq": {
"type": "object",
"properties": {
"age": {
"type": "integer"
},
"country": {
"type": "string"
},
"education_level": {
"type": "string"
},
"email": {
"type": "string"
},
"favoutite_topic": {
"type": "string"
},
"first_name": {
"type": "string"
},
"language_challange": {
"type": "string"
},
"language_goal": {
"type": "string"
},
"last_name": {
"type": "string"
},
"learning_goal": {
"type": "string"
},
"nick_name": {
"type": "string"
},
"occupation": {
"type": "string"
},
"otp_medium": {
"$ref": "#/definitions/domain.OtpMedium"
},
"password": {
"type": "string"
},
"phone_number": {
"type": "string"
},
"preferred_language": {
"type": "string"
},
"region": {
"type": "string"
},
"role": {
"type": "string"
},
"user_name": {
"type": "string"
}
}
},
"domain.ResendOtpReq": {
"type": "object",
"required": [
"user_name"
],
"properties": {
"user_name": {
"type": "string"
}
}
},
"domain.Response": {
"type": "object",
"properties": {
"data": {},
"message": {
"type": "string"
},
"metadata": {},
"status_code": {
"type": "integer"
},
"success": {
"type": "boolean"
}
}
},
"domain.Role": {
"type": "string",
"enum": [
"super_admin",
"admin",
"student",
"instructor",
"support"
],
"x-enum-varnames": [
"RoleSuperAdmin",
"RoleAdmin",
"RoleStudent",
"RoleInstructor",
"RoleSupport"
]
},
"domain.SubmitAssessmentReq": {
"type": "object",
"required": [
"answers"
],
"properties": {
"answers": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/domain.UserAnswer"
}
}
}
},
"domain.UpdateKnowledgeLevelReq": {
"type": "object",
"properties": {
"knowledge_level": {
"description": "BEGINNER, INTERMEDIATE, ADVANCED",
"type": "string"
},
"user_id": {
"type": "integer"
}
}
},
"domain.UserAnswer": {
"type": "object",
"properties": {
"isCorrect": {
"type": "boolean"
},
"questionID": {
"type": "integer",
"format": "int64"
},
"selectedOptionID": {
"type": "integer",
"format": "int64"
},
"shortAnswer": {
"type": "string"
}
}
},
"domain.UserProfileResponse": {
"type": "object",
"properties": {
"age": {
"type": "integer"
},
"country": {
"type": "string"
},
"created_at": {
"type": "string"
},
"education_level": {
"type": "string"
},
"email": {
"type": "string"
},
"email_verified": {
"type": "boolean"
},
"favoutite_topic": {
"type": "string"
},
"first_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"initial_assessment_completed": {
"description": "Profile fields",
"type": "boolean"
},
"language_challange": {
"type": "string"
},
"language_goal": {
"type": "string"
},
"last_login": {
"type": "string"
},
"last_name": {
"type": "string"
},
"learning_goal": {
"type": "string"
},
"nick_name": {
"type": "string"
},
"occupation": {
"type": "string"
},
"phone_number": {
"type": "string"
},
"phone_verified": {
"type": "boolean"
},
"preferred_language": {
"type": "string"
},
"profile_completed": {
"type": "boolean"
},
"profile_picture_url": {
"type": "string"
},
"region": {
"type": "string"
},
"role": {
"$ref": "#/definitions/domain.Role"
},
"status": {
"$ref": "#/definitions/domain.UserStatus"
},
"updated_at": {
"type": "string"
},
"user_name": {
"type": "string"
}
}
},
"domain.UserStatus": {
"type": "string",
"enum": [
"PENDING",
"ACTIVE",
"SUSPENDED",
"DEACTIVATED"
],
"x-enum-varnames": [
"UserStatusPending",
"UserStatusActive",
"UserStatusSuspended",
"UserStatusDeactivated"
]
},
"domain.VerifyOtpReq": {
"type": "object",
"required": [
"otp",
"user_name"
],
"properties": {
"otp": {
"type": "string"
},
"user_name": {
"type": "string"
}
}
},
"handlers.AdminProfileRes": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"email_verified": {
"type": "boolean"
},
"first_name": {
"type": "string"
},
"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"
}
}
},
"handlers.AdminRes": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"email_verified": {
"type": "boolean"
},
"first_name": {
"type": "string"
},
"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"
}
}
},
"handlers.CheckPhoneEmailExistReq": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "john.doe@example.com"
},
"phone_number": {
"type": "string",
"example": "1234567890"
}
}
},
"handlers.CheckPhoneEmailExistRes": {
"type": "object",
"properties": {
"email_exist": {
"type": "boolean"
},
"phone_number_exist": {
"type": "boolean"
}
}
},
"handlers.CreateAdminReq": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "john.doe@example.com"
},
"first_name": {
"type": "string",
"example": "John"
},
"last_name": {
"type": "string",
"example": "Doe"
},
"password": {
"type": "string",
"example": "password123"
},
"phone_number": {
"type": "string",
"example": "1234567890"
}
}
},
"handlers.LoginAdminRes": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"refresh_token": {
"type": "string"
},
"role": {
"type": "string"
}
}
},
"handlers.RegisterCodeReq": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "john.doe@example.com"
},
"phone_number": {
"type": "string",
"example": "1234567890"
}
}
},
"handlers.ResetCodeReq": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "john.doe@example.com"
},
"phone_number": {
"type": "string",
"example": "1234567890"
}
}
},
"handlers.ResetPasswordReq": {
"type": "object",
"required": [
"otp",
"password",
"user_name"
],
"properties": {
"otp": {
"type": "string",
"example": "123456"
},
"password": {
"type": "string",
"minLength": 8,
"example": "newpassword123"
},
"user_name": {
"type": "string",
"example": "johndoe"
}
}
},
"handlers.SearchUserByNameOrPhoneReq": {
"type": "object",
"properties": {
"query": {
"type": "string"
},
"role": {
"$ref": "#/definitions/domain.Role"
}
}
},
"handlers.SendSingleAfroSMSReq": {
"type": "object",
"required": [
"message",
"recipient"
],
"properties": {
"message": {
"type": "string",
"example": "Hello world"
},
"recipient": {
"type": "string",
"example": "+251912345678"
}
}
},
"handlers.loginAdminReq": {
"type": "object",
"required": [
"password",
"user_name"
],
"properties": {
"password": {
"type": "string",
"example": "password123"
},
"user_name": {
"type": "string",
"example": "adminuser"
}
}
},
"handlers.loginUserReq": {
"type": "object",
"required": [
"password",
"user_name"
],
"properties": {
"password": {
"type": "string",
"example": "password123"
},
"user_name": {
"type": "string",
"example": "johndoe"
}
}
},
"handlers.loginUserRes": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"refresh_token": {
"type": "string"
},
"role": {
"type": "string"
}
}
},
"handlers.logoutReq": {
"type": "object",
"required": [
"refresh_token"
],
"properties": {
"refresh_token": {
"type": "string",
"example": "\u003crefresh-token\u003e"
}
}
},
"handlers.refreshToken": {
"type": "object",
"required": [
"access_token",
"refresh_token"
],
"properties": {
"access_token": {
"type": "string",
"example": "\u003cjwt-token\u003e"
},
"refresh_token": {
"type": "string",
"example": "\u003crefresh-token\u003e"
}
}
},
"handlers.updateAdminReq": {
"type": "object",
"properties": {
"first_name": {
"type": "string",
"example": "John"
},
"last_name": {
"type": "string",
"example": "Doe"
},
"suspended": {
"type": "boolean",
"example": false
}
}
},
"response.APIResponse": {
"type": "object",
"properties": {
"data": {},
"message": {
"type": "string"
},
"metadata": {},
"page": {
"type": "integer"
},
"status": {
"$ref": "#/definitions/response.Status"
},
"timestamp": {
"type": "string"
},
"total": {
"type": "integer"
}
}
},
"response.Status": {
"type": "string",
"enum": [
"error",
"success"
],
"x-enum-varnames": [
"Error",
"Success"
]
}
},
"securityDefinitions": {
"Bearer": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}