package http import ( "time" domain "knowfoolery/backend/services/question-bank-service/internal/domain/question" ) // QuestionResponse is a public API response payload for question data. type QuestionResponse struct { ID string `json:"id"` Theme string `json:"theme"` Text string `json:"text"` Hint string `json:"hint,omitempty"` Difficulty domain.Difficulty `json:"difficulty"` IsActive bool `json:"is_active,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` } func toQuestionResponse(q *domain.Question, admin bool) QuestionResponse { resp := QuestionResponse{ ID: q.ID, Theme: q.Theme, Text: q.Text, Hint: q.Hint, Difficulty: q.Difficulty, } if admin { resp.IsActive = q.IsActive resp.CreatedAt = &q.CreatedAt resp.UpdatedAt = &q.UpdatedAt } return resp }