package dev.ksan.etfoglasiserver.dto;

import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;

public class EntryDTO {

  private UUID id;
  private String title;
  private String group;
  private LocalDateTime time_published;
  private String info_entry;
  private String paragraph;
  private String filepath;
  private UUID subjectId;

  public EntryDTO() {}
  public EntryDTO( String title, String group, LocalDateTime time_published, String info_entry, String paragraph, String filepath, UUID subjectId) {
    this.title = title;
    this.group = group;
    this.time_published = time_published;
    this.info_entry = info_entry;
    this.paragraph = paragraph;
    this.filepath = filepath;
    this.subjectId = subjectId;

  }
  public EntryDTO( String title, LocalDateTime time_published, String info_entry, List<String> paragraphs, String filepath, UUID subjectId) {
    this.title = title;
    this.time_published = time_published;
    this.info_entry = info_entry;
    this.paragraph = String.join("\n",paragraphs);
    this.filepath = filepath;
    this.subjectId = subjectId;

  }

  public UUID getSubjectId() {
    return subjectId;
  }

  public UUID getId() {
      return id;
  }

  public void setId(UUID id) {
      this.id = id;
  }
  public void setSubjectId(UUID subjectId) {
    this.subjectId = subjectId;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public LocalDateTime getTime_published() {
    return time_published;
  }

  public void setParagraph(List<String> paragraphs) {
    this.paragraph = String.join("\n", paragraphs);
  }

  public void setTime_published(LocalDateTime time_published) {
    this.time_published = time_published;
  }

  public String getInfo_entry() {
    return info_entry;
  }

  public void setInfo_entry(String info_entry) {
    this.info_entry = info_entry;
  }

  public String getParagraph() {
    return paragraph;
  }

  public void setParagraph(String paragraph) {
    this.paragraph = paragraph;
  }

  public String getFilepath() {
    return filepath;
  }

  public void setFilepath(String filepath) {
    this.filepath = filepath;
  }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }
}
