package studycave.studycaverestservice.model.flashcard.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.sql.Date;
import java.util.List;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SetCreateDTO {

    private String name;
    private String category;
    private String owner;
    @JsonIgnore
    private long idOwner;
    @JsonProperty("add_date")
    private Date addDate;
    @JsonProperty("edit_date")
    private Date editDate;
    private int grade;
    @ApiModelProperty(value = "Default value for note", required = true,example = "public")
    private String permission;
    List<FlashcardSetCreateDTO> flashcards;

    public void setAddDate() {
        java.util.Date utilDate = new java.util.Date();
        Date sqlDate = new Date(utilDate.getTime());
        this.addDate = sqlDate;
    }

    public void setEditDate() {
        java.util.Date utilDate = new java.util.Date();
        Date sqlDate = new Date(utilDate.getTime());
        this.editDate = sqlDate;
    }

}
