Skip to main content
Version: Capstone Spring 2025 (Archived)

models

import "github.com/nickrucinski/cloverapi/internal/models"

Index

Constants

const (
DefaultModel = "gemini-2.0-flash"
DefaultVendor = "google"
)
const (
CODE_BLOCK = "code-block"
LINE_BY_LINE = "line-by-line"
CODE_SELECTION = "code-selection"
)
const (
ACTIVE = "ACTIVE"
LOCKED = "LOCKED"
)

type BlockSuggestion

type BlockSuggestion struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
Prompt string `json:"prompt"`
SuggestionArray []string `json:"suggestion_array"`
HasBug bool `json:"has_bug"`
Model string `json:"model"`
Vendor sql.NullString `json:"vendor"`
UserSectionID string `json:"user_section_id"`
Explanation sql.NullString `json:"explanation"`
Language string `json:"language"`
RefinedPrompt *string `json:"refined_prompt,omitempty"`
}

type Class

type Class struct {
ClassID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
ClassTitle string `json:"classTitle"`
ClassCode string `json:"classCode"`
InstructorID string `json:"instructorId"`
ClassHexColor string `json:"classHexColor"`
ClassImageCover *string `json:"classImageCover,omitempty"`
ClassDescription string `json:"classDescription"`
InstructorName *string `json:"instructorName,omitempty"`

JoinedAt time.Time `json:"joinedAt"`
EnrollmentStatus *EnrollmentStatus `json:"enrollmentStatus,omitempty"`
StudentCount int `json:"studentCount"`
Students []User `json:"students,omitempty"`
}

type EnrollmentStatus

type EnrollmentStatus string
const (
WAITLISTED EnrollmentStatus = "WAITLISTED"
ENROLLED EnrollmentStatus = "ENROLLED"
COMPLETED EnrollmentStatus = "COMPLETED"
REMOVED EnrollmentStatus = "REMOVED"
REJECTED EnrollmentStatus = "REJECTED"
)

type Log

type Log struct {
LogID uuid.UUID `json:"log_id"`
LogCreatedAt time.Time `json:"log_created_at"`
Event SuggestionEvent `json:"event"`
Duration int `json:"duration"`
UserID uuid.UUID `json:"user_id"`
ClassID uuid.UUID `json:"class_id"`
SuggestionID uuid.UUID `json:"suggestion_id"`
SuggestionCreated time.Time `json:"suggestion_created_at"`
Prompt string `json:"prompt"`
SuggestionArray []string `json:"suggestion_array"`
HasBug bool `json:"has_bug"`
Model string `json:"model"`
Explanation sql.NullString `json:"explanation"` // Nullable
Vendor string `json:"vendor"`
Language string `json:"language"`
}

type SuggestionEvent

type SuggestionEvent string
const (
SuggestionAccept SuggestionEvent = "SUGGESTION_ACCEPT"
SuggestionReject SuggestionEvent = "SUGGESTION_REJECT"
SuggestionGenerate SuggestionEvent = "SUGGESTION_GENERATE"
SuggestionError SuggestionEvent = "SUGGESTION_ERROR"
SuggestionLineAccept SuggestionEvent = "SUGGESTION_LINE_ACCEPT"
SuggestionLineReject SuggestionEvent = "SUGGESTION_LINE_REJECT"
SuggestionLineGenerate SuggestionEvent = "SUGGESTION_LINE_GENERATE"
SuggestionLineError SuggestionEvent = "SUGGESTION_LINE_ERROR"
SuggestionSelectionGenerate SuggestionEvent = "SUGGESTION_SELECTION_GENERATE"
SuggestionSelectionAccept SuggestionEvent = "SUGGESTION_SELECTION_ACCEPT"
SuggestionSelectionReject SuggestionEvent = "SUGGESTION_SELECTION_REJECT"
SuggestionSelectionError SuggestionEvent = "SUGGESTION_SELECTION_ERROR"
)

type SuggestionItem

type SuggestionItem struct {
HasBug bool `json:"has_bug"`
MainLine string `json:"main_line"`
FixedLine string `json:"fixed_line"`
}

type User

type User struct {
ID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Status UserStatus `json:"status"`
Settings UserSettings `json:"settings"`
Role UserRole `json:"role"`
AvatarURL string `json:"avatarUrl,omitempty"`
}

type UserMode

type UserMode string
const (
BLOCK UserMode = "CODE_BLOCK"
LINE UserMode = "LINE_BY_LINE"
SELECTION UserMode = "CODE_SELECTION"
Off UserMode = "OFF"
)

type UserRole

type UserRole string
const (
STUDENT UserRole = "STUDENT"
INSTRUCTOR UserRole = "INSTRUCTOR"
ADMIN UserRole = "ADMIN"
DEVELOPER UserRole = "DEVELOPER"
)

type UserSettings

type UserSettings struct {
EnableQuiz *bool `json:"enableQuiz"`
BugPercentage *int `json:"bugPercentage"`
ShowNotifications *bool `json:"showNotifications"`
Mode string `json:"mode"`
}

type UserStatus

type UserStatus string

Generated by gomarkdoc