Yimaru-BackEnd/gen/db/models.go
Yared Yemane afdd07d65d Update learner progress to use practice completions only.
Remove lesson completion from learner progress percentages, access completion snapshots, and LMS rollups while keeping generated SQLC and Swagger artifacts in sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 03:27:54 -07:00

619 lines
26 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
package dbgen
import (
"github.com/jackc/pgx/v5/pgtype"
)
type ActivityLog struct {
ID int64 `json:"id"`
ActorID pgtype.Int8 `json:"actor_id"`
ActorRole pgtype.Text `json:"actor_role"`
Action string `json:"action"`
ResourceType string `json:"resource_type"`
ResourceID pgtype.Int8 `json:"resource_id"`
Message pgtype.Text `json:"message"`
Metadata []byte `json:"metadata"`
IpAddress pgtype.Text `json:"ip_address"`
UserAgent pgtype.Text `json:"user_agent"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Course struct {
ID int64 `json:"id"`
ProgramID int64 `json:"program_id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
Thumbnail pgtype.Text `json:"thumbnail"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
SortOrder int32 `json:"sort_order"`
}
type Device struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
DeviceToken string `json:"device_token"`
Platform pgtype.Text `json:"platform"`
IsActive pgtype.Bool `json:"is_active"`
LastSeen pgtype.Timestamptz `json:"last_seen"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type EmailTemplate struct {
ID int64 `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Subject string `json:"subject"`
BodyText string `json:"body_text"`
BodyHtml string `json:"body_html"`
Variables []byte `json:"variables"`
IsSystem bool `json:"is_system"`
Status string `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type ExamPrepCatalogCourse struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
Thumbnail pgtype.Text `json:"thumbnail"`
SortOrder int32 `json:"sort_order"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type ExamPrepLessonPractice struct {
ID int64 `json:"id"`
UnitModuleLessonID int64 `json:"unit_module_lesson_id"`
Title string `json:"title"`
StoryDescription pgtype.Text `json:"story_description"`
StoryImage pgtype.Text `json:"story_image"`
PersonaID pgtype.Int8 `json:"persona_id"`
QuestionSetID int64 `json:"question_set_id"`
QuickTips pgtype.Text `json:"quick_tips"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
PublishStatus string `json:"publish_status"`
}
type ExamPrepUnit struct {
ID int64 `json:"id"`
CatalogCourseID int64 `json:"catalog_course_id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
Thumbnail pgtype.Text `json:"thumbnail"`
SortOrder int32 `json:"sort_order"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type ExamPrepUnitModule struct {
ID int64 `json:"id"`
UnitID int64 `json:"unit_id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
Thumbnail pgtype.Text `json:"thumbnail"`
Icon pgtype.Text `json:"icon"`
SortOrder int32 `json:"sort_order"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type ExamPrepUnitModuleLesson struct {
ID int64 `json:"id"`
UnitModuleID int64 `json:"unit_module_id"`
Title string `json:"title"`
VideoUrl pgtype.Text `json:"video_url"`
Thumbnail pgtype.Text `json:"thumbnail"`
Description pgtype.Text `json:"description"`
SortOrder int32 `json:"sort_order"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Faq struct {
ID int64 `json:"id"`
Question string `json:"question"`
Answer string `json:"answer"`
Category pgtype.Text `json:"category"`
DisplayOrder int32 `json:"display_order"`
Status string `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type FieldOption struct {
ID int64 `json:"id"`
FieldKey string `json:"field_key"`
Code string `json:"code"`
Label string `json:"label"`
DisplayOrder int32 `json:"display_order"`
Status string `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type GlobalSetting struct {
Key string `json:"key"`
Value string `json:"value"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Lesson struct {
ID int64 `json:"id"`
ModuleID int64 `json:"module_id"`
Title string `json:"title"`
VideoUrl pgtype.Text `json:"video_url"`
Thumbnail pgtype.Text `json:"thumbnail"`
Description pgtype.Text `json:"description"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
SortOrder int32 `json:"sort_order"`
PublishStatus string `json:"publish_status"`
}
type LevelToSubCourse struct {
LevelID int64 `json:"level_id"`
SubCourseID int64 `json:"sub_course_id"`
}
type LmsPersona struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
ProfilePicture pgtype.Text `json:"profile_picture"`
IsActive bool `json:"is_active"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
Gender pgtype.Text `json:"gender"`
}
type LmsPractice struct {
ID int64 `json:"id"`
CourseID pgtype.Int8 `json:"course_id"`
ModuleID pgtype.Int8 `json:"module_id"`
LessonID pgtype.Int8 `json:"lesson_id"`
Title string `json:"title"`
StoryDescription pgtype.Text `json:"story_description"`
StoryImage pgtype.Text `json:"story_image"`
PersonaID pgtype.Int8 `json:"persona_id"`
QuestionSetID int64 `json:"question_set_id"`
QuickTips pgtype.Text `json:"quick_tips"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
PublishStatus string `json:"publish_status"`
}
type LmsUserCourseProgress struct {
UserID int64 `json:"user_id"`
CourseID int64 `json:"course_id"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
}
type LmsUserLessonProgress struct {
UserID int64 `json:"user_id"`
LessonID int64 `json:"lesson_id"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
}
type LmsUserModuleProgress struct {
UserID int64 `json:"user_id"`
ModuleID int64 `json:"module_id"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
}
type LmsUserProgramProgress struct {
UserID int64 `json:"user_id"`
ProgramID int64 `json:"program_id"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
}
type MobileAppVersion struct {
ID int64 `json:"id"`
Platform string `json:"platform"`
VersionName string `json:"version_name"`
VersionCode int32 `json:"version_code"`
UpdateType string `json:"update_type"`
ReleaseNotes pgtype.Text `json:"release_notes"`
StoreUrl pgtype.Text `json:"store_url"`
MinSupportedVersionCode pgtype.Int4 `json:"min_supported_version_code"`
Status string `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Module struct {
ID int64 `json:"id"`
ProgramID int64 `json:"program_id"`
CourseID int64 `json:"course_id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
Icon pgtype.Text `json:"icon"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
SortOrder int32 `json:"sort_order"`
}
type ModuleToSubCourse struct {
ModuleID int64 `json:"module_id"`
SubCourseID int64 `json:"sub_course_id"`
}
type Notification struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
Type string `json:"type"`
Level string `json:"level"`
Channel pgtype.Text `json:"channel"`
Title string `json:"title"`
Message string `json:"message"`
Payload []byte `json:"payload"`
IsRead bool `json:"is_read"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ReadAt pgtype.Timestamptz `json:"read_at"`
ReceiverType string `json:"receiver_type"`
}
type Otp struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
SentTo string `json:"sent_to"`
Medium string `json:"medium"`
OtpFor string `json:"otp_for"`
Otp string `json:"otp"`
Used bool `json:"used"`
UsedAt pgtype.Timestamptz `json:"used_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Payment struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
PlanID pgtype.Int8 `json:"plan_id"`
SubscriptionID pgtype.Int8 `json:"subscription_id"`
SessionID pgtype.Text `json:"session_id"`
TransactionID pgtype.Text `json:"transaction_id"`
Nonce string `json:"nonce"`
Amount pgtype.Numeric `json:"amount"`
Currency string `json:"currency"`
PaymentMethod pgtype.Text `json:"payment_method"`
Status string `json:"status"`
PaymentUrl pgtype.Text `json:"payment_url"`
PaidAt pgtype.Timestamptz `json:"paid_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Permission struct {
ID int64 `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
GroupName string `json:"group_name"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Program struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
Thumbnail pgtype.Text `json:"thumbnail"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
SortOrder int32 `json:"sort_order"`
}
type Question struct {
ID int64 `json:"id"`
QuestionText string `json:"question_text"`
QuestionType string `json:"question_type"`
DifficultyLevel pgtype.Text `json:"difficulty_level"`
Points int32 `json:"points"`
Explanation pgtype.Text `json:"explanation"`
Tips pgtype.Text `json:"tips"`
VoicePrompt pgtype.Text `json:"voice_prompt"`
SampleAnswerVoicePrompt pgtype.Text `json:"sample_answer_voice_prompt"`
Status string `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
ImageUrl pgtype.Text `json:"image_url"`
QuestionTypeDefinitionID pgtype.Int8 `json:"question_type_definition_id"`
DynamicPayload []byte `json:"dynamic_payload"`
}
type QuestionAudioAnswer struct {
ID int64 `json:"id"`
QuestionID int64 `json:"question_id"`
CorrectAnswerText string `json:"correct_answer_text"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type QuestionOption struct {
ID int64 `json:"id"`
QuestionID int64 `json:"question_id"`
OptionText string `json:"option_text"`
OptionOrder int32 `json:"option_order"`
IsCorrect bool `json:"is_correct"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type QuestionSet struct {
ID int64 `json:"id"`
Title string `json:"title"`
Description pgtype.Text `json:"description"`
SetType string `json:"set_type"`
OwnerType pgtype.Text `json:"owner_type"`
OwnerID pgtype.Int8 `json:"owner_id"`
BannerImage pgtype.Text `json:"banner_image"`
Persona pgtype.Text `json:"persona"`
TimeLimitMinutes pgtype.Int4 `json:"time_limit_minutes"`
PassingScore pgtype.Int4 `json:"passing_score"`
ShuffleQuestions bool `json:"shuffle_questions"`
Status string `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
DisplayOrder int32 `json:"display_order"`
IntroVideoUrl pgtype.Text `json:"intro_video_url"`
}
type QuestionSetItem struct {
ID int64 `json:"id"`
SetID int64 `json:"set_id"`
QuestionID int64 `json:"question_id"`
DisplayOrder int32 `json:"display_order"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type QuestionSetPersona struct {
ID int64 `json:"id"`
QuestionSetID int64 `json:"question_set_id"`
UserID int64 `json:"user_id"`
DisplayOrder pgtype.Int4 `json:"display_order"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type QuestionShortAnswer struct {
ID int64 `json:"id"`
QuestionID int64 `json:"question_id"`
AcceptableAnswer string `json:"acceptable_answer"`
MatchType string `json:"match_type"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type QuestionTypeDefinition struct {
ID int64 `json:"id"`
Key string `json:"key"`
DisplayName string `json:"display_name"`
Description pgtype.Text `json:"description"`
StimulusComponentKinds []string `json:"stimulus_component_kinds"`
ResponseComponentKinds []string `json:"response_component_kinds"`
IsSystem bool `json:"is_system"`
Status string `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
StimulusSchema []byte `json:"stimulus_schema"`
ResponseSchema []byte `json:"response_schema"`
}
type Rating struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
TargetType string `json:"target_type"`
TargetID int64 `json:"target_id"`
Stars int16 `json:"stars"`
Review pgtype.Text `json:"review"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type RefreshToken struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
Token string `json:"token"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
Revoked bool `json:"revoked"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type ReportedIssue struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
UserRole string `json:"user_role"`
Subject string `json:"subject"`
Description string `json:"description"`
IssueType string `json:"issue_type"`
Status string `json:"status"`
Metadata []byte `json:"metadata"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
type Role struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
IsSystem bool `json:"is_system"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type RolePermission struct {
RoleID int64 `json:"role_id"`
PermissionID int64 `json:"permission_id"`
}
type ScheduledNotification struct {
ID int64 `json:"id"`
Channel string `json:"channel"`
Title pgtype.Text `json:"title"`
Message string `json:"message"`
Html pgtype.Text `json:"html"`
ScheduledAt pgtype.Timestamptz `json:"scheduled_at"`
Status string `json:"status"`
TargetUserIds []int64 `json:"target_user_ids"`
TargetRole pgtype.Text `json:"target_role"`
TargetRaw []byte `json:"target_raw"`
AttemptCount int32 `json:"attempt_count"`
LastError pgtype.Text `json:"last_error"`
ProcessingStartedAt pgtype.Timestamptz `json:"processing_started_at"`
SentAt pgtype.Timestamptz `json:"sent_at"`
CancelledAt pgtype.Timestamptz `json:"cancelled_at"`
CreatedBy int64 `json:"created_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type SubscriptionPlan struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description pgtype.Text `json:"description"`
DurationValue int32 `json:"duration_value"`
DurationUnit string `json:"duration_unit"`
Price pgtype.Numeric `json:"price"`
Currency string `json:"currency"`
IsActive bool `json:"is_active"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type TeamInvitation struct {
ID int64 `json:"id"`
TeamMemberID int64 `json:"team_member_id"`
Token string `json:"token"`
Status string `json:"status"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
InvitedBy pgtype.Int8 `json:"invited_by"`
AcceptedAt pgtype.Timestamptz `json:"accepted_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type TeamMember struct {
ID int64 `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
PhoneNumber pgtype.Text `json:"phone_number"`
Password []byte `json:"password"`
TeamRole string `json:"team_role"`
Department pgtype.Text `json:"department"`
JobTitle pgtype.Text `json:"job_title"`
EmploymentType pgtype.Text `json:"employment_type"`
HireDate pgtype.Date `json:"hire_date"`
ProfilePictureUrl pgtype.Text `json:"profile_picture_url"`
Bio pgtype.Text `json:"bio"`
WorkPhone pgtype.Text `json:"work_phone"`
EmergencyContact pgtype.Text `json:"emergency_contact"`
Status string `json:"status"`
EmailVerified bool `json:"email_verified"`
Permissions []byte `json:"permissions"`
LastLogin pgtype.Timestamptz `json:"last_login"`
CreatedBy pgtype.Int8 `json:"created_by"`
UpdatedBy pgtype.Int8 `json:"updated_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type TeamRefreshToken struct {
ID int64 `json:"id"`
TeamMemberID int64 `json:"team_member_id"`
Token string `json:"token"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
Revoked bool `json:"revoked"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type User struct {
ID int64 `json:"id"`
FirstName pgtype.Text `json:"first_name"`
LastName pgtype.Text `json:"last_name"`
Gender pgtype.Text `json:"gender"`
BirthDay pgtype.Date `json:"birth_day"`
Email pgtype.Text `json:"email"`
PhoneNumber pgtype.Text `json:"phone_number"`
Role string `json:"role"`
Password []byte `json:"password"`
EducationLevel pgtype.Text `json:"education_level"`
Country pgtype.Text `json:"country"`
Region pgtype.Text `json:"region"`
KnowledgeLevel pgtype.Text `json:"knowledge_level"`
NickName pgtype.Text `json:"nick_name"`
Occupation pgtype.Text `json:"occupation"`
LearningGoal pgtype.Text `json:"learning_goal"`
LanguageGoal pgtype.Text `json:"language_goal"`
LanguageChallange pgtype.Text `json:"language_challange"`
FavouriteTopic pgtype.Text `json:"favourite_topic"`
InitialAssessmentCompleted bool `json:"initial_assessment_completed"`
EmailVerified bool `json:"email_verified"`
PhoneVerified bool `json:"phone_verified"`
Status string `json:"status"`
LastLogin pgtype.Timestamptz `json:"last_login"`
ProfileCompleted pgtype.Bool `json:"profile_completed"`
ProfilePictureUrl pgtype.Text `json:"profile_picture_url"`
PreferredLanguage pgtype.Text `json:"preferred_language"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
AgeGroup pgtype.Text `json:"age_group"`
GoogleID pgtype.Text `json:"google_id"`
GoogleEmailVerified pgtype.Bool `json:"google_email_verified"`
ProfileCompletionPercentage int16 `json:"profile_completion_percentage"`
DeletionRequestedAt pgtype.Timestamptz `json:"deletion_requested_at"`
DeletionScheduledAt pgtype.Timestamptz `json:"deletion_scheduled_at"`
DeletionCancelledAt pgtype.Timestamptz `json:"deletion_cancelled_at"`
}
type UserAudioResponse struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
QuestionID int64 `json:"question_id"`
QuestionSetID int64 `json:"question_set_id"`
AudioObjectKey string `json:"audio_object_key"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type UserPracticeProgress struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
QuestionSetID int64 `json:"question_set_id"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type UserSubscription struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
PlanID int64 `json:"plan_id"`
StartsAt pgtype.Timestamptz `json:"starts_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
Status string `json:"status"`
PaymentReference pgtype.Text `json:"payment_reference"`
PaymentMethod pgtype.Text `json:"payment_method"`
AutoRenew bool `json:"auto_renew"`
CancelledAt pgtype.Timestamptz `json:"cancelled_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type UserVideoWatchSession struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
ContentKind string `json:"content_kind"`
ContentID int64 `json:"content_id"`
SessionNumber int32 `json:"session_number"`
VideoDurationSec pgtype.Int4 `json:"video_duration_sec"`
MaxPositionSec int32 `json:"max_position_sec"`
StartedAt pgtype.Timestamptz `json:"started_at"`
LastHeartbeatAt pgtype.Timestamptz `json:"last_heartbeat_at"`
EndedAt pgtype.Timestamptz `json:"ended_at"`
CompletedAt pgtype.Timestamptz `json:"completed_at"`
}