package com.davos.assessment.assessment;

import jakarta.persistence.*;

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

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "submission_id", nullable = false)
  private Submission submission;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "question_id", nullable = false)
  private Question question;

  @Column(name = "answer_value", nullable = false)
  private int answerValue;

  public Long getId() { return id; }
  public Submission getSubmission() { return submission; }
  public void setSubmission(Submission submission) { this.submission = submission; }
  public Question getQuestion() { return question; }
  public void setQuestion(Question question) { this.question = question; }
  public int getAnswerValue() { return answerValue; }
  public void setAnswerValue(int answerValue) { this.answerValue = answerValue; }
}
