package com.davos.assessment.assessment;

import jakarta.persistence.*;

@Entity
@Table(name = "questions")
public class Question {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "assessment_id", nullable = false)
  private Assessment assessment;

  @Column(nullable = false, unique = true)
  private String code;

  @Column(nullable = false)
  private String dimension;

  @Column(nullable = false, columnDefinition = "text")
  private String prompt;

  @Column(name = "sort_order", nullable = false)
  private int sortOrder;

  public Long getId() { return id; }
  public Assessment getAssessment() { return assessment; }
  public void setAssessment(Assessment assessment) { this.assessment = assessment; }
  public String getCode() { return code; }
  public void setCode(String code) { this.code = code; }
  public String getDimension() { return dimension; }
  public void setDimension(String dimension) { this.dimension = dimension; }
  public String getPrompt() { return prompt; }
  public void setPrompt(String prompt) { this.prompt = prompt; }
  public int getSortOrder() { return sortOrder; }
  public void setSortOrder(int sortOrder) { this.sortOrder = sortOrder; }
}
