From ba3211e24efc8e53b791a92bbc3f785858c6f42b Mon Sep 17 00:00:00 2001 From: Wayne Ngo Date: Sat, 11 Apr 2026 20:20:07 -0700 Subject: [PATCH] add domain models --- internal/core/models/models.go | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 internal/core/models/models.go diff --git a/internal/core/models/models.go b/internal/core/models/models.go new file mode 100644 index 0000000..b0a8589 --- /dev/null +++ b/internal/core/models/models.go @@ -0,0 +1,35 @@ +package models + +import ( + "encoding/json" + "time" +) + +type AssessmentTemplate struct { + ID int64 `json:"id" db:"id"` + Title string `json:"title" db:"title"` + Description *string `json:"description,omitempty" db:"description"` + DurationMinutes int `json:"durationMinutes" db:"duration_minutes"` + CreatedAt time.Time `json:"createdAt" db:"created_at"` + UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` +} + +type Question struct { + ID int64 `json:"id" db:"id"` + AssessmentTemplateID int64 `json:"assessmentTemplateId" db:"assessment_template_id"` + Type string `json:"type" db:"type"` + Prompt string `json:"prompt" db:"prompt"` + Options *json.RawMessage `json:"options,omitempty" db:"options"` + CorrectAnswer *json.RawMessage `json:"correctAnswer,omitempty" db:"correct_answer"` + Score int `json:"score" db:"score"` + Language *string `json:"language,omitempty" db:"language"` +} + +type TestCase struct { + ID int64 `json:"id" db:"id"` + QuestionID int64 `json:"questionId" db:"question_id"` + Input string `json:"input" db:"input"` + ExpectedOutput string `json:"expectedOutput" db:"expected_output"` + IsHidden bool `json:"isHidden" db:"is_hidden"` + Score int `json:"score" db:"score"` +}