527 lines
16 KiB
Go
527 lines
16 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
"fmt"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type AnswerStatus string
|
|
|
|
const (
|
|
AnswerStatusNotStarted AnswerStatus = "not_started"
|
|
AnswerStatusInProgress AnswerStatus = "in_progress"
|
|
AnswerStatusSubmitted AnswerStatus = "submitted"
|
|
AnswerStatusReviewed AnswerStatus = "reviewed"
|
|
)
|
|
|
|
func (e *AnswerStatus) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AnswerStatus(s)
|
|
case string:
|
|
*e = AnswerStatus(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AnswerStatus: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAnswerStatus struct {
|
|
AnswerStatus AnswerStatus `json:"answer_status"`
|
|
Valid bool `json:"valid"` // Valid is true if AnswerStatus is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAnswerStatus) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AnswerStatus, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AnswerStatus.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAnswerStatus) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AnswerStatus), nil
|
|
}
|
|
|
|
type AssignmentNextStepOutcome string
|
|
|
|
const (
|
|
AssignmentNextStepOutcomeRedo AssignmentNextStepOutcome = "redo"
|
|
AssignmentNextStepOutcomeAccept AssignmentNextStepOutcome = "accept"
|
|
AssignmentNextStepOutcomeSupport AssignmentNextStepOutcome = "support"
|
|
)
|
|
|
|
func (e *AssignmentNextStepOutcome) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AssignmentNextStepOutcome(s)
|
|
case string:
|
|
*e = AssignmentNextStepOutcome(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AssignmentNextStepOutcome: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAssignmentNextStepOutcome struct {
|
|
AssignmentNextStepOutcome AssignmentNextStepOutcome `json:"assignment_next_step_outcome"`
|
|
Valid bool `json:"valid"` // Valid is true if AssignmentNextStepOutcome is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAssignmentNextStepOutcome) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AssignmentNextStepOutcome, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AssignmentNextStepOutcome.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAssignmentNextStepOutcome) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AssignmentNextStepOutcome), nil
|
|
}
|
|
|
|
type AssignmentPassStatus string
|
|
|
|
const (
|
|
AssignmentPassStatusPending AssignmentPassStatus = "pending"
|
|
AssignmentPassStatusPass AssignmentPassStatus = "pass"
|
|
AssignmentPassStatusNoPass AssignmentPassStatus = "no_pass"
|
|
)
|
|
|
|
func (e *AssignmentPassStatus) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AssignmentPassStatus(s)
|
|
case string:
|
|
*e = AssignmentPassStatus(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AssignmentPassStatus: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAssignmentPassStatus struct {
|
|
AssignmentPassStatus AssignmentPassStatus `json:"assignment_pass_status"`
|
|
Valid bool `json:"valid"` // Valid is true if AssignmentPassStatus is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAssignmentPassStatus) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AssignmentPassStatus, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AssignmentPassStatus.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAssignmentPassStatus) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AssignmentPassStatus), nil
|
|
}
|
|
|
|
type AssignmentStatus string
|
|
|
|
const (
|
|
AssignmentStatusDraft AssignmentStatus = "draft"
|
|
AssignmentStatusAssigned AssignmentStatus = "assigned"
|
|
AssignmentStatusClosed AssignmentStatus = "closed"
|
|
)
|
|
|
|
func (e *AssignmentStatus) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AssignmentStatus(s)
|
|
case string:
|
|
*e = AssignmentStatus(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AssignmentStatus: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAssignmentStatus struct {
|
|
AssignmentStatus AssignmentStatus `json:"assignment_status"`
|
|
Valid bool `json:"valid"` // Valid is true if AssignmentStatus is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAssignmentStatus) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AssignmentStatus, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AssignmentStatus.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAssignmentStatus) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AssignmentStatus), nil
|
|
}
|
|
|
|
type QuestionDifficulty string
|
|
|
|
const (
|
|
QuestionDifficultyEasy QuestionDifficulty = "easy"
|
|
QuestionDifficultyMedium QuestionDifficulty = "medium"
|
|
QuestionDifficultyHard QuestionDifficulty = "hard"
|
|
)
|
|
|
|
func (e *QuestionDifficulty) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = QuestionDifficulty(s)
|
|
case string:
|
|
*e = QuestionDifficulty(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for QuestionDifficulty: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullQuestionDifficulty struct {
|
|
QuestionDifficulty QuestionDifficulty `json:"question_difficulty"`
|
|
Valid bool `json:"valid"` // Valid is true if QuestionDifficulty is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullQuestionDifficulty) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.QuestionDifficulty, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.QuestionDifficulty.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullQuestionDifficulty) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.QuestionDifficulty), nil
|
|
}
|
|
|
|
type QuestionStatus string
|
|
|
|
const (
|
|
QuestionStatusDraft QuestionStatus = "draft"
|
|
QuestionStatusPublished QuestionStatus = "published"
|
|
QuestionStatusArchived QuestionStatus = "archived"
|
|
)
|
|
|
|
func (e *QuestionStatus) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = QuestionStatus(s)
|
|
case string:
|
|
*e = QuestionStatus(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for QuestionStatus: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullQuestionStatus struct {
|
|
QuestionStatus QuestionStatus `json:"question_status"`
|
|
Valid bool `json:"valid"` // Valid is true if QuestionStatus is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullQuestionStatus) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.QuestionStatus, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.QuestionStatus.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullQuestionStatus) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.QuestionStatus), nil
|
|
}
|
|
|
|
type QuestionTopic string
|
|
|
|
const (
|
|
QuestionTopicPlaceValue QuestionTopic = "place_value"
|
|
QuestionTopicArithmetic QuestionTopic = "arithmetic"
|
|
QuestionTopicNegativeNumbers QuestionTopic = "negative_numbers"
|
|
QuestionTopicBidmas QuestionTopic = "bidmas"
|
|
QuestionTopicFractions QuestionTopic = "fractions"
|
|
QuestionTopicAlgebra QuestionTopic = "algebra"
|
|
QuestionTopicGeometry QuestionTopic = "geometry"
|
|
QuestionTopicData QuestionTopic = "data"
|
|
)
|
|
|
|
func (e *QuestionTopic) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = QuestionTopic(s)
|
|
case string:
|
|
*e = QuestionTopic(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for QuestionTopic: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullQuestionTopic struct {
|
|
QuestionTopic QuestionTopic `json:"question_topic"`
|
|
Valid bool `json:"valid"` // Valid is true if QuestionTopic is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullQuestionTopic) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.QuestionTopic, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.QuestionTopic.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullQuestionTopic) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.QuestionTopic), nil
|
|
}
|
|
|
|
type UserRole string
|
|
|
|
const (
|
|
UserRoleStudent UserRole = "student"
|
|
UserRoleTeacher UserRole = "teacher"
|
|
)
|
|
|
|
func (e *UserRole) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = UserRole(s)
|
|
case string:
|
|
*e = UserRole(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for UserRole: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullUserRole struct {
|
|
UserRole UserRole `json:"user_role"`
|
|
Valid bool `json:"valid"` // Valid is true if UserRole is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullUserRole) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.UserRole, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.UserRole.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullUserRole) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.UserRole), nil
|
|
}
|
|
|
|
type Assignment struct {
|
|
ID int64 `json:"id"`
|
|
ClassroomID int64 `json:"classroom_id"`
|
|
TeacherID int64 `json:"teacher_id"`
|
|
Title string `json:"title"`
|
|
Instructions pgtype.Text `json:"instructions"`
|
|
Status AssignmentStatus `json:"status"`
|
|
DueAt pgtype.Timestamptz `json:"due_at"`
|
|
PublishedAt pgtype.Timestamptz `json:"published_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
PassThreshold pgtype.Numeric `json:"pass_threshold"`
|
|
}
|
|
|
|
type AssignmentAssignee struct {
|
|
AssignmentID int64 `json:"assignment_id"`
|
|
StudentID int64 `json:"student_id"`
|
|
AssignedAt pgtype.Timestamptz `json:"assigned_at"`
|
|
AiFeedback pgtype.Text `json:"ai_feedback"`
|
|
TeacherFeedback pgtype.Text `json:"teacher_feedback"`
|
|
OverallScore pgtype.Numeric `json:"overall_score"`
|
|
PassThreshold pgtype.Numeric `json:"pass_threshold"`
|
|
PassStatus AssignmentPassStatus `json:"pass_status"`
|
|
PassStatusOverride NullAssignmentPassStatus `json:"pass_status_override"`
|
|
NextStepOutcome NullAssignmentNextStepOutcome `json:"next_step_outcome"`
|
|
RedoPlan pgtype.Text `json:"redo_plan"`
|
|
RedoPlanGeneratedAt pgtype.Timestamptz `json:"redo_plan_generated_at"`
|
|
}
|
|
|
|
type AssignmentQuestion struct {
|
|
AssignmentID int64 `json:"assignment_id"`
|
|
QuestionID int64 `json:"question_id"`
|
|
Position int32 `json:"position"`
|
|
}
|
|
|
|
type AssignmentStudentQuestion struct {
|
|
ID int64 `json:"id"`
|
|
AssignmentID int64 `json:"assignment_id"`
|
|
StudentID int64 `json:"student_id"`
|
|
QuestionID int64 `json:"question_id"`
|
|
Position int32 `json:"position"`
|
|
SourceBucket string `json:"source_bucket"`
|
|
SourceTopic NullQuestionTopic `json:"source_topic"`
|
|
SourceDifficulty NullQuestionDifficulty `json:"source_difficulty"`
|
|
GeneratorSeed pgtype.Int8 `json:"generator_seed"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Classroom struct {
|
|
ID int64 `json:"id"`
|
|
TeacherID int64 `json:"teacher_id"`
|
|
Name string `json:"name"`
|
|
Code pgtype.Text `json:"code"`
|
|
Description pgtype.Text `json:"description"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type ClassroomStudent struct {
|
|
ClassroomID int64 `json:"classroom_id"`
|
|
StudentID int64 `json:"student_id"`
|
|
JoinedAt pgtype.Timestamptz `json:"joined_at"`
|
|
}
|
|
|
|
type Message struct {
|
|
ID int64 `json:"id"`
|
|
ThreadID int64 `json:"thread_id"`
|
|
SenderUserID int64 `json:"sender_user_id"`
|
|
Body string `json:"body"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type MessageThread struct {
|
|
ID int64 `json:"id"`
|
|
CreatedByUserID int64 `json:"created_by_user_id"`
|
|
Subject string `json:"subject"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type MessageThreadParticipant struct {
|
|
ThreadID int64 `json:"thread_id"`
|
|
UserID int64 `json:"user_id"`
|
|
JoinedAt pgtype.Timestamptz `json:"joined_at"`
|
|
LastReadAt pgtype.Timestamptz `json:"last_read_at"`
|
|
ArchivedAt pgtype.Timestamptz `json:"archived_at"`
|
|
}
|
|
|
|
type Profile struct {
|
|
UserID int64 `json:"user_id"`
|
|
PreferredName pgtype.Text `json:"preferred_name"`
|
|
ProfileIconUrl pgtype.Text `json:"profile_icon_url"`
|
|
Headline pgtype.Text `json:"headline"`
|
|
Bio pgtype.Text `json:"bio"`
|
|
Timezone pgtype.Text `json:"timezone"`
|
|
Locale pgtype.Text `json:"locale"`
|
|
GradeLevel pgtype.Text `json:"grade_level"`
|
|
LearningGoal pgtype.Text `json:"learning_goal"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Question struct {
|
|
ID int64 `json:"id"`
|
|
AuthorTeacherID int64 `json:"author_teacher_id"`
|
|
Title string `json:"title"`
|
|
Prompt string `json:"prompt"`
|
|
Subject pgtype.Text `json:"subject"`
|
|
Source pgtype.Text `json:"source"`
|
|
Status QuestionStatus `json:"status"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CorrectAnswer pgtype.Text `json:"correct_answer"`
|
|
Topic NullQuestionTopic `json:"topic"`
|
|
Difficulty NullQuestionDifficulty `json:"difficulty"`
|
|
}
|
|
|
|
type QuestionTag struct {
|
|
QuestionID int64 `json:"question_id"`
|
|
TagID int64 `json:"tag_id"`
|
|
}
|
|
|
|
type StudentAnswer struct {
|
|
ID int64 `json:"id"`
|
|
AssignmentID int64 `json:"assignment_id"`
|
|
QuestionID int64 `json:"question_id"`
|
|
StudentID int64 `json:"student_id"`
|
|
AnswerText pgtype.Text `json:"answer_text"`
|
|
AiFeedback pgtype.Text `json:"ai_feedback"`
|
|
TeacherFeedback pgtype.Text `json:"teacher_feedback"`
|
|
Status AnswerStatus `json:"status"`
|
|
SubmittedAt pgtype.Timestamptz `json:"submitted_at"`
|
|
ReviewedAt pgtype.Timestamptz `json:"reviewed_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
SolveMode string `json:"solve_mode"`
|
|
WorkingSteps pgtype.Text `json:"working_steps"`
|
|
IsCorrect pgtype.Bool `json:"is_correct"`
|
|
ReviewNeedsAttention bool `json:"review_needs_attention"`
|
|
ReviewIssueReason pgtype.Text `json:"review_issue_reason"`
|
|
ReviewCorrectnessScore pgtype.Numeric `json:"review_correctness_score"`
|
|
ReviewUnderstandingScore pgtype.Numeric `json:"review_understanding_score"`
|
|
ReviewQuestionScore pgtype.Numeric `json:"review_question_score"`
|
|
ReviewConfidence pgtype.Numeric `json:"review_confidence"`
|
|
ReviewTags []string `json:"review_tags"`
|
|
}
|
|
|
|
type Tag struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type User struct {
|
|
ID int64 `json:"id"`
|
|
Email string `json:"email"`
|
|
PasswordHash pgtype.Text `json:"password_hash"`
|
|
Role UserRole `json:"role"`
|
|
FullName string `json:"full_name"`
|
|
IsActive bool `json:"is_active"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|