6035 lines
151 KiB
YAML
6035 lines
151 KiB
YAML
definitions:
|
|
domain.AgeGroup:
|
|
enum:
|
|
- UNDER_13
|
|
- "13_17"
|
|
- "18_24"
|
|
- "25_34"
|
|
- "35_44"
|
|
- "45_54"
|
|
- 55_PLUS
|
|
type: string
|
|
x-enum-varnames:
|
|
- AgeUnder13
|
|
- Age13To17
|
|
- Age18To24
|
|
- Age25To34
|
|
- Age35To44
|
|
- Age45To54
|
|
- Age55Plus
|
|
domain.CreateTeamMemberReq:
|
|
properties:
|
|
bio:
|
|
type: string
|
|
department:
|
|
type: string
|
|
email:
|
|
type: string
|
|
emergency_contact:
|
|
type: string
|
|
employment_type:
|
|
type: string
|
|
first_name:
|
|
type: string
|
|
hire_date:
|
|
description: YYYY-MM-DD
|
|
type: string
|
|
job_title:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
password:
|
|
minLength: 8
|
|
type: string
|
|
permissions:
|
|
items:
|
|
type: string
|
|
type: array
|
|
phone_number:
|
|
type: string
|
|
profile_picture_url:
|
|
type: string
|
|
team_role:
|
|
type: string
|
|
work_phone:
|
|
type: string
|
|
required:
|
|
- email
|
|
- first_name
|
|
- last_name
|
|
- password
|
|
- team_role
|
|
type: object
|
|
domain.EmploymentType:
|
|
enum:
|
|
- full_time
|
|
- part_time
|
|
- contract
|
|
- intern
|
|
type: string
|
|
x-enum-varnames:
|
|
- EmploymentTypeFullTime
|
|
- EmploymentTypePartTime
|
|
- EmploymentTypeContract
|
|
- EmploymentTypeIntern
|
|
domain.ErrorResponse:
|
|
properties:
|
|
error:
|
|
type: string
|
|
message:
|
|
type: string
|
|
type: object
|
|
domain.LogEntry:
|
|
properties:
|
|
caller:
|
|
type: string
|
|
env:
|
|
type: string
|
|
fields:
|
|
additionalProperties: true
|
|
type: object
|
|
level:
|
|
type: string
|
|
message:
|
|
type: string
|
|
service:
|
|
type: string
|
|
stacktrace:
|
|
type: string
|
|
timestamp:
|
|
type: string
|
|
type: object
|
|
domain.LogResponse:
|
|
properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/domain.LogEntry'
|
|
type: array
|
|
message:
|
|
type: string
|
|
pagination:
|
|
$ref: '#/definitions/domain.Pagination'
|
|
type: object
|
|
domain.LoginRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
otp_code:
|
|
type: string
|
|
password:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
type: object
|
|
domain.OtpMedium:
|
|
enum:
|
|
- email
|
|
- sms
|
|
type: string
|
|
x-enum-varnames:
|
|
- OtpMediumEmail
|
|
- OtpMediumSms
|
|
domain.Pagination:
|
|
properties:
|
|
current_page:
|
|
type: integer
|
|
limit:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
total_pages:
|
|
type: integer
|
|
type: object
|
|
domain.QuestionOption:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
id:
|
|
format: int64
|
|
type: integer
|
|
isCorrect:
|
|
type: boolean
|
|
optionOrder:
|
|
format: int32
|
|
type: integer
|
|
optionText:
|
|
type: string
|
|
questionID:
|
|
format: int64
|
|
type: integer
|
|
type: object
|
|
domain.QuestionShortAnswer:
|
|
properties:
|
|
acceptableAnswer:
|
|
type: string
|
|
createdAt:
|
|
type: string
|
|
id:
|
|
format: int64
|
|
type: integer
|
|
matchType:
|
|
type: string
|
|
questionID:
|
|
format: int64
|
|
type: integer
|
|
type: object
|
|
domain.QuestionWithDetails:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
difficultyLevel:
|
|
type: string
|
|
explanation:
|
|
type: string
|
|
id:
|
|
format: int64
|
|
type: integer
|
|
options:
|
|
items:
|
|
$ref: '#/definitions/domain.QuestionOption'
|
|
type: array
|
|
points:
|
|
format: int32
|
|
type: integer
|
|
questionText:
|
|
type: string
|
|
questionType:
|
|
type: string
|
|
sampleAnswerVoicePrompt:
|
|
type: string
|
|
shortAnswers:
|
|
items:
|
|
$ref: '#/definitions/domain.QuestionShortAnswer'
|
|
type: array
|
|
status:
|
|
type: string
|
|
tips:
|
|
type: string
|
|
updatedAt:
|
|
type: string
|
|
voicePrompt:
|
|
type: string
|
|
type: object
|
|
domain.RegisterUserReq:
|
|
properties:
|
|
email:
|
|
type: string
|
|
otp_medium:
|
|
$ref: '#/definitions/domain.OtpMedium'
|
|
password:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
role:
|
|
type: string
|
|
type: object
|
|
domain.ResendOtpReq:
|
|
properties:
|
|
email:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
type: object
|
|
domain.Response:
|
|
properties:
|
|
data: {}
|
|
message:
|
|
type: string
|
|
metadata: {}
|
|
status_code:
|
|
type: integer
|
|
success:
|
|
type: boolean
|
|
type: object
|
|
domain.Role:
|
|
enum:
|
|
- SUPER_ADMIN
|
|
- ADMIN
|
|
- STUDENT
|
|
- INSTRUCTOR
|
|
- SUPPORT
|
|
type: string
|
|
x-enum-varnames:
|
|
- RoleSuperAdmin
|
|
- RoleAdmin
|
|
- RoleStudent
|
|
- RoleInstructor
|
|
- RoleSupport
|
|
domain.TeamMemberLoginReq:
|
|
properties:
|
|
email:
|
|
type: string
|
|
password:
|
|
type: string
|
|
required:
|
|
- email
|
|
- password
|
|
type: object
|
|
domain.TeamMemberResponse:
|
|
properties:
|
|
bio:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
department:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
employment_type:
|
|
$ref: '#/definitions/domain.EmploymentType'
|
|
first_name:
|
|
type: string
|
|
hire_date:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
job_title:
|
|
type: string
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
permissions:
|
|
items:
|
|
type: string
|
|
type: array
|
|
phone_number:
|
|
type: string
|
|
profile_picture_url:
|
|
type: string
|
|
status:
|
|
$ref: '#/definitions/domain.TeamMemberStatus'
|
|
team_role:
|
|
$ref: '#/definitions/domain.TeamRole'
|
|
updated_at:
|
|
type: string
|
|
work_phone:
|
|
type: string
|
|
type: object
|
|
domain.TeamMemberStats:
|
|
properties:
|
|
active_count:
|
|
type: integer
|
|
inactive_count:
|
|
type: integer
|
|
suspended_count:
|
|
type: integer
|
|
terminated_count:
|
|
type: integer
|
|
total_count:
|
|
type: integer
|
|
type: object
|
|
domain.TeamMemberStatus:
|
|
enum:
|
|
- active
|
|
- inactive
|
|
- suspended
|
|
- terminated
|
|
type: string
|
|
x-enum-varnames:
|
|
- TeamMemberStatusActive
|
|
- TeamMemberStatusInactive
|
|
- TeamMemberStatusSuspended
|
|
- TeamMemberStatusTerminated
|
|
domain.TeamRole:
|
|
enum:
|
|
- super_admin
|
|
- admin
|
|
- content_manager
|
|
- support_agent
|
|
- instructor
|
|
- finance
|
|
- hr
|
|
- analyst
|
|
type: string
|
|
x-enum-varnames:
|
|
- TeamRoleSuperAdmin
|
|
- TeamRoleAdmin
|
|
- TeamRoleContentManager
|
|
- TeamRoleSupportAgent
|
|
- TeamRoleInstructor
|
|
- TeamRoleFinance
|
|
- TeamRoleHR
|
|
- TeamRoleAnalyst
|
|
domain.UpdateKnowledgeLevelReq:
|
|
properties:
|
|
knowledge_level:
|
|
description: BEGINNER, INTERMEDIATE, ADVANCED
|
|
type: string
|
|
user_id:
|
|
type: integer
|
|
type: object
|
|
domain.UpdateTeamMemberReq:
|
|
properties:
|
|
bio:
|
|
type: string
|
|
department:
|
|
type: string
|
|
emergency_contact:
|
|
type: string
|
|
employment_type:
|
|
type: string
|
|
first_name:
|
|
type: string
|
|
hire_date:
|
|
type: string
|
|
job_title:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
permissions:
|
|
items:
|
|
type: string
|
|
type: array
|
|
phone_number:
|
|
type: string
|
|
profile_picture_url:
|
|
type: string
|
|
team_role:
|
|
type: string
|
|
work_phone:
|
|
type: string
|
|
type: object
|
|
domain.UpdateTeamMemberStatusReq:
|
|
properties:
|
|
status:
|
|
type: string
|
|
required:
|
|
- status
|
|
type: object
|
|
domain.UpdateUserReq:
|
|
properties:
|
|
age_group:
|
|
$ref: '#/definitions/domain.AgeGroup'
|
|
birth_day:
|
|
description: YYYY-MM-DD
|
|
type: string
|
|
country:
|
|
type: string
|
|
education_level:
|
|
type: string
|
|
favourite_topic:
|
|
type: string
|
|
first_name:
|
|
type: string
|
|
gender:
|
|
type: string
|
|
initial_assessment_completed:
|
|
type: boolean
|
|
knowledge_level:
|
|
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
|
|
preferred_language:
|
|
type: string
|
|
profile_picture_url:
|
|
type: string
|
|
region:
|
|
type: string
|
|
type: object
|
|
domain.UserProfileResponse:
|
|
properties:
|
|
age_group:
|
|
type: string
|
|
birth_day:
|
|
description: formatted as YYYY-MM-DD
|
|
type: string
|
|
country:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
education_level:
|
|
type: string
|
|
email:
|
|
description: UserName string `json:"user_name,omitempty"`
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
favoutite_topic:
|
|
type: string
|
|
first_name:
|
|
type: string
|
|
gender:
|
|
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_completion_percentage:
|
|
type: integer
|
|
profile_picture_url:
|
|
type: string
|
|
region:
|
|
type: string
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
status:
|
|
$ref: '#/definitions/domain.UserStatus'
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
domain.UserStatus:
|
|
enum:
|
|
- PENDING
|
|
- ACTIVE
|
|
- SUSPENDED
|
|
- DEACTIVATED
|
|
type: string
|
|
x-enum-varnames:
|
|
- UserStatusPending
|
|
- UserStatusActive
|
|
- UserStatusSuspended
|
|
- UserStatusDeactivated
|
|
domain.VerifyOtpReq:
|
|
properties:
|
|
email:
|
|
type: string
|
|
otp:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
required:
|
|
- otp
|
|
type: object
|
|
domain.WebhookRequest:
|
|
properties:
|
|
nonce:
|
|
type: string
|
|
notificationUrl:
|
|
type: string
|
|
paymentMethod:
|
|
type: string
|
|
phone:
|
|
type: string
|
|
sessionId:
|
|
type: string
|
|
totalAmount:
|
|
type: integer
|
|
transaction:
|
|
properties:
|
|
transactionId:
|
|
type: string
|
|
transactionStatus:
|
|
type: string
|
|
type: object
|
|
transactionStatus:
|
|
type: string
|
|
uuid:
|
|
type: string
|
|
type: object
|
|
handlers.AdminProfileRes:
|
|
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
|
|
type: object
|
|
handlers.AdminRes:
|
|
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
|
|
type: object
|
|
handlers.CheckPhoneEmailExistReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.CheckPhoneEmailExistRes:
|
|
properties:
|
|
email_exist:
|
|
type: boolean
|
|
phone_number_exist:
|
|
type: boolean
|
|
type: object
|
|
handlers.CreateAdminReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.CreatePullUploadRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
file_size:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
source_url:
|
|
type: string
|
|
required:
|
|
- file_size
|
|
- name
|
|
- source_url
|
|
type: object
|
|
handlers.CreateTusUploadRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
file_size:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
required:
|
|
- file_size
|
|
- name
|
|
type: object
|
|
handlers.LoginAdminRes:
|
|
properties:
|
|
access_token:
|
|
type: string
|
|
refresh_token:
|
|
type: string
|
|
role:
|
|
type: string
|
|
type: object
|
|
handlers.RegisterCodeReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.ResetCodeReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.ResetPasswordReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
otp:
|
|
example: "123456"
|
|
type: string
|
|
password:
|
|
example: newpassword123
|
|
minLength: 8
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
required:
|
|
- otp
|
|
- password
|
|
type: object
|
|
handlers.SearchUserByNameOrPhoneReq:
|
|
properties:
|
|
query:
|
|
type: string
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
type: object
|
|
handlers.SendSingleAfroSMSReq:
|
|
properties:
|
|
message:
|
|
example: Hello world
|
|
type: string
|
|
recipient:
|
|
example: "+251912345678"
|
|
type: string
|
|
required:
|
|
- message
|
|
- recipient
|
|
type: object
|
|
handlers.VimeoEmbedResponse:
|
|
properties:
|
|
embed_html:
|
|
type: string
|
|
embed_url:
|
|
type: string
|
|
video_id:
|
|
type: string
|
|
type: object
|
|
handlers.VimeoUploadResponse:
|
|
properties:
|
|
link:
|
|
type: string
|
|
status:
|
|
type: string
|
|
upload_link:
|
|
type: string
|
|
uri:
|
|
type: string
|
|
vimeo_id:
|
|
type: string
|
|
type: object
|
|
handlers.VimeoVideoResponse:
|
|
properties:
|
|
description:
|
|
type: string
|
|
duration:
|
|
type: integer
|
|
embed_html:
|
|
type: string
|
|
embed_url:
|
|
type: string
|
|
height:
|
|
type: integer
|
|
link:
|
|
type: string
|
|
name:
|
|
type: string
|
|
status:
|
|
type: string
|
|
thumbnail_url:
|
|
type: string
|
|
transcode_status:
|
|
type: string
|
|
uri:
|
|
type: string
|
|
vimeo_id:
|
|
type: string
|
|
width:
|
|
type: integer
|
|
type: object
|
|
handlers.addQuestionToSetReq:
|
|
properties:
|
|
display_order:
|
|
type: integer
|
|
question_id:
|
|
type: integer
|
|
required:
|
|
- question_id
|
|
type: object
|
|
handlers.addUserPersonaReq:
|
|
properties:
|
|
display_order:
|
|
type: integer
|
|
user_id:
|
|
type: integer
|
|
required:
|
|
- user_id
|
|
type: object
|
|
handlers.autoRenewReq:
|
|
properties:
|
|
auto_renew:
|
|
type: boolean
|
|
type: object
|
|
handlers.changePasswordReq:
|
|
properties:
|
|
current_password:
|
|
example: oldpassword123
|
|
type: string
|
|
new_password:
|
|
example: newpassword123
|
|
minLength: 8
|
|
type: string
|
|
required:
|
|
- current_password
|
|
- new_password
|
|
type: object
|
|
handlers.createCourseCategoryReq:
|
|
properties:
|
|
name:
|
|
type: string
|
|
required:
|
|
- name
|
|
type: object
|
|
handlers.createCourseReq:
|
|
properties:
|
|
category_id:
|
|
type: integer
|
|
description:
|
|
type: string
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
required:
|
|
- category_id
|
|
- title
|
|
type: object
|
|
handlers.createIssueReq:
|
|
properties:
|
|
description:
|
|
type: string
|
|
issue_type:
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
type: object
|
|
subject:
|
|
type: string
|
|
required:
|
|
- description
|
|
- issue_type
|
|
- subject
|
|
type: object
|
|
handlers.createPlanReq:
|
|
properties:
|
|
currency:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration_unit:
|
|
enum:
|
|
- DAY
|
|
- WEEK
|
|
- MONTH
|
|
- YEAR
|
|
type: string
|
|
duration_value:
|
|
minimum: 1
|
|
type: integer
|
|
is_active:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
price:
|
|
minimum: 0
|
|
type: number
|
|
required:
|
|
- currency
|
|
- duration_unit
|
|
- duration_value
|
|
- name
|
|
- price
|
|
type: object
|
|
handlers.createQuestionReq:
|
|
properties:
|
|
difficulty_level:
|
|
type: string
|
|
explanation:
|
|
type: string
|
|
options:
|
|
items:
|
|
$ref: '#/definitions/handlers.optionInput'
|
|
type: array
|
|
points:
|
|
type: integer
|
|
question_text:
|
|
type: string
|
|
question_type:
|
|
enum:
|
|
- MCQ
|
|
- TRUE_FALSE
|
|
- SHORT_ANSWER
|
|
type: string
|
|
sample_answer_voice_prompt:
|
|
type: string
|
|
short_answers:
|
|
items:
|
|
$ref: '#/definitions/handlers.shortAnswerInput'
|
|
type: array
|
|
status:
|
|
type: string
|
|
tips:
|
|
type: string
|
|
voice_prompt:
|
|
type: string
|
|
required:
|
|
- question_text
|
|
- question_type
|
|
type: object
|
|
handlers.createQuestionSetReq:
|
|
properties:
|
|
banner_image:
|
|
type: string
|
|
description:
|
|
type: string
|
|
owner_id:
|
|
type: integer
|
|
owner_type:
|
|
type: string
|
|
passing_score:
|
|
type: integer
|
|
persona:
|
|
type: string
|
|
set_type:
|
|
enum:
|
|
- PRACTICE
|
|
- INITIAL_ASSESSMENT
|
|
- QUIZ
|
|
- EXAM
|
|
- SURVEY
|
|
type: string
|
|
shuffle_questions:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
sub_course_video_id:
|
|
type: integer
|
|
time_limit_minutes:
|
|
type: integer
|
|
title:
|
|
type: string
|
|
required:
|
|
- set_type
|
|
- title
|
|
type: object
|
|
handlers.createSubCourseReq:
|
|
properties:
|
|
course_id:
|
|
type: integer
|
|
description:
|
|
type: string
|
|
display_order:
|
|
type: integer
|
|
level:
|
|
description: BEGINNER, INTERMEDIATE, ADVANCED
|
|
type: string
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
required:
|
|
- course_id
|
|
- level
|
|
- title
|
|
type: object
|
|
handlers.createSubCourseVideoReq:
|
|
properties:
|
|
description:
|
|
type: string
|
|
display_order:
|
|
type: integer
|
|
duration:
|
|
type: integer
|
|
instructor_id:
|
|
type: string
|
|
resolution:
|
|
type: string
|
|
status:
|
|
description: DRAFT, PUBLISHED, INACTIVE, ARCHIVED
|
|
type: string
|
|
sub_course_id:
|
|
type: integer
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
video_url:
|
|
type: string
|
|
visibility:
|
|
type: string
|
|
required:
|
|
- duration
|
|
- sub_course_id
|
|
- title
|
|
- video_url
|
|
type: object
|
|
handlers.createVideoFromVimeoIDReq:
|
|
properties:
|
|
description:
|
|
type: string
|
|
display_order:
|
|
type: integer
|
|
instructor_id:
|
|
type: string
|
|
sub_course_id:
|
|
type: integer
|
|
title:
|
|
type: string
|
|
vimeo_video_id:
|
|
type: string
|
|
required:
|
|
- sub_course_id
|
|
- title
|
|
- vimeo_video_id
|
|
type: object
|
|
handlers.createVimeoVideoReq:
|
|
properties:
|
|
description:
|
|
type: string
|
|
display_order:
|
|
type: integer
|
|
duration:
|
|
type: integer
|
|
file_size:
|
|
type: integer
|
|
instructor_id:
|
|
type: string
|
|
resolution:
|
|
type: string
|
|
source_url:
|
|
type: string
|
|
sub_course_id:
|
|
type: integer
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
visibility:
|
|
type: string
|
|
required:
|
|
- file_size
|
|
- source_url
|
|
- sub_course_id
|
|
- title
|
|
type: object
|
|
handlers.initiateDirectPaymentReq:
|
|
properties:
|
|
email:
|
|
type: string
|
|
payment_method:
|
|
type: string
|
|
phone:
|
|
type: string
|
|
plan_id:
|
|
type: integer
|
|
required:
|
|
- email
|
|
- payment_method
|
|
- phone
|
|
- plan_id
|
|
type: object
|
|
handlers.initiatePaymentReq:
|
|
properties:
|
|
email:
|
|
type: string
|
|
phone:
|
|
type: string
|
|
plan_id:
|
|
type: integer
|
|
required:
|
|
- email
|
|
- phone
|
|
- plan_id
|
|
type: object
|
|
handlers.issueListRes:
|
|
properties:
|
|
issues:
|
|
items:
|
|
$ref: '#/definitions/handlers.issueRes'
|
|
type: array
|
|
total_count:
|
|
type: integer
|
|
type: object
|
|
handlers.issueRes:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
issue_type:
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
type: object
|
|
status:
|
|
type: string
|
|
subject:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
user_id:
|
|
type: integer
|
|
user_role:
|
|
type: string
|
|
type: object
|
|
handlers.loginUserRes:
|
|
properties:
|
|
access_token:
|
|
type: string
|
|
refresh_token:
|
|
type: string
|
|
role:
|
|
type: string
|
|
user_id:
|
|
type: integer
|
|
type: object
|
|
handlers.logoutReq:
|
|
properties:
|
|
device_token:
|
|
example: <fcm-device-token>
|
|
type: string
|
|
refresh_token:
|
|
example: <refresh-token>
|
|
type: string
|
|
required:
|
|
- refresh_token
|
|
type: object
|
|
handlers.optionInput:
|
|
properties:
|
|
is_correct:
|
|
type: boolean
|
|
option_order:
|
|
type: integer
|
|
option_text:
|
|
type: string
|
|
required:
|
|
- option_text
|
|
type: object
|
|
handlers.refreshToken:
|
|
properties:
|
|
access_token:
|
|
example: <jwt-token>
|
|
type: string
|
|
refresh_token:
|
|
example: <refresh-token>
|
|
type: string
|
|
required:
|
|
- access_token
|
|
- refresh_token
|
|
type: object
|
|
handlers.shortAnswerInput:
|
|
properties:
|
|
acceptable_answer:
|
|
type: string
|
|
match_type:
|
|
type: string
|
|
required:
|
|
- acceptable_answer
|
|
type: object
|
|
handlers.submitRatingReq:
|
|
properties:
|
|
review:
|
|
type: string
|
|
stars:
|
|
maximum: 5
|
|
minimum: 1
|
|
type: integer
|
|
target_id:
|
|
type: integer
|
|
target_type:
|
|
type: string
|
|
required:
|
|
- stars
|
|
- target_type
|
|
type: object
|
|
handlers.subscribeReq:
|
|
properties:
|
|
payment_method:
|
|
type: string
|
|
payment_reference:
|
|
type: string
|
|
plan_id:
|
|
type: integer
|
|
required:
|
|
- plan_id
|
|
type: object
|
|
handlers.subscribeWithPaymentReq:
|
|
properties:
|
|
email:
|
|
type: string
|
|
phone:
|
|
type: string
|
|
plan_id:
|
|
type: integer
|
|
required:
|
|
- email
|
|
- phone
|
|
- plan_id
|
|
type: object
|
|
handlers.teamMemberLoginRes:
|
|
properties:
|
|
access_token:
|
|
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
|
type: string
|
|
member_id:
|
|
example: 1
|
|
type: integer
|
|
refresh_token:
|
|
example: ""
|
|
type: string
|
|
team_role:
|
|
example: admin
|
|
type: string
|
|
type: object
|
|
handlers.updateAdminReq:
|
|
properties:
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
suspended:
|
|
example: false
|
|
type: boolean
|
|
type: object
|
|
handlers.updateCourseCategoryReq:
|
|
properties:
|
|
is_active:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
type: object
|
|
handlers.updateCourseReq:
|
|
properties:
|
|
description:
|
|
type: string
|
|
is_active:
|
|
type: boolean
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
type: object
|
|
handlers.updateIssueStatusReq:
|
|
properties:
|
|
status:
|
|
enum:
|
|
- pending
|
|
- in_progress
|
|
- resolved
|
|
- rejected
|
|
type: string
|
|
required:
|
|
- status
|
|
type: object
|
|
handlers.updatePlanReq:
|
|
properties:
|
|
currency:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration_unit:
|
|
type: string
|
|
duration_value:
|
|
type: integer
|
|
is_active:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
price:
|
|
type: number
|
|
type: object
|
|
handlers.updateQuestionOrderReq:
|
|
properties:
|
|
display_order:
|
|
type: integer
|
|
required:
|
|
- display_order
|
|
type: object
|
|
handlers.updateQuestionReq:
|
|
properties:
|
|
difficulty_level:
|
|
type: string
|
|
explanation:
|
|
type: string
|
|
options:
|
|
items:
|
|
$ref: '#/definitions/handlers.optionInput'
|
|
type: array
|
|
points:
|
|
type: integer
|
|
question_text:
|
|
type: string
|
|
question_type:
|
|
type: string
|
|
sample_answer_voice_prompt:
|
|
type: string
|
|
short_answers:
|
|
items:
|
|
$ref: '#/definitions/handlers.shortAnswerInput'
|
|
type: array
|
|
status:
|
|
type: string
|
|
tips:
|
|
type: string
|
|
voice_prompt:
|
|
type: string
|
|
type: object
|
|
handlers.updateQuestionSetReq:
|
|
properties:
|
|
banner_image:
|
|
type: string
|
|
description:
|
|
type: string
|
|
passing_score:
|
|
type: integer
|
|
persona:
|
|
type: string
|
|
shuffle_questions:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
sub_course_video_id:
|
|
type: integer
|
|
time_limit_minutes:
|
|
type: integer
|
|
title:
|
|
type: string
|
|
type: object
|
|
handlers.updateSubCourseReq:
|
|
properties:
|
|
description:
|
|
type: string
|
|
display_order:
|
|
type: integer
|
|
is_active:
|
|
type: boolean
|
|
level:
|
|
type: string
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
type: object
|
|
handlers.updateSubCourseVideoReq:
|
|
properties:
|
|
description:
|
|
type: string
|
|
display_order:
|
|
type: integer
|
|
duration:
|
|
type: integer
|
|
resolution:
|
|
type: string
|
|
status:
|
|
description: DRAFT, PUBLISHED, INACTIVE, ARCHIVED
|
|
type: string
|
|
thumbnail:
|
|
type: string
|
|
title:
|
|
type: string
|
|
video_url:
|
|
type: string
|
|
visibility:
|
|
type: string
|
|
type: object
|
|
handlers.verifyOTPReq:
|
|
properties:
|
|
otp:
|
|
type: string
|
|
session_id:
|
|
type: string
|
|
required:
|
|
- otp
|
|
- session_id
|
|
type: object
|
|
response.APIResponse:
|
|
properties:
|
|
data: {}
|
|
message:
|
|
type: string
|
|
metadata: {}
|
|
page:
|
|
type: integer
|
|
status:
|
|
$ref: '#/definitions/response.Status'
|
|
timestamp:
|
|
type: string
|
|
total:
|
|
type: integer
|
|
type: object
|
|
response.Status:
|
|
enum:
|
|
- error
|
|
- success
|
|
type: string
|
|
x-enum-varnames:
|
|
- Error
|
|
- Success
|
|
vimeo.OEmbedResponse:
|
|
properties:
|
|
author_name:
|
|
type: string
|
|
author_url:
|
|
type: string
|
|
description:
|
|
type: string
|
|
duration:
|
|
type: integer
|
|
height:
|
|
type: integer
|
|
html:
|
|
type: string
|
|
is_plus:
|
|
type: string
|
|
provider_name:
|
|
type: string
|
|
provider_url:
|
|
type: string
|
|
thumbnail_height:
|
|
type: integer
|
|
thumbnail_url:
|
|
type: string
|
|
thumbnail_width:
|
|
type: integer
|
|
title:
|
|
type: string
|
|
type:
|
|
type: string
|
|
version:
|
|
type: string
|
|
video_id:
|
|
type: integer
|
|
width:
|
|
type: integer
|
|
type: object
|
|
info:
|
|
contact:
|
|
email: support@swagger.io
|
|
name: API Support
|
|
url: http://www.swagger.io/support
|
|
description: This is server for Yimaru.
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
termsOfService: http://swagger.io/terms/
|
|
title: Yimaru API
|
|
version: 1.0.1
|
|
paths:
|
|
/api/v1/{tenant_slug}/admin-login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Login user
|
|
parameters:
|
|
- description: Login admin
|
|
in: body
|
|
name: login
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.LoginRequest'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Login user
|
|
tags:
|
|
- auth
|
|
/api/v1/{tenant_slug}/otp/resend:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Resend OTP if the previous one is expired
|
|
parameters:
|
|
- description: Resend OTP
|
|
in: body
|
|
name: resendOtp
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.ResendOtpReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Resend OTP
|
|
tags:
|
|
- otp
|
|
/api/v1/{tenant_slug}/user-login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Login user
|
|
parameters:
|
|
- description: Login user
|
|
in: body
|
|
name: login
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.LoginRequest'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Login user
|
|
tags:
|
|
- auth
|
|
/api/v1/{tenant_slug}/user/admin-profile:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get user profile
|
|
produces:
|
|
- application/json
|
|
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'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get user profile
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/checkPhoneEmailExist:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Check if phone number or email exist
|
|
parameters:
|
|
- description: Check phone number or email exist
|
|
in: body
|
|
name: checkPhoneEmailExist
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CheckPhoneEmailExistReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Check if phone number or email exist
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/knowledge-level:
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates the knowledge level of the specified user after initial
|
|
assessment
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: user_id
|
|
required: true
|
|
type: integer
|
|
- description: Knowledge level
|
|
in: body
|
|
name: knowledge_level
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateKnowledgeLevelReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update user's knowledge level
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/register:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Register user
|
|
parameters:
|
|
- description: Register user
|
|
in: body
|
|
name: registerUser
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.RegisterUserReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Register user
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/resetPassword:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Reset tenant password
|
|
parameters:
|
|
- description: Reset password
|
|
in: body
|
|
name: resetPassword
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetPasswordReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Reset tenant password
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/sendRegisterCode:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Send register code
|
|
parameters:
|
|
- description: Send register code
|
|
in: body
|
|
name: registerCode
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.RegisterCodeReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Send register code
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/sendResetCode:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Send reset code
|
|
parameters:
|
|
- description: Send reset code
|
|
in: body
|
|
name: resetCode
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetCodeReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Send reset code
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/user-profile:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get user profile
|
|
produces:
|
|
- application/json
|
|
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'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get user profile
|
|
tags:
|
|
- user
|
|
/api/v1/activity-logs:
|
|
get:
|
|
description: Returns a filtered, paginated list of activity logs
|
|
parameters:
|
|
- description: Filter by actor ID
|
|
in: query
|
|
name: actor_id
|
|
type: integer
|
|
- description: Filter by action
|
|
in: query
|
|
name: action
|
|
type: string
|
|
- description: Filter by resource type
|
|
in: query
|
|
name: resource_type
|
|
type: string
|
|
- description: Filter by resource ID
|
|
in: query
|
|
name: resource_id
|
|
type: integer
|
|
- description: Filter logs after this RFC3339 timestamp
|
|
in: query
|
|
name: after
|
|
type: string
|
|
- description: Filter logs before this RFC3339 timestamp
|
|
in: query
|
|
name: before
|
|
type: string
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get activity logs
|
|
tags:
|
|
- activity-logs
|
|
/api/v1/activity-logs/{id}:
|
|
get:
|
|
description: Returns a single activity log entry by its ID
|
|
parameters:
|
|
- description: Activity Log ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get activity log by ID
|
|
tags:
|
|
- activity-logs
|
|
/api/v1/admin:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all Admins
|
|
parameters:
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get all Admins
|
|
tags:
|
|
- admin
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create Admin
|
|
parameters:
|
|
- description: Create admin
|
|
in: body
|
|
name: manger
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CreateAdminReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Create Admin
|
|
tags:
|
|
- admin
|
|
/api/v1/admin/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single admin by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get admin by id
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update Admin
|
|
parameters:
|
|
- description: Update Admin
|
|
in: body
|
|
name: admin
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateAdminReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update Admin
|
|
tags:
|
|
- admin
|
|
/api/v1/assessment/questions:
|
|
get:
|
|
description: Returns all active assessment questions from the initial assessment
|
|
set
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.QuestionWithDetails'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: List assessment questions
|
|
tags:
|
|
- assessment-question
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new assessment question using the unified questions system
|
|
parameters:
|
|
- description: Create question payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createQuestionReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create assessment question
|
|
tags:
|
|
- assessment-question
|
|
/api/v1/assessment/questions/{id}:
|
|
get:
|
|
description: Returns a single assessment question with its options or answer
|
|
parameters:
|
|
- description: Question ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.QuestionWithDetails'
|
|
"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'
|
|
summary: Get assessment question by ID
|
|
tags:
|
|
- assessment-question
|
|
/api/v1/auth/google/android:
|
|
post:
|
|
parameters:
|
|
- description: Google ID Token from Android
|
|
in: body
|
|
name: idToken
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses: {}
|
|
summary: Login via Google Android ID Token
|
|
tags:
|
|
- auth
|
|
/api/v1/auth/google/callback:
|
|
get:
|
|
responses: {}
|
|
summary: Google login callback
|
|
tags:
|
|
- auth
|
|
/api/v1/auth/google/login:
|
|
get:
|
|
responses: {}
|
|
summary: Google login redirect
|
|
tags:
|
|
- auth
|
|
/api/v1/auth/logout:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Logout user
|
|
parameters:
|
|
- description: Logout user
|
|
in: body
|
|
name: logout
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.logoutReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Logout user
|
|
tags:
|
|
- auth
|
|
/api/v1/auth/refresh:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Refresh token
|
|
parameters:
|
|
- description: tokens
|
|
in: body
|
|
name: refresh
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.refreshToken'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Refresh token
|
|
tags:
|
|
- auth
|
|
/api/v1/course-management/categories:
|
|
get:
|
|
description: Returns a paginated list of all course categories
|
|
parameters:
|
|
- default: 10
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get all course categories
|
|
tags:
|
|
- course-categories
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new course category with the provided name
|
|
parameters:
|
|
- description: Create category payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createCourseCategoryReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new course category
|
|
tags:
|
|
- course-categories
|
|
/api/v1/course-management/categories/{categoryId}/courses:
|
|
get:
|
|
description: Returns a paginated list of courses under a specific category
|
|
parameters:
|
|
- description: Category ID
|
|
in: path
|
|
name: categoryId
|
|
required: true
|
|
type: integer
|
|
- default: 10
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get courses by category
|
|
tags:
|
|
- courses
|
|
/api/v1/course-management/categories/{id}:
|
|
delete:
|
|
description: Deletes a course category by its ID
|
|
parameters:
|
|
- description: Category ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete course category
|
|
tags:
|
|
- course-categories
|
|
get:
|
|
description: Returns a single course category by its ID
|
|
parameters:
|
|
- description: Category ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get course category by ID
|
|
tags:
|
|
- course-categories
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a course category's name and/or active status
|
|
parameters:
|
|
- description: Category ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update category payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateCourseCategoryReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update course category
|
|
tags:
|
|
- course-categories
|
|
/api/v1/course-management/courses:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new course under a specific category
|
|
parameters:
|
|
- description: Create course payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createCourseReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new course
|
|
tags:
|
|
- courses
|
|
/api/v1/course-management/courses/{courseId}/sub-courses:
|
|
get:
|
|
description: Returns all sub-courses under a specific course
|
|
parameters:
|
|
- description: Course ID
|
|
in: path
|
|
name: courseId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get sub-courses by course
|
|
tags:
|
|
- sub-courses
|
|
/api/v1/course-management/courses/{courseId}/sub-courses/list:
|
|
get:
|
|
description: Returns a list of active sub-courses under a specific course
|
|
parameters:
|
|
- description: Course ID
|
|
in: path
|
|
name: courseId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: List active sub-courses by course
|
|
tags:
|
|
- sub-courses
|
|
/api/v1/course-management/courses/{id}:
|
|
delete:
|
|
description: Deletes a course by its ID
|
|
parameters:
|
|
- description: Course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete course
|
|
tags:
|
|
- courses
|
|
get:
|
|
description: Returns a single course by its ID
|
|
parameters:
|
|
- description: Course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get course by ID
|
|
tags:
|
|
- courses
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a course's title, description, and/or active status
|
|
parameters:
|
|
- description: Course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update course payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateCourseReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update course
|
|
tags:
|
|
- courses
|
|
/api/v1/course-management/courses/{id}/thumbnail:
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: Uploads and optimizes a thumbnail image, then updates the course
|
|
parameters:
|
|
- description: Course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Thumbnail image file (jpg, png, webp)
|
|
in: formData
|
|
name: file
|
|
required: true
|
|
type: file
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Upload a thumbnail image for a course
|
|
tags:
|
|
- courses
|
|
/api/v1/course-management/learning-tree:
|
|
get:
|
|
description: Returns the complete learning tree structure with courses and sub-courses
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get full learning tree
|
|
tags:
|
|
- learning-tree
|
|
/api/v1/course-management/sub-courses:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new sub-course under a specific course
|
|
parameters:
|
|
- description: Create sub-course payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createSubCourseReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new sub-course
|
|
tags:
|
|
- sub-courses
|
|
/api/v1/course-management/sub-courses/{id}:
|
|
delete:
|
|
description: Deletes a sub-course by its ID
|
|
parameters:
|
|
- description: Sub-course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete sub-course
|
|
tags:
|
|
- sub-courses
|
|
get:
|
|
description: Returns a single sub-course by its ID
|
|
parameters:
|
|
- description: Sub-course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get sub-course by ID
|
|
tags:
|
|
- sub-courses
|
|
patch:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a sub-course's fields
|
|
parameters:
|
|
- description: Sub-course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update sub-course payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateSubCourseReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update sub-course
|
|
tags:
|
|
- sub-courses
|
|
/api/v1/course-management/sub-courses/{id}/deactivate:
|
|
put:
|
|
description: Deactivates a sub-course by its ID
|
|
parameters:
|
|
- description: Sub-course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Deactivate sub-course
|
|
tags:
|
|
- sub-courses
|
|
/api/v1/course-management/sub-courses/{id}/thumbnail:
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: Uploads and optimizes a thumbnail image, then updates the sub-course
|
|
parameters:
|
|
- description: Sub-course ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Thumbnail image file (jpg, png, webp)
|
|
in: formData
|
|
name: file
|
|
required: true
|
|
type: file
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Upload a thumbnail image for a sub-course
|
|
tags:
|
|
- sub-courses
|
|
/api/v1/course-management/sub-courses/{subCourseId}/videos:
|
|
get:
|
|
description: Returns all videos under a specific sub-course
|
|
parameters:
|
|
- description: Sub-course ID
|
|
in: path
|
|
name: subCourseId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get videos by sub-course
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/course-management/sub-courses/{subCourseId}/videos/published:
|
|
get:
|
|
description: Returns all published videos under a specific sub-course
|
|
parameters:
|
|
- description: Sub-course ID
|
|
in: path
|
|
name: subCourseId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get published videos by sub-course
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/course-management/sub-courses/active:
|
|
get:
|
|
description: Returns a list of all active sub-courses
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: List all active sub-courses
|
|
tags:
|
|
- sub-courses
|
|
/api/v1/course-management/videos:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new video under a specific sub-course
|
|
parameters:
|
|
- description: Create video payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createSubCourseVideoReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new sub-course video
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/course-management/videos/{id}:
|
|
delete:
|
|
description: Archives a video by its ID (soft delete)
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete sub-course video
|
|
tags:
|
|
- sub-course-videos
|
|
get:
|
|
description: Returns a single video by its ID
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get sub-course video by ID
|
|
tags:
|
|
- sub-course-videos
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a video's fields
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update video payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateSubCourseVideoReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update sub-course video
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/course-management/videos/{id}/publish:
|
|
put:
|
|
description: Publishes a video by its ID
|
|
parameters:
|
|
- description: Video ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Publish sub-course video
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/course-management/videos/upload:
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: Accepts a video file upload, uploads it to Vimeo via TUS, and creates
|
|
a sub-course video record
|
|
parameters:
|
|
- description: Video file
|
|
in: formData
|
|
name: file
|
|
required: true
|
|
type: file
|
|
- description: Sub-course ID
|
|
in: formData
|
|
name: sub_course_id
|
|
required: true
|
|
type: integer
|
|
- description: Video title
|
|
in: formData
|
|
name: title
|
|
required: true
|
|
type: string
|
|
- description: Video description
|
|
in: formData
|
|
name: description
|
|
type: string
|
|
- description: Duration in seconds
|
|
in: formData
|
|
name: duration
|
|
type: integer
|
|
- description: Video resolution
|
|
in: formData
|
|
name: resolution
|
|
type: string
|
|
- description: Instructor ID
|
|
in: formData
|
|
name: instructor_id
|
|
type: string
|
|
- description: Thumbnail URL
|
|
in: formData
|
|
name: thumbnail
|
|
type: string
|
|
- description: Visibility
|
|
in: formData
|
|
name: visibility
|
|
type: string
|
|
- description: Display order
|
|
in: formData
|
|
name: display_order
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Upload a video file and create sub-course video
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/course-management/videos/vimeo:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a video by uploading to Vimeo from a source URL
|
|
parameters:
|
|
- description: Create Vimeo video payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createVimeoVideoReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new sub-course video with Vimeo upload
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/course-management/videos/vimeo/import:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a video record from an existing Vimeo video ID
|
|
parameters:
|
|
- description: Create from Vimeo ID payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createVideoFromVimeoIDReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a sub-course video from existing Vimeo video
|
|
tags:
|
|
- sub-course-videos
|
|
/api/v1/issues:
|
|
get:
|
|
description: Returns all reported issues with pagination (admin only)
|
|
parameters:
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/handlers.issueListRes'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get all issues
|
|
tags:
|
|
- issues
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Allows any authenticated user to report an issue they encountered
|
|
parameters:
|
|
- description: Issue report payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createIssueReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/handlers.issueRes'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Report an issue
|
|
tags:
|
|
- issues
|
|
/api/v1/issues/{id}:
|
|
delete:
|
|
description: Deletes an issue report (admin only)
|
|
parameters:
|
|
- description: Issue ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
security:
|
|
- Bearer: []
|
|
summary: Delete an issue
|
|
tags:
|
|
- issues
|
|
get:
|
|
description: Returns a single issue report by its ID (admin only)
|
|
parameters:
|
|
- description: Issue ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/handlers.issueRes'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get issue by ID
|
|
tags:
|
|
- issues
|
|
/api/v1/issues/{id}/status:
|
|
patch:
|
|
consumes:
|
|
- application/json
|
|
description: Updates the status of an issue (admin only)
|
|
parameters:
|
|
- description: Issue ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Status update payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateIssueStatusReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
security:
|
|
- Bearer: []
|
|
summary: Update issue status
|
|
tags:
|
|
- issues
|
|
/api/v1/issues/me:
|
|
get:
|
|
description: Returns paginated issues reported by the authenticated user
|
|
parameters:
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/handlers.issueListRes'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get my reported issues
|
|
tags:
|
|
- issues
|
|
/api/v1/issues/user/{user_id}:
|
|
get:
|
|
description: Returns paginated issues reported by a specific user (admin only)
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: user_id
|
|
required: true
|
|
type: integer
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/handlers.issueListRes'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get issues for a specific user
|
|
tags:
|
|
- issues
|
|
/api/v1/logs:
|
|
get:
|
|
description: Fetches application logs from MongoDB with pagination, level filtering,
|
|
and search
|
|
parameters:
|
|
- description: Filter logs by level (debug, info, warn, error, dpanic, panic,
|
|
fatal)
|
|
in: query
|
|
name: level
|
|
type: string
|
|
- description: Search term to match against message or fields
|
|
in: query
|
|
name: search
|
|
type: string
|
|
- default: 1
|
|
description: 'Page number for pagination (default: 1)'
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 50
|
|
description: 'Number of items per page (default: 50, max: 100)'
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Retrieve application logs with filtering and pagination
|
|
tags:
|
|
- Logs
|
|
/api/v1/notifications/test-push:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Sends a test push notification to all registered devices of the
|
|
current user
|
|
parameters:
|
|
- description: Test notification content
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
properties:
|
|
message:
|
|
type: string
|
|
title:
|
|
type: string
|
|
type: object
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Send test push notification
|
|
tags:
|
|
- notifications
|
|
/api/v1/payments:
|
|
get:
|
|
description: Returns the authenticated user's payment history
|
|
parameters:
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
summary: Get payment history
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/{id}:
|
|
get:
|
|
description: Returns details of a specific payment
|
|
parameters:
|
|
- description: Payment ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get payment details
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/{id}/cancel:
|
|
post:
|
|
description: Cancels a payment that is still pending
|
|
parameters:
|
|
- description: Payment ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Cancel a pending payment
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/direct:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a payment session and initiates direct payment (OTP-based)
|
|
parameters:
|
|
- description: Direct payment request
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.initiateDirectPaymentReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Initiate direct payment
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/direct/methods:
|
|
get:
|
|
description: Returns list of payment methods that support direct payment (OTP-based)
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
summary: Get direct payment methods
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/direct/verify-otp:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Verifies the OTP sent for direct payment methods (Amole, HelloCash,
|
|
etc.)
|
|
parameters:
|
|
- description: OTP verification request
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.verifyOTPReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Verify OTP for direct payment
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/methods:
|
|
get:
|
|
description: Returns list of supported ArifPay payment methods
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
summary: Get available payment methods
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/subscribe:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a payment session for a subscription plan
|
|
parameters:
|
|
- description: Payment request
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.initiatePaymentReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Initiate subscription payment
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/verify/{session_id}:
|
|
get:
|
|
description: Checks the payment status with the payment provider
|
|
parameters:
|
|
- description: Session ID
|
|
in: path
|
|
name: session_id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Verify payment status
|
|
tags:
|
|
- payments
|
|
/api/v1/payments/webhook:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Processes payment notifications from ArifPay
|
|
parameters:
|
|
- description: Webhook payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.WebhookRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Handle ArifPay webhook
|
|
tags:
|
|
- payments
|
|
/api/v1/question-sets:
|
|
get:
|
|
description: Returns a paginated list of question sets filtered by type
|
|
parameters:
|
|
- description: Set type (PRACTICE, INITIAL_ASSESSMENT, QUIZ, EXAM, SURVEY)
|
|
in: query
|
|
name: set_type
|
|
required: true
|
|
type: string
|
|
- default: 10
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get question sets by type
|
|
tags:
|
|
- question-sets
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new question set (practice, assessment, quiz, exam, or
|
|
survey)
|
|
parameters:
|
|
- description: Create question set payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createQuestionSetReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new question set
|
|
tags:
|
|
- question-sets
|
|
/api/v1/question-sets/{id}:
|
|
delete:
|
|
description: Archives a question set (soft delete)
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete a question set
|
|
tags:
|
|
- question-sets
|
|
get:
|
|
description: Returns a question set with question count
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get question set by ID
|
|
tags:
|
|
- question-sets
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a question set's properties
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update question set payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateQuestionSetReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update a question set
|
|
tags:
|
|
- question-sets
|
|
/api/v1/question-sets/{setId}/personas:
|
|
get:
|
|
description: Returns all users assigned as personas to a question set (practice)
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: setId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get user personas for a question set
|
|
tags:
|
|
- question-sets
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Links a user as a persona to a question set (practice)
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: setId
|
|
required: true
|
|
type: integer
|
|
- description: Add user persona payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.addUserPersonaReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Add a user as persona to a question set
|
|
tags:
|
|
- question-sets
|
|
/api/v1/question-sets/{setId}/personas/{userId}:
|
|
delete:
|
|
description: Unlinks a user as persona from a question set (practice)
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: setId
|
|
required: true
|
|
type: integer
|
|
- description: User ID
|
|
in: path
|
|
name: userId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Remove a user persona from a question set
|
|
tags:
|
|
- question-sets
|
|
/api/v1/question-sets/{setId}/questions:
|
|
get:
|
|
description: Returns all questions in a question set with details
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: setId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get questions in set
|
|
tags:
|
|
- question-set-items
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Links a question to a question set
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: setId
|
|
required: true
|
|
type: integer
|
|
- description: Add question to set payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.addQuestionToSetReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Add question to set
|
|
tags:
|
|
- question-set-items
|
|
/api/v1/question-sets/{setId}/questions/{questionId}:
|
|
delete:
|
|
description: Unlinks a question from a question set
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: setId
|
|
required: true
|
|
type: integer
|
|
- description: Question ID
|
|
in: path
|
|
name: questionId
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Remove question from set
|
|
tags:
|
|
- question-set-items
|
|
/api/v1/question-sets/{setId}/questions/{questionId}/order:
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates the display order of a question in a set
|
|
parameters:
|
|
- description: Question Set ID
|
|
in: path
|
|
name: setId
|
|
required: true
|
|
type: integer
|
|
- description: Question ID
|
|
in: path
|
|
name: questionId
|
|
required: true
|
|
type: integer
|
|
- description: Update order payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateQuestionOrderReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update question order in set
|
|
tags:
|
|
- question-set-items
|
|
/api/v1/question-sets/by-owner:
|
|
get:
|
|
description: Returns question sets for a specific owner (e.g., sub-course)
|
|
parameters:
|
|
- description: Owner type (SUB_COURSE, COURSE, CATEGORY, STANDALONE)
|
|
in: query
|
|
name: owner_type
|
|
required: true
|
|
type: string
|
|
- description: Owner ID
|
|
in: query
|
|
name: owner_id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get question sets by owner
|
|
tags:
|
|
- question-sets
|
|
/api/v1/questions:
|
|
get:
|
|
description: Returns a paginated list of questions with optional filters
|
|
parameters:
|
|
- description: Question type filter (MCQ, TRUE_FALSE, SHORT_ANSWER)
|
|
in: query
|
|
name: question_type
|
|
type: string
|
|
- description: Difficulty level filter (EASY, MEDIUM, HARD)
|
|
in: query
|
|
name: difficulty
|
|
type: string
|
|
- description: Status filter (DRAFT, PUBLISHED, INACTIVE)
|
|
in: query
|
|
name: status
|
|
type: string
|
|
- default: 10
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: List questions
|
|
tags:
|
|
- questions
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new question with options (for MCQ/TRUE_FALSE) or short
|
|
answers (for SHORT_ANSWER)
|
|
parameters:
|
|
- description: Create question payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createQuestionReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new question
|
|
tags:
|
|
- questions
|
|
/api/v1/questions/{id}:
|
|
delete:
|
|
description: Archives a question (soft delete)
|
|
parameters:
|
|
- description: Question ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete a question
|
|
tags:
|
|
- questions
|
|
get:
|
|
description: Returns a question with its options/short answers
|
|
parameters:
|
|
- description: Question ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get question by ID
|
|
tags:
|
|
- questions
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a question and optionally replaces its options/short answers
|
|
parameters:
|
|
- description: Question ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update question payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateQuestionReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update a question
|
|
tags:
|
|
- questions
|
|
/api/v1/questions/search:
|
|
get:
|
|
description: Search questions by text
|
|
parameters:
|
|
- description: Search query
|
|
in: query
|
|
name: q
|
|
required: true
|
|
type: string
|
|
- default: 10
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Search questions
|
|
tags:
|
|
- questions
|
|
/api/v1/ratings:
|
|
get:
|
|
description: Returns paginated ratings for a specific target
|
|
parameters:
|
|
- description: Target type (app, course, sub_course)
|
|
in: query
|
|
name: target_type
|
|
required: true
|
|
type: string
|
|
- description: Target ID (0 for app)
|
|
in: query
|
|
name: target_id
|
|
required: true
|
|
type: integer
|
|
- description: Limit (default 20)
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Offset (default 0)
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get ratings for a target
|
|
tags:
|
|
- ratings
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Submit a rating for an app, course, or sub-course
|
|
parameters:
|
|
- description: Submit rating payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.submitRatingReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Submit a rating
|
|
tags:
|
|
- ratings
|
|
/api/v1/ratings/{id}:
|
|
delete:
|
|
description: Deletes a rating by ID for the current user
|
|
parameters:
|
|
- description: Rating ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete a rating
|
|
tags:
|
|
- ratings
|
|
/api/v1/ratings/me:
|
|
get:
|
|
description: Returns the current user's rating for a specific target
|
|
parameters:
|
|
- description: Target type (app, course, sub_course)
|
|
in: query
|
|
name: target_type
|
|
required: true
|
|
type: string
|
|
- description: Target ID (0 for app)
|
|
in: query
|
|
name: target_id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get my rating for a target
|
|
tags:
|
|
- ratings
|
|
/api/v1/ratings/me/all:
|
|
get:
|
|
description: Returns all ratings submitted by the current user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get all my ratings
|
|
tags:
|
|
- ratings
|
|
/api/v1/ratings/summary:
|
|
get:
|
|
description: Returns the total count and average stars for a specific target
|
|
parameters:
|
|
- description: Target type (app, course, sub_course)
|
|
in: query
|
|
name: target_type
|
|
required: true
|
|
type: string
|
|
- description: Target ID (0 for app)
|
|
in: query
|
|
name: target_id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get rating summary for a target
|
|
tags:
|
|
- ratings
|
|
/api/v1/sendSMS:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Sends an SMS message to a single phone number using AfroMessage
|
|
parameters:
|
|
- description: Send SMS request
|
|
in: body
|
|
name: sendSMS
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.SendSingleAfroSMSReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Send single SMS via AfroMessage
|
|
tags:
|
|
- user
|
|
/api/v1/subscription-plans:
|
|
get:
|
|
description: Returns all subscription plans
|
|
parameters:
|
|
- description: Return only active plans
|
|
in: query
|
|
name: active_only
|
|
type: boolean
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: List subscription plans
|
|
tags:
|
|
- subscriptions
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a new subscription plan (admin only)
|
|
parameters:
|
|
- description: Create plan payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.createPlanReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a subscription plan
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscription-plans/{id}:
|
|
delete:
|
|
description: Deletes a subscription plan (admin only)
|
|
parameters:
|
|
- description: Plan ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Delete a subscription plan
|
|
tags:
|
|
- subscriptions
|
|
get:
|
|
description: Returns a single subscription plan by ID
|
|
parameters:
|
|
- description: Plan ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get a subscription plan
|
|
tags:
|
|
- subscriptions
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a subscription plan (admin only)
|
|
parameters:
|
|
- description: Plan ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update plan payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updatePlanReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update a subscription plan
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscriptions:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
deprecated: true
|
|
description: Creates a new subscription for the authenticated user. For regular
|
|
users, use /payments/subscribe instead.
|
|
parameters:
|
|
- description: Subscribe payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.subscribeReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Subscribe to a plan (Admin only - bypasses payment)
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscriptions/{id}/auto-renew:
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Enables or disables auto-renewal for a subscription
|
|
parameters:
|
|
- description: Subscription ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Auto-renew payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.autoRenewReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Set auto-renew
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscriptions/{id}/cancel:
|
|
post:
|
|
description: Cancels the user's subscription
|
|
parameters:
|
|
- description: Subscription ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Cancel subscription
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscriptions/checkout:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Initiates payment for a subscription plan. Returns payment URL
|
|
for checkout.
|
|
parameters:
|
|
- description: Subscribe with payment payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.subscribeWithPaymentReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"409":
|
|
description: User already has active subscription
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Subscribe to a plan with payment
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscriptions/history:
|
|
get:
|
|
description: Returns the authenticated user's subscription history
|
|
parameters:
|
|
- default: 20
|
|
description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- default: 0
|
|
description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
summary: Get subscription history
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscriptions/me:
|
|
get:
|
|
description: Returns the authenticated user's active subscription
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get current subscription
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/subscriptions/status:
|
|
get:
|
|
description: Returns whether the authenticated user has an active subscription
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
summary: Check subscription status
|
|
tags:
|
|
- subscriptions
|
|
/api/v1/super-login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Login super-admin
|
|
parameters:
|
|
- description: Login super-admin
|
|
in: body
|
|
name: login
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.LoginRequest'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Login super-admin
|
|
tags:
|
|
- auth
|
|
/api/v1/t-approver/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single admin by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get admin by id
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update Admin
|
|
parameters:
|
|
- description: Update Admin
|
|
in: body
|
|
name: admin
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateAdminReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update Admin
|
|
tags:
|
|
- admin
|
|
/api/v1/team/login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Authenticate a team member (internal staff) with email and password
|
|
parameters:
|
|
- description: Team member login credentials
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.TeamMemberLoginReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/handlers.teamMemberLoginRes'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Login team member
|
|
tags:
|
|
- team
|
|
/api/v1/team/me:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get the authenticated team member's own profile
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/domain.TeamMemberResponse'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get my team profile
|
|
tags:
|
|
- team
|
|
/api/v1/team/members:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a paginated list of team members with optional filtering
|
|
parameters:
|
|
- description: Filter by team role (super_admin, admin, content_manager, support_agent,
|
|
instructor, finance, hr, analyst)
|
|
in: query
|
|
name: team_role
|
|
type: string
|
|
- description: Filter by department
|
|
in: query
|
|
name: department
|
|
type: string
|
|
- description: Filter by status (active, inactive, suspended, terminated)
|
|
in: query
|
|
name: status
|
|
type: string
|
|
- description: Search by name, email, or phone number
|
|
in: query
|
|
name: search
|
|
type: string
|
|
- description: 'Page number (default: 1)'
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: 'Items per page (default: 10, max: 100)'
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/domain.TeamMemberResponse'
|
|
type: array
|
|
metadata:
|
|
$ref: '#/definitions/domain.Pagination'
|
|
type: object
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: List all team members
|
|
tags:
|
|
- team
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create a new internal team member (admin only)
|
|
parameters:
|
|
- description: Team member creation payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateTeamMemberReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/domain.TeamMemberResponse'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Create a new team member
|
|
tags:
|
|
- team
|
|
/api/v1/team/members/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Delete a team member (super admin only)
|
|
parameters:
|
|
- description: Team Member ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Delete team member
|
|
tags:
|
|
- team
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Retrieve a team member's details by their ID
|
|
parameters:
|
|
- description: Team Member ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/domain.TeamMemberResponse'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get team member by ID
|
|
tags:
|
|
- team
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update an existing team member's details (admin only)
|
|
parameters:
|
|
- description: Team Member ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Team member update payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateTeamMemberReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Update team member
|
|
tags:
|
|
- team
|
|
/api/v1/team/members/{id}/change-password:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Change a team member's password (requires current password)
|
|
parameters:
|
|
- description: Team Member ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Password change payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.changePasswordReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Change team member password
|
|
tags:
|
|
- team
|
|
/api/v1/team/members/{id}/status:
|
|
patch:
|
|
consumes:
|
|
- application/json
|
|
description: Update a team member's status (active, inactive, suspended, terminated)
|
|
parameters:
|
|
- description: Team Member ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Status update payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateTeamMemberStatusReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Response'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Update team member status
|
|
tags:
|
|
- team
|
|
/api/v1/team/stats:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get statistics about team members by status
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/domain.TeamMemberStats'
|
|
type: object
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"403":
|
|
description: Forbidden
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get team member statistics
|
|
tags:
|
|
- team
|
|
/api/v1/tenant:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Check if phone number or email exist
|
|
parameters:
|
|
- description: Check phone number or email exist
|
|
in: body
|
|
name: checkPhoneEmailExist
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CheckPhoneEmailExistReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Check if phone number or email exist
|
|
tags:
|
|
- user
|
|
/api/v1/user:
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates user profile information (partial updates supported)
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: user_id
|
|
required: true
|
|
type: integer
|
|
- description: Update user payload
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateUserReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Update user profile
|
|
tags:
|
|
- user
|
|
/api/v1/user/{id}/profile-picture:
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: Uploads a profile picture for the specified user
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Image file (jpg|png|webp)
|
|
in: formData
|
|
name: file
|
|
required: true
|
|
type: file
|
|
produces:
|
|
- application/json
|
|
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'
|
|
security:
|
|
- Bearer: []
|
|
summary: Upload profile picture
|
|
tags:
|
|
- user
|
|
/api/v1/user/{user_id}/is-pending:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns whether the specified user has a status of "pending"
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: user_id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Check if user status is pending
|
|
tags:
|
|
- user
|
|
/api/v1/user/{user_id}/is-profile-completed:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns the profile completion status and percentage for the specified
|
|
user
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: user_id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Check if user profile is completed
|
|
tags:
|
|
- user
|
|
/api/v1/user/delete/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Delete a user by their ID
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Delete user by ID
|
|
tags:
|
|
- user
|
|
/api/v1/user/resetPassword:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Reset password
|
|
parameters:
|
|
- description: Reset password
|
|
in: body
|
|
name: resetPassword
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetPasswordReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Reset password
|
|
tags:
|
|
- user
|
|
/api/v1/user/search:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Search for user using name or phone
|
|
parameters:
|
|
- description: Search for using his name or phone
|
|
in: body
|
|
name: searchUserByNameOrPhone
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.SearchUserByNameOrPhoneReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Search for user using name or phone
|
|
tags:
|
|
- user
|
|
/api/v1/user/sendResetCode:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Send reset code
|
|
parameters:
|
|
- description: Send reset code
|
|
in: body
|
|
name: resetCode
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetCodeReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Send reset code
|
|
tags:
|
|
- user
|
|
/api/v1/user/single/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single user by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get user by id
|
|
tags:
|
|
- user
|
|
/api/v1/user/verify-otp:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Verify OTP for registration or other actions
|
|
parameters:
|
|
- description: Verify OTP
|
|
in: body
|
|
name: verifyOtp
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.VerifyOtpReq'
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Verify OTP
|
|
tags:
|
|
- user
|
|
/api/v1/users:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get users with optional filters
|
|
parameters:
|
|
- description: Role filter
|
|
in: query
|
|
name: role
|
|
type: string
|
|
- description: Search query
|
|
in: query
|
|
name: query
|
|
type: string
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
- description: Created before (RFC3339)
|
|
in: query
|
|
name: created_before
|
|
type: string
|
|
- description: Created after (RFC3339)
|
|
in: query
|
|
name: created_after
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
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'
|
|
summary: Get all users
|
|
tags:
|
|
- user
|
|
/api/v1/vimeo/oembed:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Fetches oEmbed metadata for a Vimeo video URL
|
|
parameters:
|
|
- description: Vimeo video URL
|
|
in: query
|
|
name: url
|
|
required: true
|
|
type: string
|
|
- description: Desired width
|
|
in: query
|
|
name: width
|
|
type: integer
|
|
- description: Desired height
|
|
in: query
|
|
name: height
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/vimeo.OEmbedResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get oEmbed data for a Vimeo URL
|
|
tags:
|
|
- Vimeo
|
|
/api/v1/vimeo/uploads/pull:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Initiates a pull upload where Vimeo fetches the video from a URL
|
|
parameters:
|
|
- description: Pull Upload Request
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CreatePullUploadRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/handlers.VimeoUploadResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a pull upload to Vimeo
|
|
tags:
|
|
- Vimeo
|
|
/api/v1/vimeo/uploads/tus:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Initiates a TUS resumable upload and returns the upload link
|
|
parameters:
|
|
- description: TUS Upload Request
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CreateTusUploadRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/handlers.VimeoUploadResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a TUS resumable upload to Vimeo
|
|
tags:
|
|
- Vimeo
|
|
/api/v1/vimeo/videos/{video_id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Deletes a video from the Vimeo account
|
|
parameters:
|
|
- description: Vimeo Video ID
|
|
in: path
|
|
name: video_id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"204":
|
|
description: No Content
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Delete a video from Vimeo
|
|
tags:
|
|
- Vimeo
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Retrieves video details from Vimeo by video ID
|
|
parameters:
|
|
- description: Vimeo Video ID
|
|
in: path
|
|
name: video_id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.VimeoVideoResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get video information from Vimeo
|
|
tags:
|
|
- Vimeo
|
|
/api/v1/vimeo/videos/{video_id}/embed:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Generates an embeddable player iframe for the video
|
|
parameters:
|
|
- description: Vimeo Video ID
|
|
in: path
|
|
name: video_id
|
|
required: true
|
|
type: string
|
|
- default: 640
|
|
description: Player width
|
|
in: query
|
|
name: width
|
|
type: integer
|
|
- default: 360
|
|
description: Player height
|
|
in: query
|
|
name: height
|
|
type: integer
|
|
- description: Autoplay video
|
|
in: query
|
|
name: autoplay
|
|
type: boolean
|
|
- description: Loop video
|
|
in: query
|
|
name: loop
|
|
type: boolean
|
|
- description: Mute video
|
|
in: query
|
|
name: muted
|
|
type: boolean
|
|
- description: Background mode (no controls)
|
|
in: query
|
|
name: background
|
|
type: boolean
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.VimeoEmbedResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get embed code for a Vimeo video
|
|
tags:
|
|
- Vimeo
|
|
/api/v1/vimeo/videos/{video_id}/status:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns the current transcoding status of a video
|
|
parameters:
|
|
- description: Vimeo Video ID
|
|
in: path
|
|
name: video_id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get transcode status of a Vimeo video
|
|
tags:
|
|
- Vimeo
|
|
securityDefinitions:
|
|
Bearer:
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|